Refactoring in the Rule class to make it more elegant

This commit is contained in:
Felipe Zimmerle
2019-02-25 20:22:38 -03:00
parent 4c0fc7b6ff
commit a5a0f261e2
23 changed files with 191 additions and 210 deletions

View File

@@ -89,9 +89,8 @@ void XML::evaluate(Transaction *t,
if (rule == NULL) {
ms_dbg_a(t, 2, "XML: Can't look for xmlns, internal error.");
} else {
std::vector<actions::Action *> acts = rule->getActionsByName("xmlns", t);
for (auto &x : acts) {
actions::XmlNS *z = (actions::XmlNS *)x;
std::vector<actions::XmlNS *> acts = rule->getXmlNSsPtr();
for (auto &z : acts) {
if (xmlXPathRegisterNs(xpathCtx, (const xmlChar*)z->m_scope.c_str(),
(const xmlChar*)z->m_href.c_str()) != 0) {
ms_dbg_a(t, 1, "Failed to register XML namespace href \"" + \