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.

This commit is contained in:
jez_higgins 2003-12-07 15:23:55 +00:00
parent b56eaec433
commit 9d914f19e8

View file

@ -35,8 +35,10 @@ std::pair<bool, stringT> checkPrefixAndNamespace(bool hasPrefix,
if(nodeType == DOM::Node<stringT>::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<stringT>::ATTRIBUTE_NODE && prefix == xmlns)