Commit bf01d1b3 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: Remove transformNode() forward.

parent aac690d4
......@@ -478,10 +478,11 @@ static HRESULT WINAPI domattr_get_xml(
static HRESULT WINAPI domattr_transformNode(
IXMLDOMAttribute *iface,
IXMLDOMNode* domNode, BSTR* p)
IXMLDOMNode *node, BSTR *p)
{
domattr *This = impl_from_IXMLDOMAttribute( iface );
return IXMLDOMNode_transformNode( &This->node.IXMLDOMNode_iface, domNode, p );
TRACE("(%p)->(%p %p)\n", This, node, p);
return node_transform_node(&This->node, node, p);
}
static HRESULT WINAPI domattr_selectNodes(
......
......@@ -488,10 +488,11 @@ static HRESULT WINAPI domcdata_get_xml(
static HRESULT WINAPI domcdata_transformNode(
IXMLDOMCDATASection *iface,
IXMLDOMNode* domNode, BSTR* p)
IXMLDOMNode *node, BSTR *p)
{
domcdata *This = impl_from_IXMLDOMCDATASection( iface );
return IXMLDOMNode_transformNode( &This->node.IXMLDOMNode_iface, domNode, p );
TRACE("(%p)->(%p %p)\n", This, node, p);
return node_transform_node(&This->node, node, p);
}
static HRESULT WINAPI domcdata_selectNodes(
......
......@@ -481,10 +481,11 @@ static HRESULT WINAPI domcomment_get_xml(
static HRESULT WINAPI domcomment_transformNode(
IXMLDOMComment *iface,
IXMLDOMNode* domNode, BSTR* p)
IXMLDOMNode *node, BSTR *p)
{
domcomment *This = impl_from_IXMLDOMComment( iface );
return IXMLDOMNode_transformNode( &This->node.IXMLDOMNode_iface, domNode, p );
TRACE("(%p)->(%p %p)\n", This, node, p);
return node_transform_node(&This->node, node, p);
}
static HRESULT WINAPI domcomment_selectNodes(
......
......@@ -485,10 +485,11 @@ static HRESULT WINAPI domfrag_get_xml(
static HRESULT WINAPI domfrag_transformNode(
IXMLDOMDocumentFragment *iface,
IXMLDOMNode* domNode, BSTR* p)
IXMLDOMNode *node, BSTR *p)
{
domfrag *This = impl_from_IXMLDOMDocumentFragment( iface );
return IXMLDOMNode_transformNode( &This->node.IXMLDOMNode_iface, domNode, p );
TRACE("(%p)->(%p %p)\n", This, node, p);
return node_transform_node(&This->node, node, p);
}
static HRESULT WINAPI domfrag_selectNodes(
......
......@@ -1432,11 +1432,12 @@ static HRESULT WINAPI domdoc_get_xml(
static HRESULT WINAPI domdoc_transformNode(
IXMLDOMDocument3 *iface,
IXMLDOMNode* styleSheet,
BSTR* xmlString )
IXMLDOMNode *node,
BSTR *p)
{
domdoc *This = impl_from_IXMLDOMDocument3( iface );
return IXMLDOMNode_transformNode( &This->node.IXMLDOMNode_iface, styleSheet, xmlString );
TRACE("(%p)->(%p %p)\n", This, node, p);
return node_transform_node(&This->node, node, p);
}
......
......@@ -937,10 +937,11 @@ static HRESULT WINAPI domelem_get_xml(
static HRESULT WINAPI domelem_transformNode(
IXMLDOMElement *iface,
IXMLDOMNode* domNode, BSTR* p)
IXMLDOMNode *node, BSTR *p)
{
domelem *This = impl_from_IXMLDOMElement( iface );
return IXMLDOMNode_transformNode( &This->node.IXMLDOMNode_iface, domNode, p );
TRACE("(%p)->(%p %p)\n", This, node, p);
return node_transform_node(&This->node, node, p);
}
static HRESULT WINAPI domelem_selectNodes(
......
......@@ -479,10 +479,11 @@ static HRESULT WINAPI entityref_get_xml(
static HRESULT WINAPI entityref_transformNode(
IXMLDOMEntityReference *iface,
IXMLDOMNode* domNode, BSTR* p)
IXMLDOMNode *node, BSTR *p)
{
entityref *This = impl_from_IXMLDOMEntityReference( iface );
return IXMLDOMNode_transformNode( &This->node.IXMLDOMNode_iface, domNode, p );
TRACE("(%p)->(%p %p)\n", This, node, p);
return node_transform_node(&This->node, node, p);
}
static HRESULT WINAPI entityref_selectNodes(
......
......@@ -270,6 +270,7 @@ extern HRESULT node_get_owner_doc(const xmlnode*,IXMLDOMDocument**);
extern HRESULT node_get_text(const xmlnode*,BSTR*);
extern HRESULT node_select_nodes(const xmlnode*,BSTR,IXMLDOMNodeList**);
extern HRESULT node_select_singlenode(const xmlnode*,BSTR,IXMLDOMNode**);
extern HRESULT node_transform_node(const xmlnode*,IXMLDOMNode*,BSTR*);
extern HRESULT get_domdoc_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument3 **document);
......
......@@ -952,66 +952,54 @@ HRESULT node_get_xml(xmlnode *This, BOOL ensure_eol, BOOL ensure_no_encoding, BS
return *ret ? S_OK : E_OUTOFMEMORY;
}
static HRESULT WINAPI xmlnode_transformNode(
IXMLDOMNode *iface,
IXMLDOMNode* styleSheet,
BSTR* xmlString)
HRESULT node_transform_node(const xmlnode *This, IXMLDOMNode *stylesheet, BSTR *p)
{
#ifdef SONAME_LIBXSLT
xmlnode *This = impl_from_IXMLDOMNode( iface );
xmlnode *pStyleSheet = NULL;
xsltStylesheetPtr xsltSS = NULL;
xmlDocPtr result = NULL;
TRACE("(%p)->(%p %p)\n", This, styleSheet, xmlString);
xsltStylesheetPtr xsltSS;
xmlnode *sheet;
if (!libxslt_handle)
return E_NOTIMPL;
if(!styleSheet || !xmlString)
return E_INVALIDARG;
if (!libxslt_handle) return E_NOTIMPL;
if (!stylesheet || !p) return E_INVALIDARG;
*xmlString = NULL;
*p = NULL;
pStyleSheet = get_node_obj(styleSheet);
if(!pStyleSheet) {
sheet = get_node_obj(stylesheet);
if(!sheet) {
FIXME("styleSheet is not our xmlnode implementation\n");
return E_FAIL;
}
xsltSS = pxsltParseStylesheetDoc( pStyleSheet->node->doc);
xsltSS = pxsltParseStylesheetDoc(sheet->node->doc);
if(xsltSS)
{
result = pxsltApplyStylesheet(xsltSS, This->node->doc, NULL);
xmlDocPtr result = pxsltApplyStylesheet(xsltSS, This->node->doc, NULL);
if(result)
{
const xmlChar *pContent;
const xmlChar *content;
if(result->type == XML_HTML_DOCUMENT_NODE)
{
xmlOutputBufferPtr pOutput = xmlAllocOutputBuffer(NULL);
if(pOutput)
xmlOutputBufferPtr output = xmlAllocOutputBuffer(NULL);
if (output)
{
htmlDocContentDumpOutput(pOutput, result->doc, NULL);
pContent = xmlBufferContent(pOutput->buffer);
*xmlString = bstr_from_xmlChar(pContent);
xmlOutputBufferClose(pOutput);
htmlDocContentDumpOutput(output, result->doc, NULL);
content = xmlBufferContent(output->buffer);
*p = bstr_from_xmlChar(content);
xmlOutputBufferClose(output);
}
}
else
{
xmlBufferPtr pXmlBuf;
int nSize;
pXmlBuf = xmlBufferCreate();
if(pXmlBuf)
xmlBufferPtr buf = xmlBufferCreate();
if (buf)
{
nSize = xmlNodeDump(pXmlBuf, NULL, (xmlNodePtr)result, 0, 0);
if(nSize > 0)
int size = xmlNodeDump(buf, NULL, (xmlNodePtr)result, 0, 0);
if(size > 0)
{
pContent = xmlBufferContent(pXmlBuf);
*xmlString = bstr_from_xmlChar(pContent);
content = xmlBufferContent(buf);
*p = bstr_from_xmlChar(content);
}
xmlBufferFree(pXmlBuf);
xmlBufferFree(buf);
}
}
xmlFreeDoc(result);
......@@ -1022,8 +1010,7 @@ static HRESULT WINAPI xmlnode_transformNode(
pxsltFreeStylesheet(xsltSS);
}
if(*xmlString == NULL)
*xmlString = SysAllocStringLen(NULL, 0);
if(!*p) *p = SysAllocStringLen(NULL, 0);
return S_OK;
#else
......@@ -1148,7 +1135,7 @@ static const struct IXMLDOMNodeVtbl xmlnode_vtbl =
NULL,
NULL,
NULL,
xmlnode_transformNode,
NULL,
NULL,
NULL
};
......@@ -1612,7 +1599,7 @@ static HRESULT WINAPI unknode_transformNode(
IXMLDOMNode* domNode, BSTR* p)
{
unknode *This = unknode_from_IXMLDOMNode( iface );
return IXMLDOMNode_transformNode( &This->node.IXMLDOMNode_iface, domNode, p );
return node_transform_node(&This->node, domNode, p);
}
static HRESULT WINAPI unknode_selectNodes(
......
......@@ -496,10 +496,11 @@ static HRESULT WINAPI dom_pi_get_xml(
static HRESULT WINAPI dom_pi_transformNode(
IXMLDOMProcessingInstruction *iface,
IXMLDOMNode* domNode, BSTR* p)
IXMLDOMNode *node, BSTR *p)
{
dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
return IXMLDOMNode_transformNode( &This->node.IXMLDOMNode_iface, domNode, p );
TRACE("(%p)->(%p %p)\n", This, node, p);
return node_transform_node(&This->node, node, p);
}
static HRESULT WINAPI dom_pi_selectNodes(
......
......@@ -566,10 +566,11 @@ static HRESULT WINAPI domtext_get_xml(
static HRESULT WINAPI domtext_transformNode(
IXMLDOMText *iface,
IXMLDOMNode* domNode, BSTR* p)
IXMLDOMNode *node, BSTR *p)
{
domtext *This = impl_from_IXMLDOMText( iface );
return IXMLDOMNode_transformNode( &This->node.IXMLDOMNode_iface, domNode, p );
TRACE("(%p)->(%p %p)\n", This, node, p);
return node_transform_node(&This->node, node, p);
}
static HRESULT WINAPI domtext_selectNodes(
......
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