Error XalanXPathException when using hours-from-duration xpath function in ibm db2 xslt transformation
Input XML:
<test><TotalDuration>PT1H32M7S</TotalDuration></test>
Input XSLT:
<?xml version="1.0"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http开发者_JAVA百科://www.w3.org/1999/XSL/Transform"
xmlns:fn="http://www.w3.org/2005/xpath-functions">
<xsl:template match="/test">
Hours=<xsl:value-of select="fn:hours-from-duration(TotalDuration)"/> hr
</xsl:template>
</xsl:stylesheet>
Expected Output: Hours=1 hr
Instead Getting: [IBM][DB2/NT64] SQL16280N The XSLT processor returned the following error: "XalanXPathException: The function number 'http://www.w3.org/2005/xpath". SQLSTATE=225X0Expected Output: Hours=1 hr
Instead Getting: [IBM][DB2/NT64] SQL16280N The XSLT processor returned the following error: "XalanXPathException: The function number 'http://www.w3.org/2005/xpath". SQLSTATE=225X0
This is so clear: The XSLT processor you are using (Xalan) doesn't implement XSLT 2.0.
You need to feed XSLT 2.0 code only to a XSLT processor that implements XSLT 2.0.
精彩评论