You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Sam <sa...@rediffmail.com> on 2004/05/11 05:03:26 UTC

Help needed with Content Aggregation ???

Hi group, 

I am not getting any clues how I could aggregate different XML documents into one lagre XML document. What I am trying to do is fetching a list of URI from the database depending upon the search keyword send by the client. I am able to get the following as a result of the search made by the client.

==================================================================
<results>
    <rowset>
       <row>
           <uri>adh/resources/fragments/abstractlist.xml</uri>
       </row>
       <row>
           <uri>adh/resources/fragments/arraylist.xml</uri>
       </row>
       <row>
           <uri>adh/resources/fragments/linkedlist.xml</uri>
       </row>
       <row>
           <uri>adh/resources/fragments/vector.xml</uri>
       </row>
    </rowset>
</results>

=================================================================

The pipeline used for the above looks something like this:


<map:match pattern="adh">
    <map:generate src="adh/resources/start.xml"/>
    <map:transform src="adh/styles/start.xsl"/>
    <map:serialize type="html"/>
</map:match>

<map:match pattern="adh/user/search">
     <map:generate src="adh/resources/search.xml"/>
     <map:transform src="adh/styles/buildsearch.xsl">
         <map:parameter name="use-request-parameters" value="true"/>
     </map:transform>
     <map:transform type="sql">
          <map:parameter name="use-connection" value="portal"/>
     </map:transform>
     <map:serialize type="xml"/>
</map:match>

====================================================================

What I am trying to do is build a large XML document on the fly from the contents of all the search results as requested by the client(for ex: abstractlist.xml , arraylist.xml, linkedlist.xml, vector.xml  in  my case) 


But I am not getting ideas how will I aggregate this XML documents into one large XML document. Mainly how should I define a pipeline to do this ???

First I thought I would use a subsitemap for builing this large XML document, but was not sure how to intergrate the existing pipeline with the subsitemap.

Could anybody help me out with this thing ???

All suggestions accepted !!!!

Regards
Sam

Re: Help needed with Content Aggregation ???

Posted by Thomas <bi...@gmx.de>.
Hello!

   You could use the C/XInclude Transformer. First your XML should be
   transformed to something like...

   <xi:include href="adh/resources/fragments/abstractlist.xml"/>
   <xi:include href="adh/resources/fragments/arraylist.xml"/>
   ...

   then you can use the XInlcude Transformer to replace the "xi:include"
   tags with your content.

   Your sitemap should be extended like...

   <map:transform src="rowset2xinclude.xslt"/>
   <map:transform type="xinclude"/>

   See also

http://cocoon.apache.org/2.1/userdocs/transformers/xinclude-transformer.html
http://cocoon.apache.org/2.1/userdocs/transformers/cinclude-transformer.html

Regards,
   Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Help needed with Content Aggregation ???

Posted by Jean Pierre LeJacq <jp...@quoininc.com>.
On 11 May 2004, Sam wrote:

> I am not getting any clues how I could aggregate different XML
> documents into one lagre XML document. What I am trying to do is
> fetching a list of URI from the database depending upon the search
> keyword send by the client. I am able to get the following as a

Have you investigated the cocoon aggregation facility:

  http://cocoon.apache.org/2.1/faq/faq-aggregators.html

Should be exactly what you want.

-- 
JP



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org