+ return mp::xml::is_element(ptr, "http://indexdata.dk/yp2/config/1", name);
+}
+
+
+bool mp_xml::check_element_yp2(const xmlNode *ptr,
+ const std::string &name)
+{
+ if (!mp::xml::is_element_yp2(ptr, name))
+ throw mp::XMLError("Expected element name " + name);
+ return true;
+}
+
+std::string mp_xml::get_route(const xmlNode *node)
+{
+ std::string route_value;
+ if (node)
+ {
+ const struct _xmlAttr *attr;
+ for (attr = node->properties; attr; attr = attr->next)
+ {
+ std::string name = std::string((const char *) attr->name);
+ std::string value;
+
+ if (attr->children && attr->children->type == XML_TEXT_NODE)
+ value = std::string((const char *)attr->children->content);
+
+ if (name == "route")
+ route_value = value;
+ else
+ throw XMLError("Only attribute route allowed"
+ " in " + std::string((const char *)node->name)
+ + " element. Got " + std::string(name));
+ }
+ }
+ return route_value;