1.1 --- a/libxml2dom/macrolib/macrolib.py Sun Dec 11 17:26:25 2005 +0000
1.2 +++ b/libxml2dom/macrolib/macrolib.py Sun Dec 11 17:27:30 2005 +0000
1.3 @@ -217,10 +217,15 @@
1.4
1.5 prefix, localName = _get_prefix_and_localName(name)
1.6 new_node = libxml2mod.xmlNewNode(localName)
1.7 - # NOTE: Does it make sense to set the namespace if it is empty?
1.8 +
1.9 + # If the namespace is not empty, set the declaration.
1.10 if ns is not None:
1.11 new_ns = libxml2mod.xmlNewNs(new_node, ns, prefix)
1.12 libxml2mod.xmlSetNs(new_node, new_ns)
1.13 + # If the namespace is empty, set a "null" declaration.
1.14 + else:
1.15 + new_ns = libxml2mod.xmlNewNs(new_node, "", prefix)
1.16 + libxml2mod.xmlSetNs(new_node, new_ns)
1.17 return new_node
1.18
1.19 def Node_createElement(node, name):