I am trying to assign the position of an element like this:
<xsl:variable name="offset" select="ancestor::myparent/position() * 8"/>
I am trying to show the result of the calculation in the output, so using a selector is not enough. xsltproc generates the following error:
XPath error : Invalid expression
ancestor::myparent/position() * 8
^
compilation error: file foo.xsl line 10 element variable
XSLT-variable: Failed to compile the XPath expression 'ancestor::myparent/position() * 8'.
Is there a way to do this?