【发布时间】:2014-09-16 23:41:37
【问题描述】:
我在 xpath 中遇到问题-我需要检查两个属性值,如果条件满足需要对我自己的值进行硬编码。下面是我的xml。
我需要检查 subroot 内部的条件,如果 ItemType=Table1 和 ItemCondition=Chair1,那么我必须提供一个硬编码值“Proceed”(这个硬编码值我将映射到 datamapper 的目标端)。
<Root>
<SubRoot>
<ItemType>Table1</ItemType>
<ItemCondition>Chair1</ItemCondition>
<ItemValue>
.......
</ItemValue>
</SubRoot>
<SubRoot>
<ItemType>Table2</ItemType>
<ItemCondition>chair2</ItemCondition>
<ItemValue>
.......
</ItemValue>
</SubRoot>
....Will have multiple subroot
</Root>
我试图定义如下规则,但它抛出错误
Type: String
Context:/Root
Xpath: substring("Proceed", 1 div boolean(/SubRoot[ItemType="Table1" and ItemCondition="Chair1"]))
但它会抛出类似的错误
net.sf.saxon.trans.XPathException: Arithmetic operator is not defined for arguments of types (xs:integer, xs:boolean)
有没有其他快捷方式来执行此操作。请你帮帮我,我已经付出了更多的努力。无法解决它。提前致谢。
【问题讨论】:
标签: mule mule-studio mule-component