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 18:05:21 UTC

Content Aggregation?

Hi All,

Its the similar scenario as is been discussed on the list this days for "Dynamic Aggregation", but a different flavor. What I am trying to acheive is aggregate a bunch of XML documents into a large XML document with the contents of all those small XML documents. But I am not sure what XML documents need to be aggregated, so you can say the list of XML documents to be aggregated is Dynamically generated. I read all the answers to the queries asked on "Dynamic Aggregation" . But that was too complex for me right now and I am not a Cocoon guy, started learning few days back.

So heres my sitemap.xmap :

<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:transform src="adh/styles/builddocument.xsl"/>
          <map:transform type="cinclude"/>
          <map:serialize type="html"/>
</map:match>

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

The output I get after the buildsearch.xsl looks like this:

<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>

===================================================================
Now I am trying to capture all thats in the <uri> and aggregate those xml documents, thats what I am doing in my builddocument.xsl , which looks like this:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sql="http://apache.org/cocoon/SQL/2.0" xmlns:cinclude="http://apache.org/cocoon/include/1.0">


<xsl:template match="results">
  <frag>
    <xsl:for-each select="sql:rowset/sql:row/sql:uri">
            <xsl:apply-templates select="sql:uri"/>
    </xsl:for-each>
  </frag>
</xsl:template>

<xsl:template match="sql:uri">
        <cinclude:include src="{uri}"/>
</xsl:template>

</xsl:stylesheet>

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

This results in a blank page. I know theres something wrong the way I am trying to include the XML documents in the <uri> but I am not able to resolve it. Hope you might be of some help to me !!!!

I would appreciate any help coming from your side.

Thanks in advance.

Regards
Sam 

Re: Content Aggregation?

Posted by Thorsten Scherler <th...@juntadeandalucia.es>.
Hi Sam,

>========================================================
>
>The output I get after the buildsearch.xsl looks like this:
>
><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>
>
>===================================================================
>Now I am trying to capture all thats in the <uri> and aggregate those xml documents, thats what I am doing in my builddocument.xsl , which looks like this:
>
><?xml version="1.0"?>
><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>xmlns:sql="http://apache.org/cocoon/SQL/2.0" xmlns:cinclude="http://apache.org/cocoon/include/1.0">
>
>
><xsl:template match="results">
>  <frag>
>    <xsl:for-each select="sql:rowset/sql:row/sql:uri">
>            <xsl:apply-templates select="sql:uri"/>
>    </xsl:for-each>
>  </frag>
></xsl:template>
>
><xsl:template match="sql:uri">
>        <cinclude:include src="{uri}"/>
></xsl:template>
>
></xsl:stylesheet>
>
>==========================================================
>
>This results in a blank page. I know theres something wrong the way I am trying to include the XML documents in the <uri> but I am not able to resolve it. Hope you might be of some help to me !!!!
>
>  
>

Jupp, that is quite logical that you get a blank page because you matching

sql:rowset/sql:row/sql:uri

which is not in your buildsearch.xsl!!!

Try to match
rowset/row/uri


HTH
King regards
Thorsten

>I would appreciate any help coming from your side.
>
>Thanks in advance.
>
>Regards
>Sam 
>  
>


-- 
Thorsten Scherler

Departamento de Desarrollo de Proyectos
Sociedad Andaluza para el Desarrollo de la Sociedad de la Información S.A.U.
Avda. de la Arboleda s/n
41940 - Tomares,  (Sevilla)
Tlfn: (+34) 955 062 627
e-mail: thorsten.scherler.ext@juntadeandalucia.es

Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
contiene información de carácter confidencial exclusivamente dirigida a su
destinatario o destinatarios. Queda prohibida su divulgación, copia o
distribución a terceros sin la previa autorización escrita de "Sociedad
Andaluza para el Desarrollo de la Sociedad de la Información, S.A.U.". Si no
es Ud. el destinatario del mensaje le ruego lo destruya sin hacer copia
digital o física, comunicando a Sociedad Andaluza para el Desarrollo de la
Sociedad de la Información S.A.U. vía e-mail o fax la recepción del presente
mensaje. Toda declaración de voluntad contenida deberá ser tenida por no
producida. Gracias.
____________________________________________________________________________
___________________

The information in this e-mail and in any attachments is confidential and
solely for the attention and use of the named addressee(s). You are hereby
notified that any dissemination, distribution or copy of this communication
is prohibited without the prior written consent of "Sociedad Andaluza para
el Desarrollo de la Sociedad de la Información, S.A.U.". If you are not the
formal receiver of this message please destroy it without making any digital
or physical copy and inform "Sociedad Andaluza para el Desarrollo de la
Sociedad de la Información S.A.U." , by e-mail or fax, of the reception of
the present message. Any whatsoever involuntary declaration contained
herewith must be taken as having no legal effect. Thank you.



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


SV: Content Aggregation?

Posted by Askild Aaberg Olsen <as...@xangeli.com>.
Sam wrote:
> <xsl:for-each select="sql:rowset/sql:row/sql:uri">
>     <xsl:apply-templates select="sql:uri"/>
> </xsl:for-each>

This is the same as:

<xsl:apply-templates select="sql:rowset/sql:row/sql:uri/sql:uri"/>

What you need is:

<xsl:apply-templates select="sql:rowset/sql:row/sql:uri"/>

You don't need the <xsl:for-each/> then.

Askild
-


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