Xalan Name Space问题

时间:2013-06-28 20:00:18

标签: xml xslt namespaces xslt-1.0 xalan

我无法在此XSL中获取命名空间来解决。我正在使用XMLSpy,以及Xalan的外部转换引擎。无论我如何处理这个,我都会得到一个“找不到功能”或“找不到xml-stylesheet pi ......”

我需要调整什么来允许通过命名空间使用自定义java类?

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
        xmlns:Utils="xalan://com.util.Utils" extension-element-prefixes="Utils" 
        xmlns:java="java" xmlns:xalan="http://xml.apache.org/xalan" exclude-result-prefixes="xalan">

     <xsl:template match="/ORDER">
            <xsl:variable name="strDivId">
                 <xsl:value-of select="Utils.getDivisionId($strSiteId,$strDivName,$strCompanyNo,$strDivNo,$strFranchNo)"/>
            </xsl:variable>
     <!-- Other Stuff Occurs -->
     </xsl:template>

1 个答案:

答案 0 :(得分:0)

<xsl:value-of select="Utils.getDivisionId(...)"/>

扩展函数由XML样式的QNames引用 - Utils是名称空间前缀,因此点应该是冒号。

<xsl:value-of select="Utils:getDivisionId(...)"/>