1 Reply Latest reply on Jul 25, 2007 9:01 AM by Greg Dove

    XML nodeName / Value problem

    BarryGee
      Hi.

      I am trying to display the nodeValue of the "link" nodes in each section. The problem i am having is that I can either get flash to output the nodeName for the first set of link nodes and repeat this for each subsection, each time outputting the first set of link nodeNames but under each of the interactive/print/threeD parent nodes, or if i change nodeName to nodeValue i get an output of null.

      Any help or code hacks to fix this problems are very welcome.

      Thanks

      Barry.
        • 1. Re: XML nodeName / Value problem
          Greg Dove Level 4
          quote:

          if i change nodeName to nodeValue i get an output of null.


          I didn't look through your code... but just that phrase might be enough for me to point you in the right direction.

          nodeValue applies only to text nodes. And text nodes don't have a name.

          So where you were trying to do that, do this instead:

          oldAttempt.nodeName (gives a valid name)

          oldAttempt.firstChild.nodeValue (should give you the text)

          so - simply put - just replace your successful trace of nodeName for the node tag that 'contains' the text you are looking for with firstChild.nodeValue

          (It took me ages to get comfortable with xml and all that firstChild.nextSibling stuff. )