I'm retrieving data from a Share Point server via the Lists web services GetList method but I'm having trouble using the returned data.
The data returned in the InnerXml of the XmlNode can't be converted to XML or a DataSet since it appears that there is more than 1 root element. This is what I'm getting (actual data has been replace by more generic terms but the schema is correct).
<rs
ata ItemCount="40" xmlns:rs="urn
chemas-microsoft-com:rowset">
<z:row ows_DocIcon="doc" ows_LinkFilename="Name number.doc" ows_Document_x0020_Type="12;#Job Sheet" ows_Install_x0020_Date="2006-10-09 00:00:00" ows_Site_x0020_Name="148;#Name" ows_Job_x0020_Number="Number" ows_Job_x0020_User="6;#" ows_Last_x0020_Modified="298;#2006-10-10 10:02:18" ows_ID="298" ows_owshiddenversion="2" ows_FSObjType="298;#0" ows_FileLeafRef="298;#Name Number.doc" ows_Date_x0020_Received="2006-09-12 00:00:00" ows_Modified="2006-10-10 10:02:17" ows_FileRef="298;#Department/Site/Shared Documents/Name/Number/Name Number.doc" ows_Editor="203;#Firstname Lastname" xmlns:z="#RowsetSchema" />
... then another 39 of these z:rows
</rs
ata>
If I try using a foreach loop on the nodes contained by the XmlNode returned by GetList - it only iterates through the loop twice - once for the rs
Can anyone explain what is going on here Am I missing setting some parameter that dictates how the data is returned
If I use the code below I can walk through the xml and and this case just add the data row details to a multiline textbox. I could use the childChildNode.Attributes to do something with the data but I was wondering if there wasn't a more "databound" type of solution.
foreach (XmlNode childNode in node)
{
// txtLists.Text += childNode.OuterXml + "\n";
if (childNode.HasChildNodes)
{
foreach (XmlNode childChildNode in childNode)
{
if (childChildNode.NodeType == XmlNodeType.Element)
{
txtLists.Text += childChildNode.OuterXml + "\n";
}
}
}
}
Thanks
Scott