Apache flex Flex-如何更改xml属性名称?
例如,我想改变Apache flex Flex-如何更改xml属性名称?,apache-flex,actionscript-3,Apache Flex,Actionscript 3,例如,我想改变 <item id="1"/> 到 谢谢。您可以使用更改属性名称: 例如,这里使用code更改所有id属性: var xmlTest:XML=<r><item id="1"/></r>; for each (var node:XML in xmlTest.item.descendants("@id")) node.setName("code"); trace(xmlTest); var-xmlTest:XML=;
<item id="1"/>
到
谢谢。您可以使用更改属性名称:
例如,这里使用code
更改所有id
属性:
var xmlTest:XML=<r><item id="1"/></r>;
for each (var node:XML in xmlTest.item.descendants("@id"))
node.setName("code");
trace(xmlTest);
var-xmlTest:XML=;
对于每个(变量节点:xmlTest.item.substands(“@id”)中的XML)
node.setName(“代码”);
微量(xmlTest);
var xmlTest:XML=<r><item id="1"/></r>;
for each (var node:XML in xmlTest.item.descendants("@id"))
node.setName("code");
trace(xmlTest);