Re: [xsl] variables numbers and apply templates

Subject: Re: [xsl] variables numbers and apply templates
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 24 Oct 2001 18:39:28 +0100
I am trying to guess from your template what your input and desired
output looks like, but I think you have sections like so

<sect1>
...
<sect2>
...
<sect3>
...
</sect3>
</sect2>

<sect2>
...
<sect3>
...
</sect3>
</sect2>

</sect1>

and you want to generate an equivalent tree but without the ... and with
elements called toclevel1 rather than sect1 is that right?

If so it looks like

<xsl:template match="sect1|sect2|sect3|sect4|sect5" mode="createtoc">
<xsl:element name="tocl{translate(name(),'sect','evel}">
<xsl:apply-templates select="sect1|sect2|sect3|sect4|sect5" mode="createtoc"/>
</xsl:element>
</xsl:template>

would do the job.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread