I run into a strange problem with preceding-sibling in xslt. The issue occurs when I pass in parameters to an xsl style sheet and try to use it with the preceding-sibling expression.
which steps back 2 and retrieves the VAL node at that line. This works fine however I now want to pass in the value to step back as a parameter to the xsl style sheet. So the xsl fragment changes to the following with the $index value passed when the script is called.
(with 2 instead of $2)? If so then I think perhaps the difference is that your parameter is a string, not a number, so your parameterized XPath behaves the same as this one would:
If that's the case then there's a function named something like "number" which converts a string to a number.