Commit 2191d977 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: Duplicate stylesheet document before passing it to libxslt.

parent b280c3bf
......@@ -1320,6 +1320,7 @@ HRESULT node_transform_node_params(const xmlnode *This, IXMLDOMNode *stylesheet,
{
#ifdef SONAME_LIBXSLT
xsltStylesheetPtr xsltSS;
xmlDocPtr sheet_doc;
HRESULT hr = S_OK;
xmlnode *sheet;
......@@ -1331,8 +1332,9 @@ HRESULT node_transform_node_params(const xmlnode *This, IXMLDOMNode *stylesheet,
sheet = get_node_obj(stylesheet);
if(!sheet) return E_FAIL;
xsltSS = pxsltParseStylesheetDoc(sheet->node->doc);
if(xsltSS)
sheet_doc = xmlCopyDoc(sheet->node->doc, 1);
xsltSS = pxsltParseStylesheetDoc(sheet_doc);
if (xsltSS)
{
const char **xslparams = NULL;
xmlDocPtr result;
......@@ -1377,11 +1379,11 @@ HRESULT node_transform_node_params(const xmlnode *This, IXMLDOMNode *stylesheet,
hr = node_transform_write_to_bstr(xsltSS, result, p);
xmlFreeDoc(result);
}
/* libxslt "helpfully" frees the XML document the stylesheet was
generated from, too */
xsltSS->doc = NULL;
pxsltFreeStylesheet(xsltSS);
}
else
xmlFreeDoc(sheet_doc);
if(!*p) *p = SysAllocStringLen(NULL, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment