1 Reply Latest reply on Sep 13, 2010 11:31 PM by Balakrishnan V

    How to read forward slash from xml file

    flexchief Level 1

      Hi,

       

      I am reading in values from a complex xml file but am unable to read values that contain a forward slash ('/').

       

      For example: <key>Year</key><integer>2004</integer> can not be read because of these slashes?

       

      Can anyone please tell me how to read these values as strings?

       

      Thanks

       

      Adam

      Flexchief

        • 1. Re: How to read forward slash from xml file
          Balakrishnan V Level 3

          XML::toString() and XML::toXMLString() methods return a string.

           

          String::indexOf()

          String::lastIndexOf()

          String::search()

           

          These methods can be applied on strings to find location of '/'

           

           

          However your problem seems to be that of accessing the values "Year" and "2004".

           

          To do this, you can use e4x to access fields.

           

          var xml:XML= <XML><key>Year</key><integer>2004</integer></XML>

           

          use xml.key and xml.integer to access the fields

           

          Hope this helps

           

          balakrishnan v