Subject:Comparing two nodes Author:R R Date:23 Jun 2006 11:30 AM
Hello,
I am trying to comparing two nodes to get the position() in the main node list.
The code is as
<xsl:template name="Node-Num">
<xsl:param name="node-list"/>
<xsl:for-each select="books/book-item">
<xsl:if test=".= $node-list[1]" >
<xsl:value-of select="position()"/>
</xsl:if>
</xsl:for-each>
</xsl:template>
Basically the node values are compared.
But there is problem that if two or more nodes have the same value (like two nodes <book-item>some</book-item> and <book-item>some</book-item>)then it returns two or more values as the node values some and some are same.
Can any body advice me if I can use any other id in this case?
Subject:Comparing two nodes Author:Ivan Pedruzzi Date:23 Jun 2006 04:32 PM
Rather then by tentative, you should provide a full example (XML + XSLT) explain what you expect as output and describe which XSLT processor you have to use.