Here's simple example on how to set the text value of node in AS3
Not sure if that what you're looking for as far as with the reference to 
the node:

var doc=
<book>
    <toc/>
    <toc/>
    <page>Abc</page>
    <page>123</page>
    <page>XYZ</page>
    <page>Last page</page>   
    <index />
    <index />
</book>;

var targetNode:XML=doc.page[2];
//Reference afterwards:
trace("--------targetNode Before-------------");
trace(targetNode.toXMLString());


//Replacing the Text of the node:
targetNode.setChildren("Replacement page content");


//Reference afterwards:
trace("--------targetNode AFTER-------------");
trace(targetNode.toXMLString());


//The whole XML afterwards:
trace("--------targetNode AFTER-------------");
trace(doc.toXMLString());


-- Keith H --
www.keith-hair.net






Mark Carter wrote:
>
> Hi - So, I know how to append a text node to an (parent) element, and 
> how to
> replace a text node with a new text node (based on a specified 
> string), but
> how do I set text on a text node?
>
> In my situation it is very important that the reference to the text node
> object is the same before and after this operation, so simply 
> replacing the
> text node is not an option for me.
> -- 
> View this message in context: 
> http://www.nabble.com/Setting-text-on-a-text-node-in-e4x-tp20152621p20152621.html
>  
> <http://www.nabble.com/Setting-text-on-a-text-node-in-e4x-tp20152621p20152621.html>
> Sent from the FlexCoders mailing list archive at Nabble.com.
>
>  


Reply via email to