cancel
Showing results for 
Search instead for 
Did you mean: 
Security Alert Log4j Security Vulnerability. Click here to know more.
cancel
Showing results for 
Search instead for 
Did you mean: 

trouble parsing XML

davidcor
1-Newbie

trouble parsing XML

I am able to retrieve the following XML from a web service and assign it to a variable, returnXML. However, I can't figure out how to retrieve the data elements within it. I've tried returnXML.customerProfileID, returnXML.messages.resultCode, etc but they values come back empty.

<createCustomerProfileResponse
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <messages>
        <resultCode>Ok</resultCode>
        <message>
            <code>I00001</code>
            <text>Successful.</text>
        </message>
    </messages>
    <customerProfileId>29734345</customerProfileId>
    <customerPaymentProfileIdList/>
    <customerShippingAddressIdList/>
    <validationDirectResponseList/>
</createCustomerProfileResponse>

4 REPLIES 4
paic
1-Newbie
(To:davidcor)

&lt;Namespace 1 : http://url here &gt;XMLDoc.::element1.::subelement2

Thanks.  I'll give that a try.  Can you give me an example of doing it the 'long' way?



paic
1-Newbie
(To:davidcor)

Take a look under Support/Examples parsing Soap/XML with Name spaces.

So instead of using .*::ElementName
you would declare the name space and then use .NameSpaceVariable::ElementName

Thanks for the quick response Pai.  That did the trick.



Announcements