Chúng tôi sử dụng Altova Stylevision để tạo các tệp XSLT 2.0. Chúng tôi sử dụng Saxon 9 cho Java để thực thi các tệp XSLT này. Điều này đã hoạt động tốt trong vài năm, không ai trong chúng ta thực sự hiểu XSLT.XSLT 2.0 tạo ra lỗi: "mục ngữ cảnh không xác định"
Bây giờ chúng ta có lỗi:
Error at /xsl:stylesheet/xsl:function[9]
XPDY0002: Axis step child::element(item, xs:anyType) cannot be used here:
the context item is undefined
Chức năng thứ 9 là:
<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>
Có ai có bất kỳ ý tưởng gì đang xảy ra?