You can add/edit/read attributes with the ”@” operator.
var myXML:XML = <xml> <some> <node/> </some> </xml>;
myXML.some.node.@beginIndex = "1";
trace( myXML.some.node.@beginIndex ); // output: 1;
Question
if (child is WinCRLFTextArea) { var node:XML;
node = <{child.name}>{WinCRLFTextArea(child).text}</{child.name}>;
textXML.appendChild(node);
}
I want to add an attribute like "beginIndex" and "endIndex" to node element. dynamically i need to assign values to this attributes. ex: beginIndex = WinCRLFTextArea(child).text.length is it possible ? please anyone help me out for this.
Thanks in advance.
Solution
You can add/edit/read attributes with the ”@” operator.
var myXML:XML = <xml> <some> <node/> </some> </xml>;
myXML.some.node.@beginIndex = "1";
trace( myXML.some.node.@beginIndex ); // output: 1;