|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Select nodes with equal position
Hallo everyone,
depending on the postion() of a certain node I would like to select
another node with the same position.
It works if I invent a variable.
But I wonder if there is a way to do it without the use of a variable?
XML:
<table>
<colspec colname="c1"/>
<colspec colname="c2"/>
<colspec colname="c3"/>
<row>
<entry colname="c1">r1_1</entry>
<entry colname="c2">r1_2</entry>
<entry colname="c3">r1_2</entry>
</row>
</table>
XSL:
<xsl:template match="entry">
<xsl:variable name="mypos">
<xsl:value-of select="position()"/>
</xsl:variable>
<xsl:value-of select="../../colspec[position() = $mypos]/@colname"/>
</xsl:template>
Best regards and thanks for your comments,
Norbert Heidbrink
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








