e4x 多个类别标签之间的 XML 过滤
我使用 FLEX 和 e4x 来解析 XML。 XML 如下所示:
我能够根据标签值进行基本过滤。
但现在我需要过滤可以有多个类别
的项目。我尝试了以下操作:
<item>
<id>12345</id>
<category>housing</category>
<category>finances</category>
<category>recreation</category>
</item>
xml..item(category=='housing');
这只返回那些仅具有“住房”类别的项目的结果。
如果该商品有其他类别,则不会被识别为有效商品。
我该怎么做?
亲切的问候, 巴特
I'm using FLEX and e4x to parse through XML. And the XML looks as follows:
I am able to do basic filtering based on tag value.
But now I need to filter over items that can have multiple categories
. I tried the following:
<item>
<id>12345</id>
<category>housing</category>
<category>finances</category>
<category>recreation</category>
</item>
xml..item(category=='housing');
This only returns a result on those items that have ONLY 'housing' as a category.
If the item has other categories, it will not be recognized as a valid item.
How do I do this?
kind regards,
bart
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,我找到了。
使用
.contains()
,如下所示:xml.(category.contains('housing'));
OK, I found it.
Use
.contains()
as follows:xml.( category.contains('housing') );