开发者

GetListitems results from SharePoint?

开发者 https://www.devze.com 2022-12-30 08:56 出处:网络
The GetListitems web service relies on XML to retrieve data from SharePoint. Some actual working code is:

The GetListitems web service relies on XML to retrieve data from SharePoint.

Some actual working code is:

var doc = new XmlDocument();
            doc.LoadXml("<Document><Query><Where><Contains><FieldRef Name=\"DeliveryStatus\" /><Value Type=\"Text\">Created</Value></Contains></Where></Query><ViewFields /><QueryOptions /></Document>");
            XmlNode listQuery = doc.SelectSingleNode("//Query");
            XmlNode listViewFields = doc.SelectSingleNode("//ViewFields");
            XmlNode listQueryOptions = doc.SelectSingleNode("//QueryOptions");
            XmlNode items = wsLists.GetListItems(ListName, string.Empty, listQuery, listViewFields, string.Empty, listQu开发者_运维百科eryOptions, null);

Once XMLNode is populated, is there a tried and tested way to traverse the collection of childnodes?

I know how to do this using .net general techniques, but what concerns me is that there might be some pitfalls I am unaware of. For example, I noticed the firstChild and lastChild are empty during some of my tests. I wonder if this is an exception rather than a rule. Its impossible to know from MSDN documentation, so if any of you guys have experience with this please share.

Thanks in advance


You mean FirstChild and LastChild sometimes are empty? Well, if you have tags like <QueryOptions /> and such, then it means they have no childs. By logic I guess that those properties must be empty then.

Or is there any other problem than that?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号