在XPATH函数上过滤介体

时间:2013-11-12 10:19:53

标签: xpath filter wso2esb

我的代码使用Filter mediator和XPATH函数时遇到问题。我在我的代码中尝试做的是检查特定块是否为空,不调用/丰富该块并移动到另一个块检查它是否为空,如果不处理它并移动到下一个并且在结束做提交。目前我收到错误:

FilterMediator错误评估XPath表达式:fn:exists($ body / product / simpleProduct / standardAttributes)

My code is as follows:
<inSequence>
         <log level="custom">
            <property name="STATUS" value="************ REQUEST ***************"/>
         </log>
         <transaction action="new"/>
         <filter xpath="fn:exists($body/product/simpleProduct/standardAttributes)">
          </filter>           
         <enrich>
            <source type="body" clone="true"/>
            <target type="property" property="MSG_PAYLOAD"/>
         </enrich>
         <log level="full"/>
         <xslt key="simpleAttributes"/>
         <log level="custom">
            <property name="STATUS"
                      value="*********INSERTING Simple Product Attributes *************"/>
         </log>

</inSequence>

在fn:exists()失败。如果我出错了,你能帮我提一下吗?

1 个答案:

答案 0 :(得分:2)

显然你使用的功能是xpath 2功能。 OOTB xpath 2函数在ESB中不起作用。如果这是xpath2,则必须启用它。要启用xpath 2,请在synapse.properties文件中取消注释synapse.xpath.dom.failover.enabled = true。

相关问题