1 Reply Latest reply on Feb 11, 2008 5:20 PM by BeniRose

    Updating NodeValue

    BeniRose Level 1
      I know that if I want to add a value to a closed xml tag (e.g. turn <foo /> into <foo>bar</foo> I need to create a node and append it like this:

      var temp:XMLNode = test.createTextNode("Hey dood");
      test.firstChild.firstChild.appendChild(temp);

      However, what if I already have text in there and want to change it (e.g. turn <foo>bar</foo> into <foo>dun</foo>)
      I tried just doing test.firstChild.firstChild.nodeValue = "dun"; but then when I trace the XML object, it still has the old value in there (even though when I trace test.firstChild.firstChild.nodeValue, it's changed).

      What's up with this?