G
Guiding5
Hi group!
Basic question about counting specific nodes in the range, here the
example:
XSL:
<xsl:stylesheet version="1.0">
<xsl:template match="/">
Red cars:
<xsl:for-each select="car">
<xsl:if test="color = 'red'">
<xsl:number select="position()"/>.
<xsl:value-of select="manufacturer"/> ( <xsl:value-of
select="model"/> )
</xsl:if>
</xsl:for-each>
Blue cars:
<xsl:for-each select="car">
<xsl:if test="color = 'blue'">
<xsl:number select="position()"/>.
<xsl:value-of select="manufacturer"/> ( <xsl:value-of
select="model"/> )
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
I want to get XSLT result that will look like:
Red cars:
1. Ford (67)
2. AM (78)
Blue cars:
1. Fiat (92)
2. Toyota (06)
3. Ford (05)
But instead of it I get numbering of actualy nodes positions in
original XML.
Basic question about counting specific nodes in the range, here the
example:
XSL:
<xsl:stylesheet version="1.0">
<xsl:template match="/">
Red cars:
<xsl:for-each select="car">
<xsl:if test="color = 'red'">
<xsl:number select="position()"/>.
<xsl:value-of select="manufacturer"/> ( <xsl:value-of
select="model"/> )
</xsl:if>
</xsl:for-each>
Blue cars:
<xsl:for-each select="car">
<xsl:if test="color = 'blue'">
<xsl:number select="position()"/>.
<xsl:value-of select="manufacturer"/> ( <xsl:value-of
select="model"/> )
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
I want to get XSLT result that will look like:
Red cars:
1. Ford (67)
2. AM (78)
Blue cars:
1. Fiat (92)
2. Toyota (06)
3. Ford (05)
But instead of it I get numbering of actualy nodes positions in
original XML.