Skip to content

Commit 33b9d2d

Browse files
committed
Create namespace of attribtue as close to attribute's element as possible
1 parent 2d21eb7 commit 33b9d2d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ext/dom/namespace_compat.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ static xmlAttrPtr dom_ns_compat_mark_attribute(xmlNodePtr node, xmlNsPtr ns)
4949
name = BAD_CAST "xmlns";
5050
}
5151

52-
// TODO: why on the root?
53-
xmlNsPtr xmlns_ns = dom_ns_create_local_as_is(node->doc, xmlDocGetRootElement(node->doc), node, DOM_XMLNS_NS_URI, prefix);
52+
xmlNsPtr xmlns_ns = dom_ns_create_local_as_is(node->doc, node, node, DOM_XMLNS_NS_URI, prefix);
5453
return xmlSetNsProp(node, xmlns_ns, name, ns->href);
5554
}
5655

0 commit comments

Comments
 (0)