c# - Document.SelectNodes returning zero nodes. Is there anything wrong in my xml? -


i have following xml. but, when loading , selecting node getting 0 nodes. there wrong xml?

code load xml :

    xmldocument doc = new xmldocument();     doc.loadxml(strofferlisting);  xmlnamespacemanager mgr = new xmlnamespacemanager(doc.nametable);                         mgr.addnamespace("ns", "http://mws.amazonservices.com/schema/products/2011-10-01/default.xsd");                         mgr.addnamespace("root", "http://mws.amazonservices.com/schema/products/2011-10-01");     var nodes = doc.selectnodes("//getmatchingproductresponse");  

this xml file :

<?xml version="1.0" encoding="utf-8"?>     <getmatchingproductresponse xmlns="http://mws.amazonservices.com/schema/products/2011-10-01"><getmatchingproductresult asin="0470265957" status="success"><product><identifiers><marketplaceasin><marketplaceid>xxxxxxxxxx</marketplaceid><asin>0470265957</asin></marketplaceasin></identifiers><attributesets><ns2:itemattributes xml:lang="en-us" xmlns:ns2="http://mws.amazonservices.com/schema/products/2011-10-01/default.xsd"><ns2:author>milton h. erickson</ns2:author><ns2:author>ernest l. rossi</ns2:author><ns2:binding>hardcover</ns2:binding><ns2:edition>1st</ns2:edition><ns2:iseligiblefortradein>true</ns2:iseligiblefortradein><ns2:label>irvington publishers</ns2:label><ns2:languages><ns2:language><ns2:name>english</ns2:name><ns2:type>published</ns2:type></ns2:language><ns2:language><ns2:name>english</ns2:name><ns2:type>original language</ns2:type></ns2:language><ns2:language><ns2:name>english</ns2:name><ns2:type>unknown</ns2:type></ns2:language></ns2:languages><ns2:listprice><ns2:amount>211.86</ns2:amount><ns2:currencycode>usd</ns2:currencycode></ns2:listprice><ns2:manufacturer>irvington publishers</ns2:manufacturer><ns2:numberofitems>1</ns2:numberofitems><ns2:numberofpages>512</ns2:numberofpages><ns2:packagedimensions><ns2:height units="inches">1.70</ns2:height><ns2:length units="inches">9.40</ns2:length><ns2:width units="inches">6.30</ns2:width><ns2:weight units="pounds">1.85</ns2:weight></ns2:packagedimensions><ns2:productgroup>book</ns2:productgroup><ns2:producttypename>abis_book</ns2:producttypename><ns2:publicationdate>1979-10-01</ns2:publicationdate><ns2:publisher>irvington publishers</ns2:publisher><ns2:smallimage><ns2:url>http://ecx.images-amazon.com/images/i/51geup2r-dl._sl75_.jpg</ns2:url><ns2:height units="pixels">75</ns2:height><ns2:width units="pixels">56</ns2:width></ns2:smallimage><ns2:studio>irvington publishers</ns2:studio><ns2:title>hypnotherapy: exploratory casebook</ns2:title></ns2:itemattributes></attributesets><relationships /><salesrankings><salesrank><productcategoryid>book_display_on_website</productcategoryid><rank>562887</rank></salesrank><salesrank><productcategoryid>3558816011</productcategoryid><rank>63</rank></salesrank><salesrank><productcategoryid>173514</productcategoryid><rank>38091</rank></salesrank></salesrankings></product></getmatchingproductresult></getmatchingproductresponse> 


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -