mirror of
https://github.com/jezhiggins/arabica
synced 2025-01-17 18:12:04 +01:00
whipped up a quick do-nothing (ie broken) implementation of element-available
This commit is contained in:
parent
53730337f7
commit
44b5d6ed3a
3 changed files with 36 additions and 10 deletions
|
@ -189,6 +189,11 @@ private:
|
|||
if(name == "system-property")
|
||||
return new SystemPropertyFunction(argExprs);
|
||||
// element-available
|
||||
if(name == "element-available")
|
||||
{
|
||||
std::vector<std::pair<std::string, std::string> > dummy;
|
||||
return new ElementAvailableFunction(dummy, parser_.inScopeNamespaces(), argExprs);
|
||||
}
|
||||
// function-available
|
||||
if(name == "function-available")
|
||||
return new FunctionAvailableFunction(validNames(), parser_.inScopeNamespaces(), argExprs);
|
||||
|
|
|
@ -198,6 +198,31 @@ protected:
|
|||
}; // SystemPropertyFunction
|
||||
|
||||
// boolean element-available(string)
|
||||
class ElementAvailableFunction : public Arabica::XPath::BooleanXPathFunction<std::string>
|
||||
{
|
||||
typedef Arabica::XPath::BooleanXPathFunction<std::string> baseT;
|
||||
public:
|
||||
ElementAvailableFunction(const std::vector<std::pair<std::string, std::string> >& names,
|
||||
const std::map<std::string, std::string>& inscopeNamespaces,
|
||||
const std::vector<Arabica::XPath::XPathExpression<std::string> >& args) :
|
||||
Arabica::XPath::BooleanXPathFunction<std::string>(1, 1, args),
|
||||
namespaces_(inscopeNamespaces),
|
||||
elementNames_(names)
|
||||
{
|
||||
} // ElementAvailableFunction
|
||||
|
||||
protected:
|
||||
virtual bool doEvaluate(const DOM::Node<std::string>& context,
|
||||
const Arabica::XPath::ExecutionContext<std::string>& executionContext) const
|
||||
{
|
||||
return false;
|
||||
} // doEvaluate
|
||||
|
||||
private:
|
||||
std::vector<std::pair<std::string, std::string> > elementNames_;
|
||||
const std::map<std::string, std::string> namespaces_;
|
||||
}; // class ElementAvailableFunction
|
||||
|
||||
// boolean function-available(string)
|
||||
class FunctionAvailableFunction : public Arabica::XPath::BooleanXPathFunction<std::string>
|
||||
{
|
||||
|
@ -207,8 +232,8 @@ public:
|
|||
const std::map<std::string, std::string>& inscopeNamespaces,
|
||||
const std::vector<Arabica::XPath::XPathExpression<std::string> >& args) :
|
||||
Arabica::XPath::BooleanXPathFunction<std::string>(1, 1, args),
|
||||
functionNames_(names),
|
||||
namespaces_(inscopeNamespaces)
|
||||
namespaces_(inscopeNamespaces),
|
||||
functionNames_(names)
|
||||
{
|
||||
Arabica::XPath::StandardXPathFunctionResolver<std::string> standardResolver;
|
||||
const std::vector<std::pair<std::string, std::string> > standardNames = standardResolver.validNames();
|
||||
|
@ -230,8 +255,6 @@ protected:
|
|||
private:
|
||||
std::vector<std::pair<std::string, std::string> > functionNames_;
|
||||
const std::map<std::string, std::string> namespaces_;
|
||||
|
||||
static Arabica::XPath::StandardXPathFunctionResolver<std::string> xpathStandardFunctionResolver;
|
||||
}; // class FunctionAvailableFunction
|
||||
|
||||
class UndefinedFunction : public Arabica::XPath::BooleanXPathFunction<std::string>
|
||||
|
|
|
@ -686,10 +686,10 @@
|
|||
<test-case id="XSLTFunctions__84054" compare="text"/>
|
||||
<test-case id="XSLTFunctions__84056" compare="text"/>
|
||||
<test-case id="XSLTFunctions__84058" compare="text"/>
|
||||
<test-case id="XSLTFunctions__84170" compiles="no"/>
|
||||
<test-case id="XSLTFunctions__84171" compiles="no"/>
|
||||
<test-case id="XSLTFunctions__84172" compiles="no"/>
|
||||
<test-case id="XSLTFunctions__84173" compiles="no"/>
|
||||
<test-case id="XSLTFunctions__84170" compare="text"/>
|
||||
<test-case id="XSLTFunctions__84171" compare="text"/>
|
||||
<test-case id="XSLTFunctions__84172" compare="text"/>
|
||||
<test-case id="XSLTFunctions__84173" compare="text"/>
|
||||
<test-case id="XSLTFunctions__84175" compare="text"/>
|
||||
<test-case id="XSLTFunctions__84415" compare="fragment"/>
|
||||
<test-case id="XSLTFunctions__84421" compare="fragment"/>
|
||||
|
@ -710,8 +710,6 @@
|
|||
<test-case id="XSLTFunctions_DocumentFunctionWithEntityRef" runs="no"/>
|
||||
<test-case id="XSLTFunctions_DocumentInUnion" compare="text"/>
|
||||
<test-case id="XSLTFunctions_DocumentInUnionWithDuplicateNodes" runs="no"/>
|
||||
<test-case id="XSLTFunctions_ElementAvailFunctionFalseTest" compiles="no"/>
|
||||
<test-case id="XSLTFunctions_ElementAvailFunctionTrueTest" compiles="no"/>
|
||||
<test-case id="XSLTFunctions_KeyFuncTestDescendantsNodeset" compiles="no"/>
|
||||
<test-case id="XSLTFunctions_TestIdFuncInComplexStruct" compiles="no"/>
|
||||
<test-case id="XSLTFunctions_TestOfIdFunction" compiles="no"/>
|
||||
|
|
Loading…
Reference in a new issue