This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: variables numbers and apply templates
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] variables numbers and apply templates
- From: David Carlisle <davidc at nag dot co dot uk>
- Date: Wed, 24 Oct 2001 18:39:28 +0100
- References: <200110241617.MAA07095@biglist.com> <3BD6F61A.4EDE1BA6@portalyx.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
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