Parsing Amzon API *.xml response with .NET



I'm trying to parse the xml-response from the amazon api.


This is a part of the received xml-file:



<BrowseNodeLookupResponse xmlns="http://ift.tt/JgRJni">
<OperationRequest>
<RequestId>31317fca-ad3d-4ff0-a64f-693c0e44959b</RequestId>
<Arguments>
<Argument Name="Operation" Value="BrowseNodeLookup" />
<Argument Name="Service" Value="AWSECommerceService" />
<Argument Name="Version" Value="2011-08-01" />
<Argument Name="BrowseNodeId" Value="186606" />
<Argument Name="Timestamp" Value="2015-01-04T11:50:06Z" />
<Argument Name="ResponseGroup" Value="BrowseNodeInfo" />
</Arguments>
<RequestProcessingTime>0.002221</RequestProcessingTime>
</OperationRequest>
<BrowseNodes>


I want to read the Argument Timestamp. This is my code, but it only work if I remove the xmlns attribute in the xml-file.



Dim nodeTimestamp As XmlNode = doc.SelectSingleNode("/BrowseNodeLookupResponse/OperationRequest/Arguments/Argument[@Name='Timestamp']")

Dim text As String = nodeTimestamp.Attributes.ItemOf("Value").InnerText

No comments:

Post a Comment