Module: wine Branch: master Commit: 11331847ac51f9cb8ff1a656fe0cda5e046ffef9 URL: http://source.winehq.org/git/wine.git/?a=commit;h=11331847ac51f9cb8ff1a656fe...
Author: Alistair Leslie-Hughes leslie_alistair@hotmail.com Date: Fri Jan 4 09:15:28 2008 +1100
msxml3: Implement get_xml.
---
dlls/msxml3/node.c | 37 +++++++++++++++++++++++++++++++++++-- 1 files changed, 35 insertions(+), 2 deletions(-)
diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c index c0fd27c..8b17589 100644 --- a/dlls/msxml3/node.c +++ b/dlls/msxml3/node.c @@ -685,8 +685,41 @@ static HRESULT WINAPI xmlnode_get_xml( IXMLDOMNode *iface, BSTR* xmlString) { - FIXME("\n"); - return E_NOTIMPL; + xmlnode *This = impl_from_IXMLDOMNode( iface ); + xmlBufferPtr pXmlBuf; + int nSize; + + TRACE("iface %p\n", iface); + + if(!xmlString) + return E_INVALIDARG; + + *xmlString = NULL; + + pXmlBuf = xmlBufferCreate(); + if(pXmlBuf) + { + nSize = xmlNodeDump(pXmlBuf, This->node->doc, This->node, 0, 0); + if(nSize > 0) + { + const xmlChar *pContent; + + /* Attribute Nodes return a space infront of their name */ + pContent = xmlBufferContent(pXmlBuf); + if( ((char*)pContent)[0] == ' ') + *xmlString = bstr_from_xmlChar(pContent+1); + else + *xmlString = bstr_from_xmlChar(pContent); + + + xmlBufferFree(pXmlBuf); + } + } + + /* Always returns a string. */ + if(*xmlString == NULL) *xmlString = SysAllocStringLen( NULL, 0 ); + + return S_OK; }
static HRESULT WINAPI xmlnode_transformNode(