From 9d914f19e88bcbfeef609bad78c2cba270153c35 Mon Sep 17 00:00:00 2001 From: jez_higgins <> Date: Sun, 7 Dec 2003 15:23:55 +0000 Subject: [PATCH] Change in checkPrefixAndNamespace to bind xmlns: to http://www.w3.org/2000/xmlns/ if it is unbound. This isn't exactly ideal, but it seems to be the least painful way to resolve the DOM and Namespace recommendation's disagreements about this. --- DOM/Simple/Helpers.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/DOM/Simple/Helpers.h b/DOM/Simple/Helpers.h index 29b1213d..32ccec74 100644 --- a/DOM/Simple/Helpers.h +++ b/DOM/Simple/Helpers.h @@ -35,8 +35,10 @@ std::pair checkPrefixAndNamespace(bool hasPrefix, if(nodeType == DOM::Node::ATTRIBUTE_NODE && prefix == xmlns) { - if(namespaceURI == xmlnsURI) - return std::make_pair(true, namespaceURI); + // DOM mandates xmlns: be bound to a namespace URI, XML Namespace rec + // says not - allow for both here + if((namespaceURI == xmlnsURI) || (namespaceURI.empty())) + return std::make_pair(true, xmlnsURI); throw DOM::DOMException(DOM::DOMException::NAMESPACE_ERR); } // if(nodeType == DOM::Node::ATTRIBUTE_NODE && prefix == xmlns)