We use Altova Stylevision which produces XSLT 2.0 files. We use Saxon 9 for Java to execute these XSLT files. This has been working well for a few years, alas none of us actually understand XSLT.
Now we have the error:
Error at /xsl:stylesheet/xsl:function[9]
XPDY0002: Axis step child::element(item, xs:anyType) cannot be used here:
the context item is undefined
The 9th function is:
<xsl:function name="sps:GoogleChartDataSourceUnitCount" as="xs:string">
<xsl:sequence select="concat(string-join(item/string(if ( number($XML/report/calculation-data[@data-source-name = $DataSourceParent]/item/variable[@name='unit_count']/@value) < 0 ) then 0 else round-half-to-even(number(variable[@name='unit_count']/@value),2)),','),'&chxl=0:|',string-join(item/variable[@name='month']/@value,'|'),'|2:||Min&chds=0,',string(round-half-to-even( max(item/(number(variable[@name='unit_count']/@value)))+1 , 0 )),'&chxr=1,0,',string(round-half-to-even( max(item/(number(variable[@name='unit_count']/@value)))+1 , 0 )))"/>
</xsl:function>
Does anyone have any idea what's going on?