|
-
Aug 14th, 2007, 11:34 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] Help with XML Document
Hi guys! Help please..I have a code below that retrieves Data from Sharepoint 2003 thru its Web Services which returns data as XML Document, and assigned that XML Document to ndEventsItems variable of type XmlNode
Code:
public XmlNode FuncGetEvents()
{
XmlNode ndEventsItems;
try
{
string DateToday = DateTime.Now.ToString("yyyy-MM-dd");
lstServiceEvents.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
lstServiceEvents.PreAuthenticate = true;
XmlDocument xmlDoc = new System.Xml.XmlDocument();
XmlNode ndQuery = xmlDoc.CreateNode(XmlNodeType.Element, "Query", "");
XmlNode ndViewFields = xmlDoc.CreateNode(XmlNodeType.Element, "ViewFields", "");
XmlNode ndQueryOptions = xmlDoc.CreateNode(XmlNodeType.Element, "QueryOptions", "");
ndQuery.InnerXml = "<Where>" +
"<Geq><FieldRef Name='EventDate'/><Value Type='DateTime'>" + DateToday + "</Value></Geq>" +
"</Where>";
ndEventsItems = lstServiceEvents.GetListItems("Events", null, ndQuery, null, null, ndQueryOptions);
}
catch (Exception ex)
{
AlarmEventsEnable = false;
Common.LogException(ex, "FuncGetEvents");
}
return ndEventsItems;
}
The OuterXml Property of ndEventsItems variable could have a value somthing like below
<listitems
xmlns:s=\"uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882\"
xmlns:dt=\"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882\"
xmlns:rs=\"urn:schemas-microsoft-com:rowset\"
xmlns:z=\"#RowsetSchema\"
xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\"
>
<rs:data ItemCount=\"2\">
<z:row ows_fRecurrence=\"0\" ows_LinkTitle=\"BAC Meeting\" ows_EventDate=\"2007-08-15 09:00:00\" ows_Location=\"C. U. Del Rosario Hall B & C Power Training Center Bldg.\" ows_Alarm=\"2007-08-14 16:45:00\" ows_AlarmMemberChoice=\"ALL\" ows_Attachments=\"0\" ows_Attachment=\", \" ows_Title=\"BAC Meeting\" ows_ID=\"106\" ows_owshiddenversion=\"8\" />
<z:row ows_fRecurrence=\"0\" ows_LinkTitle=\"Test1\" ows_EventDate=\"2007-08-15 00:00:00\" ows_AlarmMemberChoice=\"ALL\" ows_Attachments=\"0\" ows_Attachment=\", \" ows_Title=\"Test1\" ows_ID=\"107\" ows_owshiddenversion=\"1\" />
</rs:data>
</listitems>
My first question is it posible to Loop through the nodes or rows and check if the value of "ows_LinkTitle" Attribute is equal to "Test1" and if it matches the criteria that row or node will be deleted.
My second question is, if first question is not posible, Is it posible to convert the ndEventsItems variable of type XmlNode to Dataset?
Thanks in advance!
Last edited by daimous; Aug 16th, 2007 at 02:49 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|