【发布时间】:2019-05-23 13:06:55
【问题描述】:
我试图从更大的集合中选择某个 XML,使用过滤器仅获取具有正确属性的 XML。
如果没有过滤器,我会收到当前集合中的所有最后一项,但无法为过滤器提供正确的语法...
我的 XML 数据:
<customer>
<profile>
<custom-attributes>
<custom-attribute attribute-id="customerCredit">0.0</custom-attribute>
<custom-attribute attribute-id="customerIDS">12345</custom-attribute>
<custom-attribute attribute-id="sscid">00001</custom-attribute>
</custom-attributes>
/<profile>
</customer>
我的数据编织过滤器:
payload.ns0#customers.*ns0#customer map ( customer , indexOfCustomer ) -> {
(customer.ns0#profile.*ns0#"custom-attributes" filter ($.ns0#"custom-attribute".@"attribute-id" == "customerIDS") map {
"keys" : $
}
)
我想收到上面示例的“keys: 12345”,但由于过滤器的原因,它被简单地跳过了。
【问题讨论】: