This is WRONG!
<xsl:if test="not(preceding-sibling::node()/@Value = $PartNo)">
This only tests if the directly preceding sibling (one node) does not have the same part number.
What you want could be:
<xsl:if test="not(preceding-sibling::*[@Value = $PartNo])">
Test if any of the preceding-siblings have the same value..
The first example tests all preceding-sibling nodes (all nodes with the same parent, that precede the context node). The second example only tests preceding-sibling element nodes.
Michael Kay
Michael Kay
http://www.saxonica.com/