From 1140291adc537121422e5d4184a0502d6e368d2d Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Wed, 1 Jun 2016 14:33:20 +0300 Subject: [PATCH] msxml3/schema: Support element nodes in add(). Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/msxml3/schema.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/dlls/msxml3/schema.c b/dlls/msxml3/schema.c index f92130a90d9..30272cbfddf 100644 --- a/dlls/msxml3/schema.c +++ b/dlls/msxml3/schema.c @@ -1247,7 +1247,30 @@ static HRESULT WINAPI schema_cache_add(IXMLDOMSchemaCollection2* iface, BSTR uri IUnknown_QueryInterface(V_UNKNOWN(&var), &IID_IXMLDOMNode, (void**)&domnode); if (domnode) - doc = xmlNodePtr_from_domnode(domnode, XML_DOCUMENT_NODE)->doc; + { + DOMNodeType type; + + IXMLDOMNode_get_nodeType(domnode, &type); + switch (type) + { + case NODE_ELEMENT: + { + IXMLDOMDocument *domdoc; + VARIANT_BOOL b; + BSTR xml; + + IXMLDOMNode_get_xml(domnode, &xml); + DOMDocument_create(This->version, (void**)&domdoc); + IXMLDOMDocument_loadXML(domdoc, xml, &b); + SysFreeString(xml); + doc = xmlNodePtr_from_domnode((IXMLDOMNode*)domdoc, XML_DOCUMENT_NODE)->doc; + break; + } + default: + doc = xmlNodePtr_from_domnode(domnode, XML_DOCUMENT_NODE)->doc; + break; + } + } if (!doc) {