xsl-list
[Top] [All Lists]

RE: find position of first occurrence in a node set

2005-07-29 15:00:44

Anyway, you can use the xsl:number instruction to get what you want:

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="2.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

  <xsl:template match="/">
    <xsl:number select="transaction_set/segment[(_at_)type='HL']"/>
  </xsl:template>

</xsl:stylesheet>


Note that the select attribute of xsl:number is new in XSLT 2.0. In 1.0 you
need

<xsl:for-each select="transaction_set/segment[(_at_)type='HL']">
  <xsl:number/>
</xsl:for-each>

Michael Kay
http://www.saxonica.com/



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>