Re: [xsl] incrementing the index value

Subject: Re: [xsl] incrementing the index value
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 9 Jun 2005 14:58:05 +0100
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
	<xsl:output method="xml" indent="yes" version="1.0" />

<xsl:variable name="order" select="' textbox radio '"/>

<xsl:template match="Layout">
<taborder>
<fieldlist> 
<xsl:apply-templates select=".//Box/*[@id]">
  <xsl:sort select="substring-before($order,name())"/>
</xsl:apply-templates>
</fieldlist>
</taborder>	
</xsl:template>

<xsl:template match="Box/*">
 <field name="{@id}" tabindex="{position()}"/>
</xsl:template>

</xsl:stylesheet>



$ saxon box.xml box.xsl
<?xml version="1.0" encoding="utf-8"?>
<taborder>
   <fieldlist>
      <field name="textbox" tabindex="1"/>
      <field name="textbox1" tabindex="2"/>
      <field name="TextBox2" tabindex="3"/>
      <field name="TextBox3" tabindex="4"/>
      <field name="radio" tabindex="5"/>
   </fieldlist>
</taborder>

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread