The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

Not able to parse XML reply with XPath query

Highlighted
New Member

Not able to parse XML reply with XPath query

When I issue the following XPath query child::* I get all the info that comes back from my https GET as an undifferentiated string.  When I try to use a XPath query to get a specific piece of information, say for instance, the Status item, the node is not found.


I've tried XPath queries like child::feed or child::content but I get null as a result for them as well.


Just to be sure it's not my VB.NET code that's at fault, I've gone to this website http://www.xmlme.com/XpathTool.aspx?mid=82 and issued the XPath queries there with the same result. 


Any insights into why XPath queries don't seem to work for me against the xml you return in response to my HTTPS  GET? I'm just checking an email address against our list to see its current status and/or whether it already exists in our list or not so it's a pretty simple request and the result is received back just fine. 


 


 


 


 

3 REPLIES 3
Highlighted
Employee

Re: Not able to parse XML reply with XPath query

I am taking a look at this now. If you could paste us some specific XML that is problematic, just to that I'm sure that were looking at the same thing, that would be helpful as well. I will take a look at this and let you know what I come up with. In the meantime, if you have any questions please let us know. Thanks.

David J

Highlighted
Employee

Re: Not able to parse XML reply with XPath Query

Since our XML implements namespaces, it doesn't look like that website would effectively work for testing XPath queries. With that being said, we do have a number of .NET samples available at http://developer.constantcontact.com/samples/upload_forms that use xpath queries to get values from specific XML nodes. This is accomplished by use of the XMLNamespaceManager class. We are then able to add the namespaces we use to that namespace manager and perform XPath queries. I would certainly recommend downloading our sample packs and taking a look at how this is done there.


 


I hope this helps. Please let me know if you have any questions or concerns and I will be happy to help. Thanks.

David J

Highlighted
New Member

Thanks

I will look at the samples and see what I can make of them.


 


Thanks,

Developer Portal

View API documentation, code samples, get your API key.

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured