Failed if namespace was explicitly given as empty. Fixed

This commit is contained in:
Jez Higgins 2010-10-05 09:39:58 +01:00
parent ccc4836fd7
commit 981fd4e9e3
2 changed files with 4 additions and 4 deletions

View file

@ -24,14 +24,14 @@ protected:
const SAX::Attributes<std::string>& atts) const SAX::Attributes<std::string>& atts)
{ {
static const ValueRule rules[] = { { "name", true, 0, 0 }, static const ValueRule rules[] = { { "name", true, 0, 0 },
{ "namespace", false, 0, 0 }, { "namespace", false, "", 0 },
{ 0, false, 0, 0 } }; { 0, false, 0, 0 } };
std::map<std::string, std::string> attrs = gatherAttributes(qName, atts, rules); std::map<std::string, std::string> attrs = gatherAttributes(qName, atts, rules);
Arabica::XPath::XPathExpressionPtr<std::string> name = context().xpath_attribute_value_template(attrs["name"]); Arabica::XPath::XPathExpressionPtr<std::string> name = context().xpath_attribute_value_template(attrs["name"]);
if(attrs.find("namespace") == attrs.end()) if(attrs["namespace"] == "")
return new Attribute(name, return new Attribute(name,
context().inScopeNamespaces()); context().inScopeNamespaces());

View file

@ -24,7 +24,7 @@ protected:
const SAX::Attributes<std::string>& atts) const SAX::Attributes<std::string>& atts)
{ {
static const ValueRule rules[] = { { "name", true, 0, 0 }, static const ValueRule rules[] = { { "name", true, 0, 0 },
{ "namespace", false, 0, 0 }, { "namespace", false, "", 0 },
{ "use-attribute-sets", false, 0, 0 }, { "use-attribute-sets", false, 0, 0 },
{ 0, false, 0, 0 } }; { 0, false, 0, 0 } };
@ -35,7 +35,7 @@ protected:
if(attrs["use-attribute-sets"] != "") if(attrs["use-attribute-sets"] != "")
throw SAX::SAXException("don't understand use-attribute-sets yet"); throw SAX::SAXException("don't understand use-attribute-sets yet");
if(attrs.find("namespace") == attrs.end()) if(attrs["namespace"] == "")
return new Element(name, return new Element(name,
context().inScopeNamespaces(), context().inScopeNamespaces(),
attrs["use-attribute-sets"]); attrs["use-attribute-sets"]);