cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <gree...@hotmail.com>
Subject Re: problem with <xsl:process-children/>
Date Thu, 26 Oct 2000 14:31:27 GMT
"Khomik Rostislav" <khomik@hotmail.com> wrote:
> > As I said before you can use this:
> >
> > <xsl:template match="root">
> >     <DIV id="{text()}">
> >     <xsl:apply-templates />
> >    </DIV>
> > </xsl:template>
>
>In this case it works - I become:
><DIV id="root">
>      Leaf1<BR>
>      Leaf2<BR>
>...
>
></DIV>
>
> > <xsl:template match="collapsed_node>
> >     <DIV id="{text()}">
> >     <xsl:apply:templates />
> >    </DIV>
> > </xsl:template>
>
>But here I become:
>
><DIV id="Node 1">Node1</DIV>
>
>It seems like <xsl:apply:templates /> works onfy by the first occurence in
>the stylesheet.

No no. The reason for that not working is, the default template (which is 
applied when nothing else matches) doesn't copy anything. Whenever you need 
to copy something, xsl:apply-templates is NOT ENOUGH - you need something 
explicitly to say "copy this", like a matching template (or, instead of 
xsl:apply-templates and having a separate template, you could just use 
<xsl:copy-of>). You must have learned XSL from an old source that is 
out-of-date. You need something more up-to-date.


_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


Mime
View raw message