首页 文章

WSO2 ESB 4.0.3和XSLT 2.0支持

提问于
浏览
1

根据以下URL,我启用了XSLT 2.0支持,当我这样做时,TryIt服务看起来不起作用 .

Achala Blog Entry

我尝试使用TryIt服务时出现以下错误 .

[2012-09-10 11:47:03,491]  INFO - CarbonAuthenticationUtil 'admin' logged in at [2012-09-10 11:47:03,0491] from IP address 0:0:0:0:0:0:0:1%0
Warning: at xsl:stylesheet on line 32 of :
  Running an XSLT 1.0 stylesheet with an XSLT 2.0 processor
Warning: on line 286 of :
  The attribute axis starting at a namespace() node will never select anything
Error on line 1603 of :
  XPTY0004: Required item type of second operand of '|' is node(); supplied value has item
  type xs:string
[2012-09-10 11:47:09,515] ERROR - Util Required item type of second operand of '|' is node(); supplied value has item type xs:string
; SystemID: ; Line#: 1603; Column#: -1
net.sf.saxon.trans.DynamicError: Required item type of second operand of '|' is node(); supplied value has item type xs:string

有没有解决方法,以便我们可以使用XSLT 2.0和TryIt与WSO2 ESB 4.0.3 .

希望得到答案 . 谢谢Abhijit

2 回答

  • 0

    您需要更新标准的XSLT处理器,以便能够处理XSLT 2.0,如博客_1343342中所述:

    • 在ESB_HOME / lib / endorsed /中删除xalan-2.7.0.wso2v1.jar

    • 从ESB_HOME / repository / components / plugins中删除saxon-8.9.0.wso2v1.jar

    • 将saxon9he.jar复制到lib / endorsed并启动服务器 .

    SAXON 9 you can download here

    请注意,您将获取SOAP信封和正文也作为XSLT的输入,因此您可能需要为这些元素使用xsl:template:

    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0">
    <xsl:output method="xml" encoding="utf-8" indent="yes"/>
    
    <xsl:template match="/soapenv:Envelope|soapenv:Body">
      <xsl:copy>
        <xsl:apply-templates/>
      </xsl:copy>
    </xsl:template>
    
    ...
    
  • 0

    最新的WSO2 ESB(v4.5.0)通过Saxson支持XSLT 2.0 [1] .

    [1] http://mail.wso2.org/mailarchive/announce/2012-September/000026.html

    此致,/ Nuwan

相关问题