diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c index 30ce1b90e6c..7b6e1abb1ca 100644 --- a/dlls/msxml3/node.c +++ b/dlls/msxml3/node.c @@ -595,7 +595,7 @@ HRESULT node_clone(xmlnode *This, VARIANT_BOOL deep, IXMLDOMNode **cloneNode) clone = xmlCopyNode(This->node, deep ? 1 : 2); if (clone) { - clone->doc = This->node->doc; + xmlSetTreeDoc(clone, This->node->doc); xmldoc_add_orphan(clone->doc, clone); node = create_node(clone); diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index 4b894b000b9..3a62c958a53 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -6073,7 +6073,7 @@ static void test_cloneNode(void ) IXMLDOMNamedNodeMap *mapAttr; LONG length, length1; LONG attr_cnt, attr_cnt1; - IXMLDOMNode *node; + IXMLDOMNode *node, *attr; IXMLDOMNode *node_clone; IXMLDOMNode *node_first; HRESULT hr; @@ -6134,6 +6134,11 @@ static void test_cloneNode(void ) hr = IXMLDOMNamedNodeMap_get_length(mapAttr, &attr_cnt1); ok( hr == S_OK, "ret %08x\n", hr ); ok(attr_cnt1 == 3, "got %d\n", attr_cnt1); + /* now really get some attributes from cloned element */ + attr = NULL; + hr = IXMLDOMNamedNodeMap_getNamedItem(mapAttr, _bstr_("id"), &attr); + ok(hr == S_OK, "ret %08x\n", hr); + IXMLDOMNode_Release(attr); IXMLDOMNamedNodeMap_Release(mapAttr); ok(length == length1, "wrong Child count (%d, %d)\n", length, length1);