no longer expose xpath compiler directly during XSLT compilation

This commit is contained in:
jez 2007-11-22 17:50:25 +00:00
parent 69a322f7f2
commit 375a2d584f
14 changed files with 21 additions and 19 deletions

View file

@ -34,7 +34,7 @@ public:
const std::string& select = attrs["select"];
Arabica::XPath::XPathExpressionPtr<std::string> xpath;
if(select != "")
xpath = context_.xpath().compile_expr(select);
xpath = context_.xpath_expression(select);
std::pair<std::string, std::string> mode;
if(attrs["mode"] != "")

View file

@ -29,14 +29,14 @@ protected:
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())
return new Attribute(name,
context().inScopeNamespaces());
return new Attribute(name,
context().xpath().compile_attribute_value_template(attrs["namespace"]));
context().xpath_attribute_value_template(attrs["namespace"]));
} // createContainer
}; // class AttributeHandler

View file

@ -27,7 +27,7 @@ public:
{ 0, false, 0} };
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
virtual void endElement(const std::string& namespaceURI, const std::string& localName, const std::string& qName)

View file

@ -49,7 +49,7 @@ public:
{ 0, false, 0} };
std::string select = gatherAttributes(qName, atts, rules)["select"];
copyOf_ = new CopyOf(context_.xpath().compile_expr(select));
copyOf_ = new CopyOf(context_.xpath_expression(select));
return;
} // if(copyOf_ == 0)

View file

@ -30,7 +30,7 @@ protected:
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"] != "")
throw SAX::SAXException("don't understand use-attribute-sets yet");
@ -41,7 +41,7 @@ protected:
attrs["use-attribute-sets"]);
return new Element(name,
context().xpath().compile_attribute_value_template(attrs["namespace"]),
context().xpath_attribute_value_template(attrs["namespace"]),
attrs["use-attribute-sets"]);
} // createContainer
}; // class ElementHandler

View file

@ -29,7 +29,7 @@ protected:
{ 0, false, 0} };
std::string select = gatherAttributes(qName, atts, rules)["select"];
return new ForEach(context().xpath().compile_expr(select));
return new ForEach(context().xpath_expression(select));
} // createContainer
virtual bool createChild(const std::string& namespaceURI,

View file

@ -26,7 +26,7 @@ public:
{ 0, false, 0} };
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
}; // class IfHandler

View file

@ -31,7 +31,7 @@ protected:
if(!context().isRemapped(atts.getURI(i)))
inlineAtts.push_back(InlineAttribute(atts.getQName(i),
atts.getURI(i),
context().xpath().compile_attribute_value_template(atts.getValue(i))));
context().xpath_attribute_value_template(atts.getValue(i))));
else
{
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);
inlineAtts.push_back(InlineAttribute(name,
remap.second,
context().xpath().compile_attribute_value_template(atts.getValue(i))));
context().xpath_attribute_value_template(atts.getValue(i))));
} // if ...
} // for ...

View file

@ -26,7 +26,7 @@ public:
{ 0, false, 0} };
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
}; // class ProcessingInstructionHandler

View file

@ -39,9 +39,9 @@ public:
std::map<std::string, std::string> attr = gatherAttributes(qName, atts, rules);
Arabica::XPath::XPathExpressionPtr<std::string> select, lang, datatype, order, caseorder;
select = context_.xpath().compile_expr(attr["select"]);
datatype = context_.xpath().compile_attribute_value_template(attr["data-type"]);
order = context_.xpath().compile_attribute_value_template(attr["order"]);
select = context_.xpath_expression(attr["select"]);
datatype = context_.xpath_attribute_value_template(attr["data-type"]);
order = context_.xpath_attribute_value_template(attr["order"]);
sort_ = new Sort(select,
lang,

View file

@ -51,7 +51,7 @@ protected:
mode,
atts.getValue("priority"));
return new Template(context().xpath().compile_match(match),
return new Template(context().xpath_match(match),
name,
mode,
atts.getValue("priority"));

View file

@ -30,7 +30,7 @@ public:
{ 0, false, 0} };
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);
return;
} // if(valueOf_ == 0)

View file

@ -35,7 +35,7 @@ protected:
const std::string& select = atts.getValue("select");
Arabica::XPath::XPathExpressionPtr<std::string> xpath;
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"]);
return new VType(name.first, name.second, xpath);

View file

@ -45,7 +45,9 @@ public:
} // root
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_; }
std::pair<std::string, std::string> processQName(const std::string& qName) const