4 Replies Latest reply on Aug 10, 2008 8:29 PM by whertzing

    How to access collections and attributes on e4X nodes and child nodes?

    whertzing
      I have a mxWebService that returns results as “e4x”, and I can’t figure out how to access the node collections and attributes values.

      The debugger shows the results returned by the web service like this:

      pws.Usp_Incidents.lastResult = XMLList (@5644131)
      [0] = XML
      <Usp_IncidentsResponse xmlns="urn://h.com" 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">
      <Usp_IncidentsResult xmlns="urn://h.com" 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">
      <list 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">
      <incident unique_id="54" inc_priority="3" exec_description="Blocking on SQL servers which resulted in failures " start_time2="2007-01-06T00:25:00" end_time2="2007-01-06T01:00:00" 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"/>

      What do I need to do, to access the lastResult something like this?

      Var one_incident_id:string=lastResult.incident[0].unique_id;

      If I can get some help to figure this out from somebody who understands the e4X syntax, I can probably solve all my related questions (like, how to bind the list to a data grid, and display the exec_description in one column, the start_time2 in another column)

      Note that I do have a custom namespace, xlmns=”urn://h.com” defined on the <Usp_IncidentsResponse> and on the <Usp_IncidentsResult >, but not on the nodes below that.