msxml3/schema: Support element nodes in add().

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2016-06-01 14:33:20 +03:00 committed by Alexandre Julliard
parent 20686f47af
commit 1140291adc
1 changed files with 24 additions and 1 deletions

View File

@ -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)
{