I have such XML structure which was returned by SharePoint web services.
<rs:data ItemCount="4" xmlns:rs="urn:company:rowset">
<z:row ows_AssetId="HP010336520" />
<z:row ows_AssetId="HP010336519" />
<z:row ows_AssetId="HP010354403" />
<z:row ows_AssetId="HP010357062" />
</rs:data>
private static void Parser(List<XmlNode> data)
{
List<XmlNodeList> rows = (from row in data.AsEnumerable()
select row.SelectNodes("data/row")).ToList();
}
I was trying to query for a row, but no luck. Could you guys please help me?
You need to use an XmlNamespaceManager when querying the node list. Not seen in your code is the declaration of the ‘z’ namespace in the document’s root: xmlns:z=”#RowsetSchema”.
Try the following in your Parser method: