-/* $Id: router_flexml.cpp,v 1.14 2006-01-11 13:13:49 adam Exp $
+/* $Id: router_flexml.cpp,v 1.16 2006-01-19 09:41:01 adam Exp $
Copyright (c) 2005, Index Data.
%LICENSE%
std::string m_start_route;
+ std::string m_dl_path;
+
void parse_xml_config_dom(xmlDocPtr doc);
void parse_xml_filters(xmlDocPtr doc, const xmlNode *node);
" in filter element. Got " + name);
}
+ if (!m_factory->exist(type_value))
+ {
+ std::cout << "about to load " << type_value << ", path=" <<
+ m_dl_path << "\n";
+ m_factory->add_creator_dl(type_value, m_dl_path);
+ }
yp2::filter::Base* filter_base = m_factory->create(type_value);
filter_base->configure(node);
id_value = value;
else
throw yp2::XMLError("Only attribute 'id' allowed for"
- " element 'route'."
- " Got " + name);
+ " element 'route'."
+ " Got " + name);
}
Route route;
}
else if (type_value.length())
{
+ if (!m_factory->exist(type_value))
+ {
+ std::cout << "about to load " << type_value << ", path=" <<
+ m_dl_path << "\n";
+ m_factory->add_creator_dl(type_value, m_dl_path);
+ }
yp2::filter::Base* filter_base = m_factory->create(type_value);
filter_base->configure(node3);
yp2::xml::check_element_yp2(root, "yp2");
- // process <start> node which is expected first element node
const xmlNode* node = yp2::xml::jump_to_children(root, XML_ELEMENT_NODE);
+
+ if (yp2::xml::is_element_yp2(node, "dlpath"))
+ {
+ m_dl_path = yp2::xml::get_text(node);
+ node = yp2::xml::jump_to_next(node, XML_ELEMENT_NODE);
+ }
+ // process <start> node which is expected first element node
if (yp2::xml::check_element_yp2(node, "start"))
{
const struct _xmlAttr *attr;
}
node = yp2::xml::jump_to_next(node, XML_ELEMENT_NODE);
}
- // process <filters> node which is expected second element node
- yp2::xml::check_element_yp2(node, "filters");
-
- parse_xml_filters(doc, yp2::xml::jump_to_children(node, XML_ELEMENT_NODE));
+ // process <filters> node if given
+ if (yp2::xml::is_element_yp2(node, "filters"))
+ {
+ parse_xml_filters(doc, yp2::xml::jump_to_children(node,
+ XML_ELEMENT_NODE));
+ node = yp2::xml::jump_to_next(node, XML_ELEMENT_NODE);
+ }
// process <routes> node which is expected third element node
- node = yp2::xml::jump_to_next(node, XML_ELEMENT_NODE);
yp2::xml::check_element_yp2(node, "routes");
parse_xml_routes(doc, yp2::xml::jump_to_children(node, XML_ELEMENT_NODE));