2 Replies Latest reply on Sep 24, 2009 4:22 PM by scuba_diver_steve

    XML attributes

    scuba_diver_steve

      So, this may be a stupid question, but how do I get the attributes out of an XML node?

       

      XML:

      <GetRootInfoResult DistID="1" CurrentVolume="0" BusCtrID="0" RankID="6" PV="0" CompanyName="Company" FirstName="John" LastName="Doe" PaidAsRank="12" EnrolledInAutoShip="false" Address1="123 Sesame St." Address2="" Address3="" City="El Toro" StateLabel="CA" PostalCode="92564" Country="United States" HomePhone="9495551212" layout="standard" picture="" xmlns="blahblah" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>

       

      I have tried to get the DistID with the following code:

           1. event.result.@DistID

           2. event.result[0].*[0].@DistID

           3. event.hasOwnProperty('@DistID')

           4. '@DistID' in event.result.attribute('DistID').length

       

      The only responses I get from Flex Builder 3 is 'Expression could not be fully resolved' or 'Syntax error in expression'.

       

      HELP??!!?

       

      I can not figure out how to get the attribute.