}
+string CalDAV::ProcessXMLCalendarHome(){
+
+ string CalendarHomeURI;
+
+ xmlDocPtr xmlCalDAVDoc;
+ xmlCalDAVDoc = xmlReadMemory(ServerData.c_str(), (int)ServerData.size(), "noname.xml", NULL, 0);
+
+ xmlNodePtr NodeSeek;
+ bool NodeFound = false;
+
+ // Start with the first node, look for multistatus.
+
+ for (NodeSeek = xmlCalDAVDoc->children;
+ NodeSeek != NULL;
+ NodeSeek = NodeSeek->next)
+ {
+
+ if (!xmlStrcmp(NodeSeek->name, (const xmlChar *)"multistatus") ||
+ !xmlStrcmp(NodeSeek->name, (const xmlChar *)"d:multistatus") ||
+ !xmlStrcmp(NodeSeek->name, (const xmlChar *)"D:multistatus")
+ ){
+
+ NodeFound = true;
+ break;
+
+ }
+
+ }
+
+ // Look for response.
+
+ if (NodeFound == false){ return CalendarHomeURI; } else { NodeFound = false; }
+ NodeFound = MatchXMLName(&NodeSeek, "response");
+
+ // Look for propstat.
+
+ if (NodeFound == false){ return CalendarHomeURI; } else { NodeFound = false; }
+ NodeFound = MatchXMLName(&NodeSeek, "propstat");
+
+ // Look for prop.
+
+ if (NodeFound == false){ return CalendarHomeURI; } else { NodeFound = false; }
+ NodeFound = MatchXMLName(&NodeSeek, "prop");
+
+ // Look for calendar-home-set.
+
+ if (NodeFound == false){ return CalendarHomeURI; } else { NodeFound = false; }
+ NodeFound = MatchXMLName(&NodeSeek, "calendar-home-set");
+
+ // Look for href.
+
+ if (NodeFound == false){ return CalendarHomeURI; } else { NodeFound = false; }
+ NodeFound = MatchXMLName(&NodeSeek, "href");
+
+ // Get the data from href.
+
+ CalendarHomeURI = FetchXMLData(&NodeSeek);
+
+ xmlFreeDoc(xmlCalDAVDoc);
+
+ return CalendarHomeURI;
+
+}
+
bool CalDAV::MatchXMLName(xmlNodePtr *NodePtr, string NodeName){
string NodeNameSmallD = "d:" + NodeName;