mirror of
https://github.com/jezhiggins/arabica
synced 2025-02-06 20:46:18 +01:00
no longer expose xpath compiler directly during XSLT compilation
This commit is contained in:
parent
69a322f7f2
commit
375a2d584f
14 changed files with 21 additions and 19 deletions
|
@ -34,7 +34,7 @@ public:
|
||||||
const std::string& select = attrs["select"];
|
const std::string& select = attrs["select"];
|
||||||
Arabica::XPath::XPathExpressionPtr<std::string> xpath;
|
Arabica::XPath::XPathExpressionPtr<std::string> xpath;
|
||||||
if(select != "")
|
if(select != "")
|
||||||
xpath = context_.xpath().compile_expr(select);
|
xpath = context_.xpath_expression(select);
|
||||||
|
|
||||||
std::pair<std::string, std::string> mode;
|
std::pair<std::string, std::string> mode;
|
||||||
if(attrs["mode"] != "")
|
if(attrs["mode"] != "")
|
||||||
|
|
|
@ -29,14 +29,14 @@ protected:
|
||||||
|
|
||||||
std::map<std::string, std::string> attrs = gatherAttributes(qName, atts, rules);
|
std::map<std::string, std::string> attrs = gatherAttributes(qName, atts, rules);
|
||||||
|
|
||||||
Arabica::XPath::XPathExpressionPtr<std::string> name = context().xpath().compile_attribute_value_template(attrs["name"]);
|
Arabica::XPath::XPathExpressionPtr<std::string> name = context().xpath_attribute_value_template(attrs["name"]);
|
||||||
|
|
||||||
if(attrs.find("namespace") == attrs.end())
|
if(attrs.find("namespace") == attrs.end())
|
||||||
return new Attribute(name,
|
return new Attribute(name,
|
||||||
context().inScopeNamespaces());
|
context().inScopeNamespaces());
|
||||||
|
|
||||||
return new Attribute(name,
|
return new Attribute(name,
|
||||||
context().xpath().compile_attribute_value_template(attrs["namespace"]));
|
context().xpath_attribute_value_template(attrs["namespace"]));
|
||||||
} // createContainer
|
} // createContainer
|
||||||
}; // class AttributeHandler
|
}; // class AttributeHandler
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ public:
|
||||||
{ 0, false, 0} };
|
{ 0, false, 0} };
|
||||||
std::string test = gatherAttributes(qName, atts, rules)["test"];
|
std::string test = gatherAttributes(qName, atts, rules)["test"];
|
||||||
|
|
||||||
return new When(ItemContainerHandler<When>::context().xpath().compile_expr(test));
|
return new When(ItemContainerHandler<When>::context().xpath_expression(test));
|
||||||
} // startElement
|
} // startElement
|
||||||
|
|
||||||
virtual void endElement(const std::string& namespaceURI, const std::string& localName, const std::string& qName)
|
virtual void endElement(const std::string& namespaceURI, const std::string& localName, const std::string& qName)
|
||||||
|
|
|
@ -49,7 +49,7 @@ public:
|
||||||
{ 0, false, 0} };
|
{ 0, false, 0} };
|
||||||
std::string select = gatherAttributes(qName, atts, rules)["select"];
|
std::string select = gatherAttributes(qName, atts, rules)["select"];
|
||||||
|
|
||||||
copyOf_ = new CopyOf(context_.xpath().compile_expr(select));
|
copyOf_ = new CopyOf(context_.xpath_expression(select));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} // if(copyOf_ == 0)
|
} // if(copyOf_ == 0)
|
||||||
|
|
|
@ -30,7 +30,7 @@ protected:
|
||||||
|
|
||||||
std::map<std::string, std::string> attrs = gatherAttributes(qName, atts, rules);
|
std::map<std::string, std::string> attrs = gatherAttributes(qName, atts, rules);
|
||||||
|
|
||||||
Arabica::XPath::XPathExpressionPtr<std::string> name = context().xpath().compile_attribute_value_template(attrs["name"]);
|
Arabica::XPath::XPathExpressionPtr<std::string> name = context().xpath_attribute_value_template(attrs["name"]);
|
||||||
|
|
||||||
if(attrs["use-attribute-sets"] != "")
|
if(attrs["use-attribute-sets"] != "")
|
||||||
throw SAX::SAXException("don't understand use-attribute-sets yet");
|
throw SAX::SAXException("don't understand use-attribute-sets yet");
|
||||||
|
@ -41,7 +41,7 @@ protected:
|
||||||
attrs["use-attribute-sets"]);
|
attrs["use-attribute-sets"]);
|
||||||
|
|
||||||
return new Element(name,
|
return new Element(name,
|
||||||
context().xpath().compile_attribute_value_template(attrs["namespace"]),
|
context().xpath_attribute_value_template(attrs["namespace"]),
|
||||||
attrs["use-attribute-sets"]);
|
attrs["use-attribute-sets"]);
|
||||||
} // createContainer
|
} // createContainer
|
||||||
}; // class ElementHandler
|
}; // class ElementHandler
|
||||||
|
|
|
@ -29,7 +29,7 @@ protected:
|
||||||
{ 0, false, 0} };
|
{ 0, false, 0} };
|
||||||
std::string select = gatherAttributes(qName, atts, rules)["select"];
|
std::string select = gatherAttributes(qName, atts, rules)["select"];
|
||||||
|
|
||||||
return new ForEach(context().xpath().compile_expr(select));
|
return new ForEach(context().xpath_expression(select));
|
||||||
} // createContainer
|
} // createContainer
|
||||||
|
|
||||||
virtual bool createChild(const std::string& namespaceURI,
|
virtual bool createChild(const std::string& namespaceURI,
|
||||||
|
|
|
@ -26,7 +26,7 @@ public:
|
||||||
{ 0, false, 0} };
|
{ 0, false, 0} };
|
||||||
std::string test = gatherAttributes(qName, atts, rules)["test"];
|
std::string test = gatherAttributes(qName, atts, rules)["test"];
|
||||||
|
|
||||||
return new If(ItemContainerHandler<If>::context().xpath().compile_expr(test));
|
return new If(ItemContainerHandler<If>::context().xpath_expression(test));
|
||||||
} // startElement
|
} // startElement
|
||||||
}; // class IfHandler
|
}; // class IfHandler
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ protected:
|
||||||
if(!context().isRemapped(atts.getURI(i)))
|
if(!context().isRemapped(atts.getURI(i)))
|
||||||
inlineAtts.push_back(InlineAttribute(atts.getQName(i),
|
inlineAtts.push_back(InlineAttribute(atts.getQName(i),
|
||||||
atts.getURI(i),
|
atts.getURI(i),
|
||||||
context().xpath().compile_attribute_value_template(atts.getValue(i))));
|
context().xpath_attribute_value_template(atts.getValue(i))));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::pair<std::string, std::string> remap = context().remappedNamespace(atts.getURI(i));
|
std::pair<std::string, std::string> remap = context().remappedNamespace(atts.getURI(i));
|
||||||
|
@ -40,7 +40,7 @@ protected:
|
||||||
std::string name = remap.first + ":" + atts.getLocalName(i);
|
std::string name = remap.first + ":" + atts.getLocalName(i);
|
||||||
inlineAtts.push_back(InlineAttribute(name,
|
inlineAtts.push_back(InlineAttribute(name,
|
||||||
remap.second,
|
remap.second,
|
||||||
context().xpath().compile_attribute_value_template(atts.getValue(i))));
|
context().xpath_attribute_value_template(atts.getValue(i))));
|
||||||
} // if ...
|
} // if ...
|
||||||
} // for ...
|
} // for ...
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ public:
|
||||||
{ 0, false, 0} };
|
{ 0, false, 0} };
|
||||||
std::string name = gatherAttributes(qName, atts, rules)["name"];
|
std::string name = gatherAttributes(qName, atts, rules)["name"];
|
||||||
|
|
||||||
return new ProcessingInstruction(ItemContainerHandler<ProcessingInstruction>::context().xpath().compile_attribute_value_template(name));
|
return new ProcessingInstruction(ItemContainerHandler<ProcessingInstruction>::context().xpath_attribute_value_template(name));
|
||||||
} // createContainer
|
} // createContainer
|
||||||
}; // class ProcessingInstructionHandler
|
}; // class ProcessingInstructionHandler
|
||||||
|
|
||||||
|
|
|
@ -39,9 +39,9 @@ public:
|
||||||
std::map<std::string, std::string> attr = gatherAttributes(qName, atts, rules);
|
std::map<std::string, std::string> attr = gatherAttributes(qName, atts, rules);
|
||||||
|
|
||||||
Arabica::XPath::XPathExpressionPtr<std::string> select, lang, datatype, order, caseorder;
|
Arabica::XPath::XPathExpressionPtr<std::string> select, lang, datatype, order, caseorder;
|
||||||
select = context_.xpath().compile_expr(attr["select"]);
|
select = context_.xpath_expression(attr["select"]);
|
||||||
datatype = context_.xpath().compile_attribute_value_template(attr["data-type"]);
|
datatype = context_.xpath_attribute_value_template(attr["data-type"]);
|
||||||
order = context_.xpath().compile_attribute_value_template(attr["order"]);
|
order = context_.xpath_attribute_value_template(attr["order"]);
|
||||||
|
|
||||||
sort_ = new Sort(select,
|
sort_ = new Sort(select,
|
||||||
lang,
|
lang,
|
||||||
|
|
|
@ -51,7 +51,7 @@ protected:
|
||||||
mode,
|
mode,
|
||||||
atts.getValue("priority"));
|
atts.getValue("priority"));
|
||||||
|
|
||||||
return new Template(context().xpath().compile_match(match),
|
return new Template(context().xpath_match(match),
|
||||||
name,
|
name,
|
||||||
mode,
|
mode,
|
||||||
atts.getValue("priority"));
|
atts.getValue("priority"));
|
||||||
|
|
|
@ -30,7 +30,7 @@ public:
|
||||||
{ 0, false, 0} };
|
{ 0, false, 0} };
|
||||||
|
|
||||||
std::map<std::string, std::string> attrs = gatherAttributes(qName, atts, rules);
|
std::map<std::string, std::string> attrs = gatherAttributes(qName, atts, rules);
|
||||||
valueOf_ = new ValueOf(context_.xpath().compile_expr(attrs["select"]),
|
valueOf_ = new ValueOf(context_.xpath_expression(attrs["select"]),
|
||||||
attrs["disable-output-escaping"] == Yes);
|
attrs["disable-output-escaping"] == Yes);
|
||||||
return;
|
return;
|
||||||
} // if(valueOf_ == 0)
|
} // if(valueOf_ == 0)
|
||||||
|
|
|
@ -35,7 +35,7 @@ protected:
|
||||||
const std::string& select = atts.getValue("select");
|
const std::string& select = atts.getValue("select");
|
||||||
Arabica::XPath::XPathExpressionPtr<std::string> xpath;
|
Arabica::XPath::XPathExpressionPtr<std::string> xpath;
|
||||||
if(select != "")
|
if(select != "")
|
||||||
xpath = this->context().xpath().compile_expr(select);
|
xpath = this->context().xpath_expression(select);
|
||||||
|
|
||||||
std::pair<std::string, std::string> name = this->context().processQName(attrs["name"]);
|
std::pair<std::string, std::string> name = this->context().processQName(attrs["name"]);
|
||||||
return new VType(name.first, name.second, xpath);
|
return new VType(name.first, name.second, xpath);
|
||||||
|
|
|
@ -45,7 +45,9 @@ public:
|
||||||
} // root
|
} // root
|
||||||
|
|
||||||
StylesheetParser& parser() const { return parser_; }
|
StylesheetParser& parser() const { return parser_; }
|
||||||
const Arabica::XPath::XPath<std::string>& xpath() const { return xpath_; }
|
Arabica::XPath::XPathExpressionPtr<std::string> xpath_expression(const std::string& expr) const { return xpath_.compile_expr(expr); }
|
||||||
|
std::vector<Arabica::XPath::MatchExpr<std::string> > xpath_match(const std::string& match) const { return xpath_.compile_match(match); }
|
||||||
|
Arabica::XPath::XPathExpressionPtr<std::string> xpath_attribute_value_template(const std::string& expr) const { return xpath_.compile_attribute_value_template(expr); }
|
||||||
Stylesheet& stylesheet() const { return stylesheet_; }
|
Stylesheet& stylesheet() const { return stylesheet_; }
|
||||||
|
|
||||||
std::pair<std::string, std::string> processQName(const std::string& qName) const
|
std::pair<std::string, std::string> processQName(const std::string& qName) const
|
||||||
|
|
Loading…
Add table
Reference in a new issue