I am stuck with a logic related to preceding sibling,
Trying to keep XML simple .
<order>
<orderList>
<itemid><id>100</id></itemid>
<itemid><id>100</id></itemid>
<itemid><id>111</id></itemid>
<itemid><id>111</id></itemid>
<itemid><id>123</id></itemid>
<itemid><id>324</id></itemid>
<itemid><id>244</id></itemid>
<itemid><id>244</id></itemid>
</orderList>
</order>
I am trying to find the preceding sibling for each node using below xsl. i need to use for each loop to fit this logic in a larger xsl...
<html>
<body>
<table border="1">
<xsl:for-each select="order/orderList/itemid">
<tr>
<td>itemid</td>
<td><xsl:value-of select="id" /> </td>
<td> <xsl:value-of select="preceding-sibling::node()"/> </td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
I get these Results
itemid 100
itemid 100 100
itemid 111 100
itemid 111 100 - expecting 111
itemid 123 100 - expecting 111 etc
itemid 324 100
itemid 244 100
itemid 244 100
any help please ?