Closed. This question needs details or clarity。它当前不接受答案。
想改善这个问题吗?添加详细信息并通过editing this post阐明问题。
6年前关闭。
Improve this question
我想在特定条件下在xslt 2.0中调用错误函数,但是我不知道执行此操作的语法。
请举例说明。
请在XSLT中检查以下代码:
想改善这个问题吗?添加详细信息并通过editing this post阐明问题。
6年前关闭。
Improve this question
我想在特定条件下在xslt 2.0中调用错误函数,但是我不知道执行此操作的语法。
请举例说明。
请在XSLT中检查以下代码:
<xsl:if test="string-length(normalize-space($vehicle/VIN)) != 17"> error(QName('Invalid VIN')) </xsl:if>
最佳答案
使用例如<xsl:sequence select="if (string-length(normalize-space($vehicle/VIN)) != 17) then error(QName('http://example.com/', 'some-error-code'), 'Invalid VIN') else ()"/>
。