[英]Basic Flex XML - how to check a node with a specific attribute exists
Really simple problem, but I am tearing my hair out looking for a solution. 确实很简单的问题,但是我正在寻找解决方案的问题。
I have XML that looks like this: 我有看起来像这样的XML:
<Records>
<Application id='1'>
... child elements ...
</Application>
<Application id='2'>
... child elements ...
</Application>
</Records>
I want to check if an Application node exists with a given id. 我想检查是否存在具有给定id的Application节点。 If it doesn't, create it, else just append child elements directly inside it.
如果没有,请创建它,否则只需在其内部直接添加子元素。 This should be trivial, but no combination I have tried works.
这应该是微不足道的,但是我尝试过的组合却没有。
May this link'll be helpful.... 希望此链接会有所帮助。...
this link know about how to create a xml node and with different cases: 该链接知道如何创建xml节点以及不同情况:
http://mysticnomad.wordpress.com/2008/09/25/dynamically-add-element-attribute-to-a-xml-using-e4x/ http://mysticnomad.wordpress.com/2008/09/25/dynamically-add-element-attribute-to-a-xml-using-e4x/
Hope your problem will be solved by this...... 希望你的问题能被解决……
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.