When using the Numbering function it actually gets the node position(). How to exclude items appearing more than once in the xml, from the numbering procedure ? This is My simple xml demo:
<?xml-stylesheet type="text/xsl" href="numbers.xsl"?>
<cars>
<manufacturer name="Chevrolet">
<car>Cavalier</car>
<car>Cavalier</car>
<car>Corvette</car>
<car>Impala</car>
</manufacturer>
<manufacturer name="Ford">
<car>Pinto</car>
<car>Pinto</car>
<car>Mustang</car>
<car>Taurus</car>
</manufacturer>
</cars>
This is My xsl:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:text>Automobile manufacturers and their cars
</xsl:text>
<xsl:for-each select="cars/manufacturer">
<xsl:text> Table_</xsl:text>
<xsl:number count="manufacturer" format="A. ("/>
<xsl:value-of select="@name"/>
<xsl:text>)
</xsl:text>
<xsl:for-each select="car">
<xsl:if test="not(preceding::*[car = current()/car])">
<xsl:number count="car" level="any" format=" 1. "/>
<xsl:value-of select="."/>
<xsl:text>
</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
This is the desired output:
Table_A. (Chevrolet)
- Cavalier
- Corvette
- Impala
Table_B. (Ford)
- Pinto
- Mustang
- Taurus
Thanks in advance