只是試圖創建和使用顯示該節點的內容(如果有的話)或一個破折號如果爲空的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。查看我的答案,找出問題的最可能原因。 :) –