On Wed, 2008-09-10 at 20:38 +0200, Florent André wrote: > Hy list > > I try to display a tree of post. > > The tree of post is récupéré with the collection mark. > > In my site map I had this (the complete file is attached : forum-map.xmap)
To actually say something meaningful the interesting part is not posted. > : > ------------------------ code sitemap --------------------- > .... > <map:transform > src="fallback://lenya/modules/collection/xslt/collection2cinclude.xsl"> > <map:parameter name="uuid" value="{4}"/> > <map:parameter name="language" value="{5}"/> > </map:transform> > <map:transform type="cinclude"/> Put a <map:serialize type="xml"/> here to see what goes in collection2html.xsl. > <map:transform > src="fallback://lenya/modules/forums/xslt/collection2html.xsl"/> > > <map:serialize type="xml"/> > </map:match> > > .... > --------------------------------------------------------- > > > My xsl collection2html.xsl display all posts. Meaning it works like you want, or not? > However, I had a strange > behaviour with this xsl. > > My collection2html.xsl : > ------------------- code ----------------------- > <?xml version="1.0" encoding="UTF-8" ?> > > <xsl:stylesheet version="1.0" > ... > > > > > <xsl:template match="/col:collection"> Meaning the root element is col:collection, right? > <html>... > </xsl:stylesheet> > > ----------------------------------------------- > I explain my strange behaviour : > > If I remove the bloc <xsl:template match="@*|node()">, only the parents > posts are display... to comment here we need to see the input to the xsl (see above). > and if I use the copy block, the xsl begin from the > start. What do you mean with begin from the start? > So my problems are : > I can't define a « first template » who define an header (eg : > « welcome to the post //// ») and a footer (eg : a cool png) for my > list of post. Why not? > I can't know the depth of the treatment, so I can't define a max depth for > eg. Not sure what you mean. > > I think that this problem come from the "SAX system" : the <map:transform > type="cinclude"/> send a flow, so my collection2html.xsl is reload for each > <collection>... I'm wrong ? Or unclear ? No, it has nothing to do with DOM or SAX. The cinclude will include different documents we need to see a example. > > So, with my hypothesis, I try to create a file (serialise the flow) before > my collection2html.xsl You mean serialize the stream and yes this way you will see what is the input of the collection2html.xsl but in any way my guess is that it is a xsl problem (you make some very specific matches). > > I try different thinks, but I'm not a star in map.. and I don't find a work > solution. > > Test 1 : > ---------------code -------------- > .... > <map:transform type="cinclude"/> > <map:generate src="cocoon:/remove"/> > Please consult the cocoon documentation. You cannot use a generator after a transformer that is violating the concept of a pipeline. A generator is ALWAYS the first component in a pipeline. > <map:transform > src="fallback://lenya/modules/forums/xslt/collection2html.xsl"/> > ---------------- > result : error !! :) > > > Test 2 : > --------- code ----------------- > .... > <map:transform type="cinclude"/> > <map:generate src="cocoon:/remove"/> see above. > <map:transform > src="fallback://lenya/modules/forums/xslt/collection2html.xsl"/> > <map:serialize type="xml"/> > </map:match> > > <map:match pattern="remove"> > <map:transform > src="fallback://lenya/modules/forums/xslt/removeCinclude.xsl"/> see above. A transformer needs a event stream to do the transformation. > <map:serialize type="xml"/> > </map:match> > > ---- removeCinclude.xsl : ---- > <xsl:template match="@*|node()"> > <xsl:copy> > <xsl:apply-templates select="@*|node()"/> > </xsl:copy> > </xsl:template> > -------------------------------- > result : nothing come out ! :( I hope (!!) that the <map:generate > src="cocoon:/remove"/>, will create a nice file that my collection2html.xsl > can easy transform with no strange behaviour, but cocoon said me : No Way ! > :) Yeah, see above basic violation of the whole concept of the pipeline. salu2 -- Thorsten Scherler thorsten.at.apache.org Open Source Java consulting, training and solutions --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]