Xalan 2.7.1语法错误:无法编译样式表

时间:2016-07-08 20:30:35

标签: xslt stylesheet xalan

在我的应用程序中使用预编译的XSLT样式表时,我遇到了一个奇怪的问题。

当不使用预编译选项时,我没有错误。当我使用Xalan启用预编译的样式表(translet)时,我收到一些编译错误。这个是代表性的:

16:21:15,262 ERROR [stderr] (http-/127.0.0.1:8080-177) ERROR:  'Syntax error in 'not(@value = (preceding-sibling::CreateAsnCalloff)[@materialshipped = '0' or @value = 'NON-CALL OFF ASN']/@value)'.'    
16:21:15,262 ERROR [stderr] (http-/127.0.0.1:8080-177) FATAL ERROR:  'Could not compile stylesheet'    
16:21:15,262 INFO  [stdout] (http-/127.0.0.1:8080-177) javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet

导致此问题的XSLT位于:

<xsl:if test="not(@value = (preceding-sibling::CreateAsnCalloff)[@materialshipped = '0' or @value = '*NON-CALL OFF ASN*']/@value)">

    <OPTION value="{@cd}"><xsl:value-of select="@value"/></OPTION>
</xsl:if>

1 个答案:

答案 0 :(得分:0)

请尝试<xsl:if test="not(@value = preceding-sibling::CreateAsnCalloff[@materialshipped = '0' or @value = '*NON-CALL OFF ASN*']/@value)">