X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Frouter_flexml.hpp;h=7ef7ddf9dbbbf004c2cf92eaea7e1f31cf506219;hb=f26cca046b4879a78261ea436c3e21bb3b851b52;hp=d02c3e1cf9cefc0eb42ed23d58239e1d2a2fd011;hpb=4e730aecb256d1cd52730e6c375f65fb9f118129;p=metaproxy-moved-to-github.git diff --git a/src/router_flexml.hpp b/src/router_flexml.hpp index d02c3e1..7ef7ddf 100644 --- a/src/router_flexml.hpp +++ b/src/router_flexml.hpp @@ -1,4 +1,4 @@ -/* $Id: router_flexml.hpp,v 1.2 2005-10-26 21:30:54 marc Exp $ +/* $Id: router_flexml.hpp,v 1.4 2005-10-28 10:35:30 marc Exp $ Copyright (c) 2005, Index Data. %LICENSE% @@ -83,13 +83,22 @@ namespace yp2 } - void parse_xml_config_dom() { + void parse_xml_config_dom() { + //xmlNs *yp2_ns = xmlNewNs(pptr, BAD_CAST + // "http://indexdata.dk/yp2/config/1", 0); + + + if (m_xmlconf_doc) { const xmlNode* root = xmlDocGetRootElement(m_xmlconf_doc); - if (std::string((const char *) root->name) != "yp2") - xml_dom_error(root, "expected , got "); + if ((std::string((const char *) root->name) != "yp2") + || (std::string((const char *)(root->ns->href)) + != "http://indexdata.dk/yp2/config/1") + ) + xml_dom_error(root, + "expected , got "); for (const struct _xmlAttr *attr = root->properties; attr; attr = attr->next) @@ -133,15 +142,15 @@ namespace yp2 if (std::string((const char *)node2->name) != "filter") xml_dom_error(root, "expected , got "); - - //while(node2 && std::string((const char *)node2->name) == "filter"){ +#if 0 + while(node2 && std::string((const char *)node2->name) == "filter"){ std::cout << "processing /yp2/filters/filter" << std::endl; - //for (; node2 && node2->type != XML_ELEMENT_NODE; node2 = node2->next) - // ; - //if(node2->type != XML_ELEMENT_NODE) - // break; - //} - + for (; node2 && node2->type != XML_ELEMENT_NODE; node2 = node2->next) + std::cout << (const char *) root->name << std::endl; + if(node2->type != XML_ELEMENT_NODE) + break; + } +#endif // process node which is expected third element node node = node->next; for (; node && node->type != XML_ELEMENT_NODE; node = node->next)