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)
:
------------------------ 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"/>
        
        <map:transform
src="fallback://lenya/modules/forums/xslt/collection2html.xsl"/>

        <map:serialize type="xml"/>
      </map:match>

....
---------------------------------------------------------


My xsl collection2html.xsl display all posts. 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"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    xmlns:xhtml="http://www.w3.org/1999/xhtml";
    xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0";
    xmlns="http://www.w3.org/1999/xhtml";   
    xmlns:dc="http://purl.org/dc/elements/1.1/";
    xmlns:col="http://apache.org/cocoon/lenya/collection/1.0";
    xmlns:meta="http://apache.org/cocoon/lenya/metadata/1.0";
    xmlns:i18n="http://apache.org/cocoon/i18n/2.1";
    >
    
            
    <xsl:template match="/col:collection">
        <html>
                <body id="bodyFLO">
                        <p> collection </p>
                        <xsl:apply-templates select="col:document"/>
                        
                        <h3> <a href="/coucou"> COUCOU </a> </h3>
                </body>
        </html>
    </xsl:template>
    
    
    <xsl:template match="col:document">
        <xsl:variable name="titleCOL"
select="meta:metadata/dc:elements/dc:title"/>
        <h1> titre du document : <xsl:value-of select="$titleCOL"/> </h1>
         <xsl:apply-templates select="xhtml:html"/>
    </xsl:template>
    
    <xsl:template match="xhtml:html">
        <p> contenu du document</p>
        <xsl:apply-templates select="xhtml:body"/>
    </xsl:template>
    
    <xsl:template match="xhtml:body">
                <p> BODY </p>
                 <xsl:apply-templates select="@*|node()"/>
        </xsl:template>
        
        
        <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>
      
</xsl:stylesheet> 
 
-----------------------------------------------
I explain my strange behaviour :

If I remove the bloc <xsl:template match="@*|node()">, only the parents
posts are display... and if I use the copy block, the xsl 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.
I can't know the depth of the treatment, so I can't define a max depth for
eg.

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 ?

So, with my hypothesis, I try to create a file (serialise the flow) before
my collection2html.xsl

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

    <map:transform
src="fallback://lenya/modules/forums/xslt/collection2html.xsl"/>
----------------
result : error !! :)
       

Test 2 :
--------- code -----------------
....
       <map:transform type="cinclude"/>
        <map:generate src="cocoon:/remove"/>
        <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"/> 
        <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 !
:)


I'm totally wrong or not ? Can you give me some help ?

Thanks

Attachment: forum-map.xmap
Description: Binary data

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to