+bool yp2::RouterFleXML::Rep::is_element(const xmlNode *ptr,
+ const std::string &ns,
+ const std::string &name)
+{
+ if (ptr && ptr->type == XML_ELEMENT_NODE && ptr->ns && ptr->ns->href
+ && !xmlStrcmp(BAD_CAST ns.c_str(), ptr->ns->href)
+ && !xmlStrcmp(BAD_CAST name.c_str(), ptr->name))
+ return true;
+ return false;
+}
+
+bool yp2::RouterFleXML::Rep::is_element_yp2(const xmlNode *ptr,
+ const std::string &name)
+{
+ return is_element(ptr, "http://indexdata.dk/yp2/config/1", name);
+}
+
+bool yp2::RouterFleXML::Rep::check_element_yp2(const xmlNode *ptr,
+ const std::string &name)
+{
+ if (!is_element_yp2(ptr, name))
+ throw XMLError("Error. Expected element name " + name);
+ return true;
+}
+