+void yf::HttpRewrite::Content::configure(
+ const xmlNode *ptr, std::map<std::string, RulePtr > &rules)
+{
+ for (; ptr; ptr = ptr->next)
+ {
+ if (ptr->type != XML_ELEMENT_NODE)
+ continue;
+ if (!strcmp((const char *) ptr->name, "within"))
+ {
+ static const char *names[6] =
+ { "header", "attr", "tag", "rule", "reqline", 0 };
+ std::string values[5];
+ mp::xml::parse_attr(ptr, names, values);
+ Within w;
+ w.header = values[0];
+ w.attr = values[1];
+ w.tag = values[2];
+ std::map<std::string,RulePtr>::const_iterator it =
+ rules.find(values[3]);
+ if (it == rules.end())
+ throw mp::filter::FilterException
+ ("Reference to non-existing rule '" + values[3] +
+ "' in http_rewrite filter");
+ w.rule = it->second;
+ w.reqline = values[4] == "1";
+ within_list.push_back(w);
+ }
+ }
+}
+