From 94a28f07f836f9629e9f711403a6312f0e163db7 Mon Sep 17 00:00:00 2001 From: Jez Higgins Date: Sun, 21 Feb 2010 22:14:04 +0000 Subject: [PATCH] filled out element-available implementation --- include/XSLT/impl/xslt_functions.hpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/XSLT/impl/xslt_functions.hpp b/include/XSLT/impl/xslt_functions.hpp index a36f481e..ded46f4c 100644 --- a/include/XSLT/impl/xslt_functions.hpp +++ b/include/XSLT/impl/xslt_functions.hpp @@ -215,6 +215,22 @@ protected: virtual bool doEvaluate(const DOM::Node& context, const Arabica::XPath::ExecutionContext& executionContext) const { + const std::string functionName = baseT::argAsString(0, context, executionContext); + const XML::QualifiedName expandedName = XML::QualifiedName::parseQName(functionName, true, namespaces_); + + if(expandedName.namespaceUri() != StylesheetConstant::NamespaceURI()) + return false; + + static const char* XSLTNames[] = { "apply-imports", "apply-templates", "attributes", + "call-template", "choose", "comment", "copy", + "copy-of", "element", "fallback", "for-each", + "if", "message", "number", "processing-instruction", + "text", "value-of", "variable", 0 }; + + for(int i = 0; XSLTNames[i] != 0; ++i) + if(expandedName.localName() == XSLTNames[i]) + return true; + return false; } // doEvaluate