|
For the XML input
<colors>
<color>red</color>
<color>green</color>
<color>blue</color>
<color>yellow</color>
</colors>
the author claims that the XPath
(color)
is needed to have the sequence of <color> elements but I think that the brackets are not needed, it would suffice to use
<xsl:template match="colors">
{<xsl:value-of select="item-at(color,3)"/>}
{<xsl:value-of select="index-of(color,'green')"/>}
</xsl:template>
to apply the function item-at respectively index-of to the sequence of <color> elements.
|