1 Reply Latest reply on Feb 23, 2010 9:08 AM by kglad

    XML elements problem

    tripleA999

      I am unable to access 2nd element and 3rd element (I can acces 1st element


      xml :

      <data>

            <text1> text1 </text1> 

           <text2> text2 </text2>

          <text3> text3 </text3> 

      </data>


      as 2.0 :

      var text_xml = new XML();

      text_xml.ignoreWhite=true;

      text_xml.onLoad = function(loaded){

      if (loaded){

       

      myTxt1.textl = String(text_xml.firstChild.firstChild.childNodes[0].nodeValue);

                    myTxt1.textl = String(text_xml.firstChild.firstChild.childNodes[1].nodeValue);

                 myTxt1.textl = String(text_xml.firstChild.firstChild.childNodes[2].nodeValue);

       

      }

      }

      text_xml.load("text.xml");                 

        • 1. Re: XML elements problem
          kglad Adobe Community Professional & MVP

          use:

           


          var text_xml = new XML();

          text_xml.ignoreWhite=true;

          text_xml.onLoad = function(loaded){

          if (loaded){

           

          myTxt1.textl = String(text_xml.firstChild.childNodes[0].firstChild.nodeValue);

                        myTxt1.textl = String(text_xml.firstChild.childNodes[1].firstChild.nodeValue);

                     myTxt1.textl = String(text_xml.firstChild.childNodes[2].firstChild.nodeValue);

           

          }

          }

          text_xml.load("text.xml");