+
+ const struct _xmlAttr *attr;
+ std::string id_value;
+ std::string type_value;
+ for (attr = node2->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 == "id")
+ id_value = value;
+ else if (name == "type")
+ type_value = value;
+ else
+ throw XMLError("Error. Only attribute id or type allowed in filter element. Got " + name);
+
+ std::cout << "attr " << name << "=" << value << "\n";
+
+ //const xmlNode *val;
+ }
+
+ yp2::filter::Base* filter_base = m_factory->create(type_value);
+
+ filter_base->configure(node2);
+
+ if (m_id_filter_map.find(id_value) != m_id_filter_map.end())
+ throw XMLError("Filter " + id_value + " already defined");
+
+ m_id_filter_map[id_value] =
+ boost::shared_ptr<yp2::filter::Base>(filter_base);
+