Does anyone here speak jive? (MSXML2.XMLHTTP60 jive)

peskywinnets

Registered User.
Local time
Today, 23:58
Joined
Feb 4, 2014
Messages
578
If I enter a particular URL into firefox, the returned XML begins like this....

Code:
<GetCompetitivePricingForASINResponse>
<GetCompetitivePricingForASINResult ASIN="B002L7HJAA" status="Success">
<Product>
<Identifiers>
<MarketplaceId>A1F83G8C2ARO7P</MarketplaceId>
etc, etc

which is nicely formed XML.

However if the same URL is submitted via VBA using this code...

Code:
Set XMLHttpRequest = New MSXML2.XMLHTTP60

XMLHttpRequest.Open "GET", SignedURL, False

the XML returned has a lot more info in it that's causing my XML parsing code to projectile vomit....

Code:
<?xml version="1.0"?>
<GetCompetitivePricingForASINResponse xmlns="http://mws.amazonservices.com/schema/Products/2011-10-01">
<GetCompetitivePricingForASINResult ASIN="B002L7HJAA" status="Success">
<Product xmlns="http://mws.amazonservices.com/schema/Products/2011-10-01" xmlns:ns2="http://mws.amazonservices.com/schema/Products/2011-10-01/default.xsd">
<Identifiers>
<MarketplaceId>A1F83G8C2ARO7P</MarketplaceId>
etc etc

I'd much rather the XML came back as per firefox's returned XML.

Does anyone know how I can get to that goal?
 
This might be one of those cases where showing all the related code, or a copy of the database would help.

I don't do much with vba and xml, but this link may give you some insight to an approach.
And this one.

good luck.
 
If you are parsing xml, consider looking into xslt stylesheets. Here's a link http://www.w3schools.com/xsl/default.asp

In short, you can write a secondary xml (xslt) file that acts as a lens/filter on the original file, and only returns the elements you want to see, in the structure/format you want to see them. So you could transform an xml file to return html, for instance (which is actually, afaik, what your browser is doing when it shows you that pretty xml).

Hope this helps,
 

Users who are viewing this thread

Back
Top Bottom