开发者

Flex - How to change xml attribute name?

开发者 https://www.devze.com 2023-01-21 09:09 出处:网络
For example I want to change &l开发者_Python百科t;item id=\"1\"/> to <item code=\"1\"/> thanks.You can use setName to change the attribute name:

For example I want to change

&l开发者_Python百科t;item id="1"/>

to

<item code="1"/>

thanks.


You can use setName to change the attribute name:

Here for example change all your id attributes with code:

var xmlTest:XML=<r><item id="1"/></r>;

for each (var node:XML in xmlTest.item.descendants("@id"))
 node.setName("code");

trace(xmlTest); 
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号