You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Simone Gianni <si...@discoone.com> on 2001/10/20 02:04:25 UTC

Aggregate and root elements

Hi all ..

	I'm trying to do, with cocoon 2rc1, something like this : aggregate some 
contents, between these there are some which are themself aggregated, these 
are boxes on the right of my page, and some of them are static and common 
for all the site, some others are specific to a certain path, some others 
are based on other parameters.

	The boxes are in some files, some of this contain only one box, some 
others contain more that one box. So the structure of this XMl files is 
like this :

<boxes>
	<box id="1234">
		<title>Ciao</title>
		<body>This is the body of the box</body>
	</box>
	<box id="5678">
		<title>Ciao</title>
		<body>This is the body of the box</body>
	</box>
</boxes>

	When i aggregate them, i can add a root element to the entire aggregation, 
add a root element to every single aggregated file, but cannot remove the 
root "boxes" element in each file to obtain a plain box list.

	Is there a way to do it ? to remove the root element of an aggregated 
document?

	Thanks, ciao,

	Simone Gianni


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


AW: Aggregate and root elements

Posted by Jorn Heid <he...@fh-heilbronn.de>.
I think it's:

strip-root="true"

not 'stripRootElement'.

You can look into the sitemap.xsl. There, you can find all
attributes/elements Cocoon transforms into the sitemap class.

-----Ursprungliche Nachricht-----
Von: Simone Gianni [mailto:simone@discoone.com]
Gesendet: Samstag, 20. Oktober 2001 15:35
An: cocoon-users@xml.apache.org
Betreff: RE: Aggregate and root elements


At 14.13 20/10/2001 +0200, Luca wrote:
>Simone,
>
>         I think you should add another <msp:transform> stage in your
> pipeline in
>order to remove the <boxes> tag; just a simple template element like this:
>
>         <xsl:template match="boxes">
>                 <xsl:copy-of select="*|@*"/>
>         </xsl:template>
>
>         will do.

You are right .... this could be a solution, anyway there is a
"stripRootElement" in the map:aggregate, as is visible in this excerpt from
the cocoon log :


DEBUG   (2001-10-20) 15:21.08:940   [cocoon  ]
(/cocoon/calcio/story105.source) Thread-18/AbstractSitemap: Substitute
evaluated value for 1 as calcio
DEBUG   (2001-10-20) 15:21.08:940   [cocoon  ]
(/cocoon/calcio/story105.source) Thread-18/ContentAggregator:
ContentAggregator: part uri='cocoon:/calcio.nav' element='' ns=''
stripRootElement='' prefix=''

I think it's not been documented yet, and unfortunately I have not found it
in the source :(( I tried stripRootElement="yes", stripRootElement="true"
etc ... but nothing seem to work.

Ciao e grazie

Simone Gianni


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: Aggregate and root elements

Posted by Simone Gianni <si...@discoone.com>.
At 14.13 20/10/2001 +0200, Luca wrote:
>Simone,
>
>         I think you should add another <msp:transform> stage in your 
> pipeline in
>order to remove the <boxes> tag; just a simple template element like this:
>
>         <xsl:template match="boxes">
>                 <xsl:copy-of select="*|@*"/>
>         </xsl:template>
>
>         will do.

You are right .... this could be a solution, anyway there is a 
"stripRootElement" in the map:aggregate, as is visible in this excerpt from 
the cocoon log :


DEBUG   (2001-10-20) 15:21.08:940   [cocoon  ] 
(/cocoon/calcio/story105.source) Thread-18/AbstractSitemap: Substitute 
evaluated value for 1 as calcio
DEBUG   (2001-10-20) 15:21.08:940   [cocoon  ] 
(/cocoon/calcio/story105.source) Thread-18/ContentAggregator: 
ContentAggregator: part uri='cocoon:/calcio.nav' element='' ns='' 
stripRootElement='' prefix=''

I think it's not been documented yet, and unfortunately I have not found it 
in the source :(( I tried stripRootElement="yes", stripRootElement="true" 
etc ... but nothing seem to work.

Ciao e grazie

Simone Gianni


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: Aggregate and root elements

Posted by Luca Morandini <l....@tin.it>.
Simone,

	I think you should add another <msp:transform> stage in your pipeline in
order to remove the <boxes> tag; just a simple template element like this:

	<xsl:template match="boxes">
		<xsl:copy-of select="*|@*"/>
	</xsl:template>

	will do.

Best regards,

---------------------------------------------
               Luca Morandini
               GIS Consultant
              lmorandini@ieee.org
http://utenti.tripod.it/lmorandini/index.html
---------------------------------------------


> -----Original Message-----
> From: Simone Gianni [mailto:simone@discoone.com]
> Sent: Saturday, October 20, 2001 2:04 AM
> To: cocoon-users@xml.apache.org
> Subject: Aggregate and root elements
>
>
> Hi all ..
>
> 	I'm trying to do, with cocoon 2rc1, something like this :
> aggregate some
> contents, between these there are some which are themself
> aggregated, these
> are boxes on the right of my page, and some of them are static and common
> for all the site, some others are specific to a certain path, some others
> are based on other parameters.
>
> 	The boxes are in some files, some of this contain only one
> box, some
> others contain more that one box. So the structure of this XMl files is
> like this :
>
> <boxes>
> 	<box id="1234">
> 		<title>Ciao</title>
> 		<body>This is the body of the box</body>
> 	</box>
> 	<box id="5678">
> 		<title>Ciao</title>
> 		<body>This is the body of the box</body>
> 	</box>
> </boxes>
>
> 	When i aggregate them, i can add a root element to the
> entire aggregation,
> add a root element to every single aggregated file, but cannot remove the
> root "boxes" element in each file to obtain a plain box list.
>
> 	Is there a way to do it ? to remove the root element of an
> aggregated
> document?
>
> 	Thanks, ciao,
>
> 	Simone Gianni
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>