Hi
I am trying to integrate Yahoo! shipping in one of my projects and facing the following error:
1. I am using the GET method to find data from Yahoo in XML format. A typical response is as given below:
<?xml version="1.0" encoding="ISO-8859-1"?>
<ResultSet xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance" xmlns="urn:yaho o:prods" xsi:schemaLocat ion="urn:yahoo: prods http://api.shopping.ya hoo.com/shoppingservice/v1/productsearch.x sd" totalResultsAva ilable="5263" firstResultPosi tion="1" totalResultsRet urned="10">
<Result>
<Catalog ID="3004510600" >
<Url><![CDATA[http://shopping.yahoo. com/p:Harry%20Potte r%20Collection% 3A:3004510600]]></Url>
<ProductName> <![CDATA[Harry Potter Collection:]]></ProductName>
<PriceFrom>100. 13</PriceFrom>
<PriceTo>127.15 </PriceTo>
<Thumbnail>
<Url><![CDATA[http://f3c.yahoofs.com/shopping/3061944/simg_t_t0439827 604gif85?rm____ _DFuy3NLrf]]></Url>
<Height>81</Height>
<Width>85</Width>
</Thumbnail>
<UserRating>
<MaxRating>5</MaxRating>
<NumRatings>4 </NumRatings>
<AverageRating> 4.5</AverageRating>
<RatingUrl><![CDATA[http://shopping.yahoo. com/p:Harry%20Potte r%20Collection% 3A:3004510600:p age=user-reviews]]></RatingUrl>
<CreateRatingUr l><![CDATA[http://shopping.yahoo. com/p:Harry%20Potte r%20Collection% 3A:3004510600:p age=post-reviews]]></CreateRatingUrl >
</UserRating>
</Catalog>
</Result>
</ResultSet>
2. I am trying to read the above using XMLDocument object. Using that, I am able to get a handle to the root object and also able to navigate through the child nodes sequentially.
3. However, I am not able to execute XPath queries on the XML due to the XML having namespace definitons.
4. I tried using NameSpaceManage r but due to my lack of experience with XML namespaces, I am not able to continue further.
Can someone please help me out in this?
Thanks,
Rupinder
I am trying to integrate Yahoo! shipping in one of my projects and facing the following error:
1. I am using the GET method to find data from Yahoo in XML format. A typical response is as given below:
<?xml version="1.0" encoding="ISO-8859-1"?>
<ResultSet xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance" xmlns="urn:yaho o:prods" xsi:schemaLocat ion="urn:yahoo: prods http://api.shopping.ya hoo.com/shoppingservice/v1/productsearch.x sd" totalResultsAva ilable="5263" firstResultPosi tion="1" totalResultsRet urned="10">
<Result>
<Catalog ID="3004510600" >
<Url><![CDATA[http://shopping.yahoo. com/p:Harry%20Potte r%20Collection% 3A:3004510600]]></Url>
<ProductName> <![CDATA[Harry Potter Collection:]]></ProductName>
<PriceFrom>100. 13</PriceFrom>
<PriceTo>127.15 </PriceTo>
<Thumbnail>
<Url><![CDATA[http://f3c.yahoofs.com/shopping/3061944/simg_t_t0439827 604gif85?rm____ _DFuy3NLrf]]></Url>
<Height>81</Height>
<Width>85</Width>
</Thumbnail>
<UserRating>
<MaxRating>5</MaxRating>
<NumRatings>4 </NumRatings>
<AverageRating> 4.5</AverageRating>
<RatingUrl><![CDATA[http://shopping.yahoo. com/p:Harry%20Potte r%20Collection% 3A:3004510600:p age=user-reviews]]></RatingUrl>
<CreateRatingUr l><![CDATA[http://shopping.yahoo. com/p:Harry%20Potte r%20Collection% 3A:3004510600:p age=post-reviews]]></CreateRatingUrl >
</UserRating>
</Catalog>
</Result>
</ResultSet>
2. I am trying to read the above using XMLDocument object. Using that, I am able to get a handle to the root object and also able to navigate through the child nodes sequentially.
3. However, I am not able to execute XPath queries on the XML due to the XML having namespace definitons.
4. I tried using NameSpaceManage r but due to my lack of experience with XML namespaces, I am not able to continue further.
Can someone please help me out in this?
Thanks,
Rupinder
Comment