cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

trouble parsing XML

davidcor
1-Visitor

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
12-Amethyst
(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
12-Amethyst
(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


Top Tags