From 981fd4e9e3bc1474a43d55f3310d0b656877bbd6 Mon Sep 17 00:00:00 2001 From: Jez Higgins Date: Tue, 5 Oct 2010 09:39:58 +0100 Subject: [PATCH] Failed if namespace was explicitly given as empty. Fixed --- include/XSLT/impl/handler/xslt_attribute_handler.hpp | 4 ++-- include/XSLT/impl/handler/xslt_element_handler.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/XSLT/impl/handler/xslt_attribute_handler.hpp b/include/XSLT/impl/handler/xslt_attribute_handler.hpp index 59f92e5b..94a4b332 100644 --- a/include/XSLT/impl/handler/xslt_attribute_handler.hpp +++ b/include/XSLT/impl/handler/xslt_attribute_handler.hpp @@ -24,14 +24,14 @@ protected: const SAX::Attributes& atts) { static const ValueRule rules[] = { { "name", true, 0, 0 }, - { "namespace", false, 0, 0 }, + { "namespace", false, "", 0 }, { 0, false, 0, 0 } }; std::map attrs = gatherAttributes(qName, atts, rules); Arabica::XPath::XPathExpressionPtr name = context().xpath_attribute_value_template(attrs["name"]); - if(attrs.find("namespace") == attrs.end()) + if(attrs["namespace"] == "") return new Attribute(name, context().inScopeNamespaces()); diff --git a/include/XSLT/impl/handler/xslt_element_handler.hpp b/include/XSLT/impl/handler/xslt_element_handler.hpp index b5b1b5d6..0e71c12e 100644 --- a/include/XSLT/impl/handler/xslt_element_handler.hpp +++ b/include/XSLT/impl/handler/xslt_element_handler.hpp @@ -24,7 +24,7 @@ protected: const SAX::Attributes& atts) { static const ValueRule rules[] = { { "name", true, 0, 0 }, - { "namespace", false, 0, 0 }, + { "namespace", false, "", 0 }, { "use-attribute-sets", false, 0, 0 }, { 0, false, 0, 0 } }; @@ -35,7 +35,7 @@ protected: if(attrs["use-attribute-sets"] != "") throw SAX::SAXException("don't understand use-attribute-sets yet"); - if(attrs.find("namespace") == attrs.end()) + if(attrs["namespace"] == "") return new Element(name, context().inScopeNamespaces(), attrs["use-attribute-sets"]);