只是试图创建和使用显示该节点的内容(如果有的话)或一个破折号如果为空的XSL函数。错误声明和使用函数xsl
下面是该文件的某些部分:
<xsl:stylesheet version="2.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:qes="http://www.qwamci.com">
<xsl:function name="qes:textOrDash" as="xs:string">
<xsl:param name="mynode" />
<xsl:sequence select="if (fn:compare(translate($mynode, ' ', ''), '')=0) then '-' else $mynode" />
</xsl:function>
<xsl:template match="Response">
<xsl:value-of select="qes:textOrDash(./SOME/OTHER/XPATH/TO/NODE)" />
</xsl:template>
</xsl:stylesheet>
错误:
Erreur:java.lang.NoSuchMethodException: For extension function, could not find method org.apache.xml.utils.NodeVector.textOrDash([ExpressionContext,]).
一些想法?
问得好,+1。查看我的答案,找出问题的最可能原因。 :) –