]> www.infradead.org Git - users/dwmw2/ews-sync.git/commitdiff
Start learning about XML and namespaces...
authorDavid Woodhouse <dwmw2@infradead.org>
Mon, 19 Jul 2010 20:56:44 +0000 (21:56 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Mon, 19 Jul 2010 20:56:44 +0000 (21:56 +0100)
ews_autodiscover.c

index 0514ba5475ef7ae709e384a12af1bd621d304178..b578355b7d48e2bdbcbd62fc8f61c1a7f6035d6c 100644 (file)
@@ -24,6 +24,7 @@ int main(int argc, char **argv)
        SoupMessage *msg;
        xmlDoc *doc;
        xmlNode *node, *child;
+       xmlNs *ns;
        guint status;
        xmlOutputBuffer *buf;
        struct ews_auth auth;
@@ -73,13 +74,14 @@ int main(int argc, char **argv)
 
        doc = xmlNewDoc((xmlChar *) "1.0");
        node = xmlNewDocNode(doc, NULL, (xmlChar *)"Autodiscover", NULL);
-       xmlNewProp(node, (xmlChar *)"xmlns", (xmlChar *)"http://schemas.microsoft.com/exchange/autodiscover/outlook/requestschema/2006");
        xmlDocSetRootElement(doc, node);
+       ns = xmlNewNs (node,
+                      (xmlChar *)"http://schemas.microsoft.com/exchange/autodiscover/outlook/requestschema/2006", NULL);
 
-       node = xmlNewChild(node, NULL, (xmlChar *)"Request", NULL);
-       child = xmlNewChild(node, NULL, (xmlChar *)"EMailAddress",
+       node = xmlNewChild(node, ns, (xmlChar *)"Request", NULL);
+       child = xmlNewChild(node, ns, (xmlChar *)"EMailAddress",
                            (xmlChar *)argv[1]);
-       child = xmlNewChild(node, NULL, (xmlChar *)"AcceptableResponseSchema", 
+       child = xmlNewChild(node, ns, (xmlChar *)"AcceptableResponseSchema", 
                            (xmlChar *)"http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a");
        
        buf = xmlAllocOutputBuffer(NULL);