diff --git a/include/XPath/impl/xpath_compile_context.hpp b/include/XPath/impl/xpath_compile_context.hpp index a6294296..5ce2c24e 100644 --- a/include/XPath/impl/xpath_compile_context.hpp +++ b/include/XPath/impl/xpath_compile_context.hpp @@ -14,7 +14,7 @@ namespace impl { template -class CompilationContext +class CompilationContext : private NamespaceContext { public: CompilationContext(const XPath& xpathCompiler, @@ -27,10 +27,19 @@ public: } // CompilationContext const XPath& xpath() const { return xpath_; } - const NamespaceContext& namespaceContext() const { return namespaceContext_; } + const NamespaceContext& namespaceContext() const { return *this; } const FunctionResolver& functionResolver() const { return functionResolver_; } private: + virtual string_type namespaceURI(const string_type& prefix) const + { + string_type uri = namespaceContext_.namespaceURI(prefix); + if(string_adaptor::empty(uri)) + throw Arabica::XPath::UnboundNamespacePrefixException(prefix); + return uri; + } // namespaceURI + + const XPath& xpath_; const NamespaceContext& namespaceContext_; const FunctionResolver& functionResolver_;