Author: cwittich
Date: Mon Mar 1 12:10:15 2010
New Revision: 45736
URL:
http://svn.reactos.org/svn/reactos?rev=45736&view=rev
Log:
[MSXML3]
sync msxml3 to wine 1.1.39
Modified:
trunk/reactos/dll/win32/msxml3/attribute.c
trunk/reactos/dll/win32/msxml3/cdata.c
trunk/reactos/dll/win32/msxml3/comment.c
trunk/reactos/dll/win32/msxml3/docfrag.c
trunk/reactos/dll/win32/msxml3/domdoc.c
trunk/reactos/dll/win32/msxml3/domimpl.c
trunk/reactos/dll/win32/msxml3/element.c
trunk/reactos/dll/win32/msxml3/entityref.c
trunk/reactos/dll/win32/msxml3/factory.c
trunk/reactos/dll/win32/msxml3/httprequest.c
trunk/reactos/dll/win32/msxml3/msxml_private.h
trunk/reactos/dll/win32/msxml3/node.c
trunk/reactos/dll/win32/msxml3/nodelist.c
trunk/reactos/dll/win32/msxml3/nodemap.c
trunk/reactos/dll/win32/msxml3/parseerror.c
trunk/reactos/dll/win32/msxml3/pi.c
trunk/reactos/dll/win32/msxml3/queryresult.c
trunk/reactos/dll/win32/msxml3/schema.c
trunk/reactos/dll/win32/msxml3/text.c
trunk/reactos/include/psdk/msxml2.idl
Modified: trunk/reactos/dll/win32/msxml3/attribute.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/attribute…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/attribute.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/attribute.c [iso-8859-1] Mon Mar 1 12:10:15 2010
@@ -55,7 +55,7 @@
void** ppvObject )
{
domattr *This = impl_from_IXMLDOMAttribute( iface );
- TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
if ( IsEqualGUID( riid, &IID_IXMLDOMAttribute ) ||
IsEqualGUID( riid, &IID_IDispatch ) ||
@@ -213,7 +213,10 @@
IXMLDOMNode** parent )
{
domattr *This = impl_from_IXMLDOMAttribute( iface );
- return IXMLDOMNode_get_parentNode( IXMLDOMNode_from_impl(&This->node), parent
);
+ TRACE("(%p)->(%p)\n", This, parent);
+ if (!parent) return E_INVALIDARG;
+ *parent = NULL;
+ return S_FALSE;
}
static HRESULT WINAPI domattr_get_childNodes(
Modified: trunk/reactos/dll/win32/msxml3/cdata.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/cdata.c?r…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/cdata.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/cdata.c [iso-8859-1] Mon Mar 1 12:10:15 2010
@@ -55,7 +55,7 @@
void** ppvObject )
{
domcdata *This = impl_from_IXMLDOMCDATASection( iface );
- TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
if ( IsEqualGUID( riid, &IID_IXMLDOMCDATASection ) ||
IsEqualGUID( riid, &IID_IXMLDOMCharacterData) ||
@@ -480,7 +480,7 @@
BSTR *p)
{
domcdata *This = impl_from_IXMLDOMCDATASection( iface );
- HRESULT hr = E_FAIL;
+ HRESULT hr;
VARIANT vRet;
if(!p)
@@ -500,17 +500,14 @@
BSTR data)
{
domcdata *This = impl_from_IXMLDOMCDATASection( iface );
- HRESULT hr = E_FAIL;
VARIANT val;
- TRACE("%p %s\n", This, debugstr_w(data) );
+ TRACE("(%p)->(%s)\n", This, debugstr_w(data) );
V_VT(&val) = VT_BSTR;
V_BSTR(&val) = data;
- hr = IXMLDOMNode_put_nodeValue( IXMLDOMNode_from_impl(&This->node), val );
-
- return hr;
+ return IXMLDOMNode_put_nodeValue( IXMLDOMNode_from_impl(&This->node), val );
}
static HRESULT WINAPI domcdata_get_length(
@@ -518,22 +515,20 @@
LONG *len)
{
domcdata *This = impl_from_IXMLDOMCDATASection( iface );
- xmlChar *pContent;
- LONG nLength = 0;
-
- TRACE("%p\n", iface);
+ HRESULT hr;
+ BSTR data;
+
+ TRACE("(%p)->(%p)\n", This, len);
if(!len)
return E_INVALIDARG;
- pContent = xmlNodeGetContent(This->node.node);
- if(pContent)
- {
- nLength = xmlStrlen(pContent);
- xmlFree(pContent);
- }
-
- *len = nLength;
+ hr = IXMLDOMCDATASection_get_data(iface, &data);
+ if(hr == S_OK)
+ {
+ *len = SysStringLen(data);
+ SysFreeString(data);
+ }
return S_OK;
}
@@ -543,11 +538,10 @@
LONG offset, LONG count, BSTR *p)
{
domcdata *This = impl_from_IXMLDOMCDATASection( iface );
- xmlChar *pContent;
- LONG nLength = 0;
- HRESULT hr = S_FALSE;
-
- TRACE("%p\n", iface);
+ HRESULT hr;
+ BSTR data;
+
+ TRACE("(%p)->(%d %d %p)\n", This, offset, count, p);
if(!p)
return E_INVALIDARG;
@@ -557,26 +551,24 @@
return E_INVALIDARG;
if(count == 0)
- return hr;
-
- pContent = xmlNodeGetContent(This->node.node);
- if(pContent)
- {
- nLength = xmlStrlen(pContent);
-
- if( offset < nLength)
+ return S_FALSE;
+
+ hr = IXMLDOMCDATASection_get_data(iface, &data);
+ if(hr == S_OK)
+ {
+ LONG len = SysStringLen(data);
+
+ if(offset < len)
{
- BSTR sContent = bstr_from_xmlChar(pContent);
- if(offset + count > nLength)
- *p = SysAllocString(&sContent[offset]);
+ if(offset + count > len)
+ *p = SysAllocString(&data[offset]);
else
- *p = SysAllocStringLen(&sContent[offset], count);
-
- SysFreeString(sContent);
- hr = S_OK;
+ *p = SysAllocStringLen(&data[offset], count);
}
-
- xmlFree(pContent);
+ else
+ hr = S_FALSE;
+
+ SysFreeString(data);
}
return hr;
@@ -587,94 +579,77 @@
BSTR p)
{
domcdata *This = impl_from_IXMLDOMCDATASection( iface );
- xmlChar *pContent;
- HRESULT hr = S_FALSE;
-
- TRACE("%p\n", iface);
+ HRESULT hr;
+ BSTR data;
+ LONG p_len;
+
+ TRACE("(%p)->(%s)\n", This, debugstr_w(p));
/* Nothing to do if NULL or an Empty string passed in. */
- if(p == NULL || SysStringLen(p) == 0)
+ if((p_len = SysStringLen(p)) == 0) return S_OK;
+
+ hr = IXMLDOMCDATASection_get_data(iface, &data);
+ if(hr == S_OK)
+ {
+ LONG len = SysStringLen(data);
+ BSTR str = SysAllocStringLen(NULL, p_len + len);
+
+ memcpy(str, data, len*sizeof(WCHAR));
+ memcpy(&str[len], p, p_len*sizeof(WCHAR));
+ str[len+p_len] = 0;
+
+ hr = IXMLDOMCDATASection_put_data(iface, str);
+
+ SysFreeString(str);
+ SysFreeString(data);
+ }
+
+ return hr;
+}
+
+static HRESULT WINAPI domcdata_insertData(
+ IXMLDOMCDATASection *iface,
+ LONG offset, BSTR p)
+{
+ domcdata *This = impl_from_IXMLDOMCDATASection( iface );
+ HRESULT hr;
+ BSTR data;
+ LONG p_len;
+
+ TRACE("(%p)->(%d %s)\n", This, offset, debugstr_w(p));
+
+ /* If have a NULL or empty string, don't do anything. */
+ if((p_len = SysStringLen(p)) == 0)
return S_OK;
- pContent = xmlChar_from_wchar( p );
- if(pContent)
- {
- if(xmlTextConcat(This->node.node, pContent, SysStringLen(p) ) == 0)
- hr = S_OK;
- else
- hr = E_FAIL;
- }
- else
- hr = E_FAIL;
- heap_free(pContent);
-
- return hr;
-}
-
-static HRESULT WINAPI domcdata_insertData(
- IXMLDOMCDATASection *iface,
- LONG offset, BSTR p)
-{
- domcdata *This = impl_from_IXMLDOMCDATASection( iface );
- xmlChar *pXmlContent;
- BSTR sNewString;
- HRESULT hr = S_FALSE;
- LONG nLength = 0, nLengthP = 0;
- xmlChar *str = NULL;
-
- TRACE("%p\n", This);
-
- /* If have a NULL or empty string, don't do anything. */
- if(SysStringLen(p) == 0)
- return S_OK;
-
if(offset < 0)
{
return E_INVALIDARG;
}
- pXmlContent = xmlNodeGetContent(This->node.node);
- if(pXmlContent)
- {
- BSTR sContent = bstr_from_xmlChar( pXmlContent );
- nLength = SysStringLen(sContent);
- nLengthP = SysStringLen(p);
-
- if(nLength < offset)
+ hr = IXMLDOMCDATASection_get_data(iface, &data);
+ if(hr == S_OK)
+ {
+ LONG len = SysStringLen(data);
+ BSTR str;
+
+ if(len < offset)
{
- SysFreeString(sContent);
- xmlFree(pXmlContent);
-
+ SysFreeString(data);
return E_INVALIDARG;
}
- sNewString = SysAllocStringLen(NULL, nLength + nLengthP + 1);
- if(sNewString)
- {
- if(offset > 0)
- memcpy(sNewString, sContent, offset * sizeof(WCHAR));
-
- memcpy(&sNewString[offset], p, nLengthP * sizeof(WCHAR));
-
- if(offset+nLengthP < nLength)
- memcpy(&sNewString[offset+nLengthP], &sContent[offset],
(nLength-offset) * sizeof(WCHAR));
-
- sNewString[nLengthP + nLength] = 0;
-
- str = xmlChar_from_wchar(sNewString);
- if(str)
- {
- xmlNodeSetContent(This->node.node, str);
- hr = S_OK;
- }
- heap_free(str);
-
- SysFreeString(sNewString);
- }
-
- SysFreeString(sContent);
-
- xmlFree(pXmlContent);
+ str = SysAllocStringLen(NULL, len + p_len);
+ /* start part, supplied string and end part */
+ memcpy(str, data, offset*sizeof(WCHAR));
+ memcpy(&str[offset], p, p_len*sizeof(WCHAR));
+ memcpy(&str[offset+p_len], &data[offset], (len-offset)*sizeof(WCHAR));
+ str[len+p_len] = 0;
+
+ hr = IXMLDOMCDATASection_put_data(iface, str);
+
+ SysFreeString(str);
+ SysFreeString(data);
}
return hr;
@@ -684,11 +659,12 @@
IXMLDOMCDATASection *iface,
LONG offset, LONG count)
{
+ domcdata *This = impl_from_IXMLDOMCDATASection( iface );
HRESULT hr;
LONG len = -1;
BSTR str;
- TRACE("%p %d %d\n", iface, offset, count);
+ TRACE("(%p)->(%d %d)\n", This, offset, count);
hr = IXMLDOMCDATASection_get_length(iface, &len);
if(hr != S_OK) return hr;
@@ -731,15 +707,25 @@
IXMLDOMCDATASection *iface,
LONG offset, LONG count, BSTR p)
{
- FIXME("\n");
- return E_NOTIMPL;
+ domcdata *This = impl_from_IXMLDOMCDATASection( iface );
+ HRESULT hr;
+
+ TRACE("(%p)->(%d %d %s)\n", This, offset, count, debugstr_w(p));
+
+ hr = IXMLDOMCDATASection_deleteData(iface, offset, count);
+
+ if (hr == S_OK)
+ hr = IXMLDOMCDATASection_insertData(iface, offset, p);
+
+ return hr;
}
static HRESULT WINAPI domcdata_splitText(
IXMLDOMCDATASection *iface,
LONG offset, IXMLDOMText **txtNode)
{
- FIXME("\n");
+ domcdata *This = impl_from_IXMLDOMCDATASection( iface );
+ FIXME("(%p)->(%d %p)\n", This, offset, txtNode);
return E_NOTIMPL;
}
Modified: trunk/reactos/dll/win32/msxml3/comment.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/comment.c…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/comment.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/comment.c [iso-8859-1] Mon Mar 1 12:10:15 2010
@@ -55,7 +55,7 @@
void** ppvObject )
{
domcomment *This = impl_from_IXMLDOMComment( iface );
- TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
if ( IsEqualGUID( riid, &IID_IXMLDOMComment ) ||
IsEqualGUID( riid, &IID_IXMLDOMCharacterData) ||
@@ -474,8 +474,10 @@
BSTR *p)
{
domcomment *This = impl_from_IXMLDOMComment( iface );
- HRESULT hr = E_FAIL;
+ HRESULT hr;
VARIANT vRet;
+
+ TRACE("(%p)->(%p)\n", This, p);
if(!p)
return E_INVALIDARG;
@@ -494,17 +496,14 @@
BSTR data)
{
domcomment *This = impl_from_IXMLDOMComment( iface );
- HRESULT hr = E_FAIL;
VARIANT val;
- TRACE("%p %s\n", This, debugstr_w(data) );
+ TRACE("(%p)->(%s)\n", This, debugstr_w(data) );
V_VT(&val) = VT_BSTR;
V_BSTR(&val) = data;
- hr = IXMLDOMNode_put_nodeValue( IXMLDOMNode_from_impl(&This->node), val );
-
- return hr;
+ return IXMLDOMNode_put_nodeValue( IXMLDOMNode_from_impl(&This->node), val );
}
static HRESULT WINAPI domcomment_get_length(
@@ -512,24 +511,22 @@
LONG *len)
{
domcomment *This = impl_from_IXMLDOMComment( iface );
- xmlChar *pContent;
- LONG nLength = 0;
-
- TRACE("%p\n", iface);
+ HRESULT hr;
+ BSTR data;
+
+ TRACE("(%p)->(%p)\n", This, len);
if(!len)
return E_INVALIDARG;
- pContent = xmlNodeGetContent(This->node.node);
- if(pContent)
- {
- nLength = xmlStrlen(pContent);
- xmlFree(pContent);
- }
-
- *len = nLength;
-
- return S_OK;
+ hr = IXMLDOMComment_get_data(iface, &data);
+ if(hr == S_OK)
+ {
+ *len = SysStringLen(data);
+ SysFreeString(data);
+ }
+
+ return hr;
}
static HRESULT WINAPI domcomment_substringData(
@@ -537,11 +534,10 @@
LONG offset, LONG count, BSTR *p)
{
domcomment *This = impl_from_IXMLDOMComment( iface );
- xmlChar *pContent;
- LONG nLength = 0;
- HRESULT hr = S_FALSE;
-
- TRACE("%p %d %d %p\n", iface, offset, count, p);
+ HRESULT hr;
+ BSTR data;
+
+ TRACE("(%p)->(%d %d %p)\n", This, offset, count, p);
if(!p)
return E_INVALIDARG;
@@ -553,24 +549,22 @@
if(count == 0)
return S_FALSE;
- pContent = xmlNodeGetContent(This->node.node);
- if(pContent)
- {
- nLength = xmlStrlen(pContent);
-
- if( offset < nLength)
+ hr = IXMLDOMComment_get_data(iface, &data);
+ if(hr == S_OK)
+ {
+ LONG len = SysStringLen(data);
+
+ if(offset < len)
{
- BSTR sContent = bstr_from_xmlChar(pContent);
- if(offset + count > nLength)
- *p = SysAllocString(&sContent[offset]);
+ if(offset + count > len)
+ *p = SysAllocString(&data[offset]);
else
- *p = SysAllocStringLen(&sContent[offset], count);
-
- SysFreeString(sContent);
- hr = S_OK;
+ *p = SysAllocStringLen(&data[offset], count);
}
-
- xmlFree(pContent);
+ else
+ hr = S_FALSE;
+
+ SysFreeString(data);
}
return hr;
@@ -581,108 +575,77 @@
BSTR p)
{
domcomment *This = impl_from_IXMLDOMComment( iface );
- xmlChar *pContent;
- HRESULT hr = S_FALSE;
-
- TRACE("%p\n", iface);
+ HRESULT hr;
+ BSTR data;
+ LONG p_len;
+
+ TRACE("(%p)->(%s)\n", This, debugstr_w(p));
/* Nothing to do if NULL or an Empty string passed in. */
- if(p == NULL || SysStringLen(p) == 0)
+ if((p_len = SysStringLen(p)) == 0) return S_OK;
+
+ hr = IXMLDOMComment_get_data(iface, &data);
+ if(hr == S_OK)
+ {
+ LONG len = SysStringLen(data);
+ BSTR str = SysAllocStringLen(NULL, p_len + len);
+
+ memcpy(str, data, len*sizeof(WCHAR));
+ memcpy(&str[len], p, p_len*sizeof(WCHAR));
+ str[len+p_len] = 0;
+
+ hr = IXMLDOMComment_put_data(iface, str);
+
+ SysFreeString(str);
+ SysFreeString(data);
+ }
+
+ return hr;
+}
+
+static HRESULT WINAPI domcomment_insertData(
+ IXMLDOMComment *iface,
+ LONG offset, BSTR p)
+{
+ domcomment *This = impl_from_IXMLDOMComment( iface );
+ HRESULT hr;
+ BSTR data;
+ LONG p_len;
+
+ TRACE("(%p)->(%d %s)\n", This, offset, debugstr_w(p));
+
+ /* If have a NULL or empty string, don't do anything. */
+ if((p_len = SysStringLen(p)) == 0)
return S_OK;
- pContent = xmlChar_from_wchar( p );
- if(pContent)
- {
- /* Older versions of libxml < 2.6.27 didn't correctly support
- xmlTextConcat on Comment nodes. Fallback to setting the
- contents directly if xmlTextConcat fails.
- */
- if(xmlTextConcat(This->node.node, pContent, SysStringLen(p) ) == 0)
- hr = S_OK;
- else
+ if(offset < 0)
+ {
+ return E_INVALIDARG;
+ }
+
+ hr = IXMLDOMComment_get_data(iface, &data);
+ if(hr == S_OK)
+ {
+ LONG len = SysStringLen(data);
+ BSTR str;
+
+ if(len < offset)
{
- xmlChar *pNew;
- pNew = xmlStrcat(xmlNodeGetContent(This->node.node), pContent);
- if(pNew)
- {
- xmlNodeSetContent(This->node.node, pNew);
- hr = S_OK;
- }
- else
- hr = E_FAIL;
- }
- HeapFree( GetProcessHeap(), 0, pContent );
- }
- else
- hr = E_FAIL;
-
- return hr;
-}
-
-static HRESULT WINAPI domcomment_insertData(
- IXMLDOMComment *iface,
- LONG offset, BSTR p)
-{
- domcomment *This = impl_from_IXMLDOMComment( iface );
- xmlChar *pXmlContent;
- BSTR sNewString;
- HRESULT hr = S_FALSE;
- LONG nLength = 0, nLengthP = 0;
- xmlChar *str = NULL;
-
- TRACE("%p %d %p\n", iface, offset, p);
-
- /* If have a NULL or empty string, don't do anything. */
- if(SysStringLen(p) == 0)
- return S_OK;
-
- if(offset < 0)
- {
- return E_INVALIDARG;
- }
-
- pXmlContent = xmlNodeGetContent(This->node.node);
- if(pXmlContent)
- {
- BSTR sContent = bstr_from_xmlChar( pXmlContent );
- nLength = SysStringLen(sContent);
- nLengthP = SysStringLen(p);
-
- if(nLength < offset)
- {
- SysFreeString(sContent);
- xmlFree(pXmlContent);
-
+ SysFreeString(data);
return E_INVALIDARG;
}
- sNewString = SysAllocStringLen(NULL, nLength + nLengthP + 1);
- if(sNewString)
- {
- if(offset > 0)
- memcpy(sNewString, sContent, offset * sizeof(WCHAR));
-
- memcpy(&sNewString[offset], p, nLengthP * sizeof(WCHAR));
-
- if(offset+nLengthP < nLength)
- memcpy(&sNewString[offset+nLengthP], &sContent[offset],
(nLength-offset) * sizeof(WCHAR));
-
- sNewString[nLengthP + nLength] = 0;
-
- str = xmlChar_from_wchar(sNewString);
- if(str)
- {
- xmlNodeSetContent(This->node.node, str);
- hr = S_OK;
- }
- HeapFree( GetProcessHeap(), 0, str );
-
- SysFreeString(sNewString);
- }
-
- SysFreeString(sContent);
-
- xmlFree(pXmlContent);
+ str = SysAllocStringLen(NULL, len + p_len);
+ /* start part, supplied string and end part */
+ memcpy(str, data, offset*sizeof(WCHAR));
+ memcpy(&str[offset], p, p_len*sizeof(WCHAR));
+ memcpy(&str[offset+p_len], &data[offset], (len-offset)*sizeof(WCHAR));
+ str[len+p_len] = 0;
+
+ hr = IXMLDOMComment_put_data(iface, str);
+
+ SysFreeString(str);
+ SysFreeString(data);
}
return hr;
@@ -696,7 +659,7 @@
LONG len = -1;
BSTR str;
- TRACE("%p %d %d\n", iface, offset, count);
+ TRACE("(%p)->(%d %d)\n", iface, offset, count);
hr = IXMLDOMComment_get_length(iface, &len);
if(hr != S_OK) return hr;
@@ -739,8 +702,17 @@
IXMLDOMComment *iface,
LONG offset, LONG count, BSTR p)
{
- FIXME("\n");
- return E_NOTIMPL;
+ domcomment *This = impl_from_IXMLDOMComment( iface );
+ HRESULT hr;
+
+ TRACE("(%p)->(%d %d %s)\n", This, offset, count, debugstr_w(p));
+
+ hr = IXMLDOMComment_deleteData(iface, offset, count);
+
+ if (hr == S_OK)
+ hr = IXMLDOMComment_insertData(iface, offset, p);
+
+ return hr;
}
static const struct IXMLDOMCommentVtbl domcomment_vtbl =
Modified: trunk/reactos/dll/win32/msxml3/docfrag.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/docfrag.c…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/docfrag.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/docfrag.c [iso-8859-1] Mon Mar 1 12:10:15 2010
@@ -55,7 +55,7 @@
void** ppvObject )
{
domfrag *This = impl_from_IXMLDOMDocumentFragment( iface );
- TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
if ( IsEqualGUID( riid, &IID_IXMLDOMDocumentFragment ) ||
IsEqualGUID( riid, &IID_IDispatch ) ||
Modified: trunk/reactos/dll/win32/msxml3/domdoc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/domdoc.c?…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/domdoc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/domdoc.c [iso-8859-1] Mon Mar 1 12:10:15 2010
@@ -47,6 +47,17 @@
#ifdef HAVE_LIBXML2
+#include <libxml/xmlsave.h>
+
+/* not defined in older versions */
+#define XML_SAVE_FORMAT 1
+#define XML_SAVE_NO_DECL 2
+#define XML_SAVE_NO_EMPTY 4
+#define XML_SAVE_NO_XHTML 8
+#define XML_SAVE_XHTML 16
+#define XML_SAVE_AS_XML 32
+#define XML_SAVE_AS_HTML 64
+
static const WCHAR SZ_PROPERTY_SELECTION_LANGUAGE[] =
{'S','e','l','e','c','t','i','o','n','L','a','n','g','u','a','g','e',0};
static const WCHAR SZ_VALUE_XPATH[] =
{'X','P','a','t','h',0};
static const WCHAR SZ_VALUE_XSLPATTERN[] =
{'X','S','L','P','a','t','t','e','r','n',0};
@@ -290,7 +301,7 @@
{
domdoc *This = impl_from_IPersistStream(iface);
- FIXME("(%p->%p): stub!\n", iface, This);
+ FIXME("(%p): stub!\n", This);
return S_FALSE;
}
@@ -306,7 +317,7 @@
char *ptr;
xmlDocPtr xmldoc = NULL;
- TRACE("(%p, %p)\n", iface, pStm);
+ TRACE("(%p)->(%p)\n", This, pStm);
if (!pStm)
return E_INVALIDARG;
@@ -355,7 +366,7 @@
HRESULT hr;
BSTR xmlString;
- TRACE("(%p, %p, %d)\n", iface, pStm, fClearDirty);
+ TRACE("(%p)->(%p %d)\n", This, pStm, fClearDirty);
hr = IXMLDOMNode_get_xml( IXMLDOMNode_from_impl(&This->node), &xmlString
);
if(hr == S_OK)
@@ -376,7 +387,8 @@
static HRESULT WINAPI xmldoc_IPersistStream_GetSizeMax(
IPersistStream *iface, ULARGE_INTEGER *pcbSize)
{
- TRACE("(%p, %p): stub!\n", iface, pcbSize);
+ domdoc *This = impl_from_IPersistStream(iface);
+ TRACE("(%p)->(%p): stub!\n", This, pcbSize);
return E_NOTIMPL;
}
@@ -436,7 +448,7 @@
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid( riid ), ppvObject );
*ppvObject = NULL;
@@ -458,6 +470,10 @@
else if (IsEqualGUID(&IID_IObjectWithSite, riid))
{
*ppvObject = &(This->lpvtblIObjectWithSite);
+ }
+ else if (IsEqualGUID(&IID_IObjectSafety, riid))
+ {
+ *ppvObject = &(This->lpvtblIObjectSafety);
}
else if( IsEqualGUID( riid, &IID_ISupportErrorInfo ))
{
@@ -940,7 +956,8 @@
IXMLDOMDocument2 *iface,
IXMLDOMDocumentType** documentType )
{
- FIXME("\n");
+ domdoc *This = impl_from_IXMLDOMDocument2(iface);
+ FIXME("(%p)\n", This);
return E_NOTIMPL;
}
@@ -949,6 +966,10 @@
IXMLDOMDocument2 *iface,
IXMLDOMImplementation** impl )
{
+ domdoc *This = impl_from_IXMLDOMDocument2(iface);
+
+ TRACE("(%p)->(%p)\n", This, impl);
+
if(!impl)
return E_INVALIDARG;
@@ -967,7 +988,7 @@
IXMLDOMNode *element_node;
HRESULT hr;
- TRACE("%p\n", This);
+ TRACE("(%p)->(%p)\n", This, DOMElement);
if(!DOMElement)
return E_INVALIDARG;
@@ -1027,52 +1048,55 @@
BSTR tagname,
IXMLDOMElement** element )
{
- xmlNodePtr xmlnode;
- domdoc *This = impl_from_IXMLDOMDocument2( iface );
- xmlChar *xml_name;
- IUnknown *elem_unk;
+ domdoc *This = impl_from_IXMLDOMDocument2( iface );
+ IXMLDOMNode *node;
+ VARIANT type;
HRESULT hr;
- TRACE("%p->(%s,%p)\n", iface, debugstr_w(tagname), element);
-
- xml_name = xmlChar_from_wchar(tagname);
- xmlnode = xmlNewDocNode(get_doc(This), NULL, xml_name, NULL);
- xmldoc_add_orphan(xmlnode->doc, xmlnode);
-
- TRACE("created xmlptr %p\n", xmlnode);
- elem_unk = create_element(xmlnode);
- heap_free(xml_name);
-
- hr = IUnknown_QueryInterface(elem_unk, &IID_IXMLDOMElement, (void **)element);
- IUnknown_Release(elem_unk);
- TRACE("returning %p\n", *element);
+ TRACE("(%p)->(%s %p)\n", This, debugstr_w(tagname), element);
+
+ if (!element || !tagname) return E_INVALIDARG;
+
+ V_VT(&type) = VT_I1;
+ V_I1(&type) = NODE_ELEMENT;
+
+ hr = IXMLDOMDocument_createNode(iface, type, tagname, NULL, &node);
+ if (hr == S_OK)
+ {
+ IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMElement, (void**)element);
+ IXMLDOMNode_Release(node);
+ }
+
return hr;
}
static HRESULT WINAPI domdoc_createDocumentFragment(
IXMLDOMDocument2 *iface,
- IXMLDOMDocumentFragment** docFrag )
-{
- domdoc *This = impl_from_IXMLDOMDocument2( iface );
- xmlNodePtr xmlnode;
-
- TRACE("%p\n", iface);
-
- if(!docFrag)
- return E_INVALIDARG;
-
- *docFrag = NULL;
-
- xmlnode = xmlNewDocFragment(get_doc( This ) );
-
- if(!xmlnode)
- return E_FAIL;
-
- xmldoc_add_orphan(xmlnode->doc, xmlnode);
- *docFrag = (IXMLDOMDocumentFragment*)create_doc_fragment(xmlnode);
-
- return S_OK;
+ IXMLDOMDocumentFragment** frag )
+{
+ domdoc *This = impl_from_IXMLDOMDocument2( iface );
+ IXMLDOMNode *node;
+ VARIANT type;
+ HRESULT hr;
+
+ TRACE("(%p)->(%p)\n", This, frag);
+
+ if (!frag) return E_INVALIDARG;
+
+ *frag = NULL;
+
+ V_VT(&type) = VT_I1;
+ V_I1(&type) = NODE_DOCUMENT_FRAGMENT;
+
+ hr = IXMLDOMDocument_createNode(iface, type, NULL, NULL, &node);
+ if (hr == S_OK)
+ {
+ IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMDocumentFragment,
(void**)frag);
+ IXMLDOMNode_Release(node);
+ }
+
+ return hr;
}
@@ -1082,29 +1106,28 @@
IXMLDOMText** text )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- xmlNodePtr xmlnode;
- xmlChar *xml_content;
-
- TRACE("%p->(%s %p)\n", iface, debugstr_w(data), text);
-
- if(!text)
- return E_INVALIDARG;
+ IXMLDOMNode *node;
+ VARIANT type;
+ HRESULT hr;
+
+ TRACE("(%p)->(%s %p)\n", This, debugstr_w(data), text);
+
+ if (!text) return E_INVALIDARG;
*text = NULL;
- xml_content = xmlChar_from_wchar(data);
- xmlnode = xmlNewText(xml_content);
- heap_free(xml_content);
-
- if(!xmlnode)
- return E_FAIL;
-
- xmlnode->doc = get_doc( This );
- xmldoc_add_orphan(xmlnode->doc, xmlnode);
-
- *text = (IXMLDOMText*)create_text(xmlnode);
-
- return S_OK;
+ V_VT(&type) = VT_I1;
+ V_I1(&type) = NODE_TEXT;
+
+ hr = IXMLDOMDocument2_createNode(iface, type, NULL, NULL, &node);
+ if (hr == S_OK)
+ {
+ IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMText, (void**)text);
+ IXMLDOMNode_Release(node);
+ hr = IXMLDOMText_put_data(*text, data);
+ }
+
+ return hr;
}
@@ -1114,29 +1137,28 @@
IXMLDOMComment** comment )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- xmlNodePtr xmlnode;
- xmlChar *xml_content;
-
- TRACE("%p->(%s %p)\n", iface, debugstr_w(data), comment);
-
- if(!comment)
- return E_INVALIDARG;
+ VARIANT type;
+ HRESULT hr;
+ IXMLDOMNode *node;
+
+ TRACE("(%p)->(%s %p)\n", This, debugstr_w(data), comment);
+
+ if (!comment) return E_INVALIDARG;
*comment = NULL;
- xml_content = xmlChar_from_wchar(data);
- xmlnode = xmlNewComment(xml_content);
- heap_free(xml_content);
-
- if(!xmlnode)
- return E_FAIL;
-
- xmlnode->doc = get_doc( This );
- xmldoc_add_orphan(xmlnode->doc, xmlnode);
-
- *comment = (IXMLDOMComment*)create_comment(xmlnode);
-
- return S_OK;
+ V_VT(&type) = VT_I1;
+ V_I1(&type) = NODE_COMMENT;
+
+ hr = IXMLDOMDocument2_createNode(iface, type, NULL, NULL, &node);
+ if (hr == S_OK)
+ {
+ IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMComment, (void**)comment);
+ IXMLDOMNode_Release(node);
+ hr = IXMLDOMComment_put_data(*comment, data);
+ }
+
+ return hr;
}
@@ -1146,29 +1168,28 @@
IXMLDOMCDATASection** cdata )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- xmlNodePtr xmlnode;
- xmlChar *xml_content;
-
- TRACE("%p->(%s %p)\n", iface, debugstr_w(data), cdata);
-
- if(!cdata)
- return E_INVALIDARG;
+ IXMLDOMNode *node;
+ VARIANT type;
+ HRESULT hr;
+
+ TRACE("(%p)->(%s %p)\n", This, debugstr_w(data), cdata);
+
+ if (!cdata) return E_INVALIDARG;
*cdata = NULL;
- xml_content = xmlChar_from_wchar(data);
- xmlnode = xmlNewCDataBlock(get_doc( This ), xml_content, strlen( (char*)xml_content)
);
- heap_free(xml_content);
-
- if(!xmlnode)
- return E_FAIL;
-
- xmlnode->doc = get_doc( This );
- xmldoc_add_orphan(xmlnode->doc, xmlnode);
-
- *cdata = (IXMLDOMCDATASection*)create_cdata(xmlnode);
-
- return S_OK;
+ V_VT(&type) = VT_I1;
+ V_I1(&type) = NODE_CDATA_SECTION;
+
+ hr = IXMLDOMDocument2_createNode(iface, type, NULL, NULL, &node);
+ if (hr == S_OK)
+ {
+ IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMCDATASection, (void**)cdata);
+ IXMLDOMNode_Release(node);
+ hr = IXMLDOMCDATASection_put_data(*cdata, data);
+ }
+
+ return hr;
}
@@ -1178,35 +1199,36 @@
BSTR data,
IXMLDOMProcessingInstruction** pi )
{
-#ifdef HAVE_XMLNEWDOCPI
- xmlNodePtr xmlnode;
- domdoc *This = impl_from_IXMLDOMDocument2( iface );
- xmlChar *xml_target, *xml_content;
-
- TRACE("%p->(%s %s %p)\n", iface, debugstr_w(target), debugstr_w(data),
pi);
-
- if(!pi)
- return E_INVALIDARG;
-
- if(!target || lstrlenW(target) == 0)
- return E_FAIL;
-
- xml_target = xmlChar_from_wchar(target);
- xml_content = xmlChar_from_wchar(data);
-
- xmlnode = xmlNewDocPI(get_doc(This), xml_target, xml_content);
- xmldoc_add_orphan(xmlnode->doc, xmlnode);
- TRACE("created xmlptr %p\n", xmlnode);
- *pi = (IXMLDOMProcessingInstruction*)create_pi(xmlnode);
-
- heap_free(xml_content);
- heap_free(xml_target);
-
- return S_OK;
-#else
- FIXME("Libxml 2.6.15 or greater required.\n");
- return E_NOTIMPL;
-#endif
+ domdoc *This = impl_from_IXMLDOMDocument2( iface );
+ IXMLDOMNode *node;
+ VARIANT type;
+ HRESULT hr;
+
+ TRACE("(%p)->(%s %s %p)\n", This, debugstr_w(target), debugstr_w(data),
pi);
+
+ if (!pi) return E_INVALIDARG;
+
+ *pi = NULL;
+
+ V_VT(&type) = VT_I1;
+ V_I1(&type) = NODE_PROCESSING_INSTRUCTION;
+
+ hr = IXMLDOMDocument2_createNode(iface, type, target, NULL, &node);
+ if (hr == S_OK)
+ {
+ VARIANT v_data;
+
+ /* this is to bypass check in ::put_data() that blocks "<?xml" PIs
*/
+ V_VT(&v_data) = VT_BSTR;
+ V_BSTR(&v_data) = data;
+
+ hr = IXMLDOMNode_put_nodeValue( node, v_data );
+
+ IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMProcessingInstruction,
(void**)pi);
+ IXMLDOMNode_Release(node);
+ }
+
+ return hr;
}
@@ -1216,61 +1238,55 @@
IXMLDOMAttribute** attribute )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- xmlNodePtr xmlnode;
- xmlChar *xml_name;
-
- TRACE("%p->(%s %p)\n", iface, debugstr_w(name), attribute);
-
- if(!attribute)
- return E_INVALIDARG;
-
- *attribute = NULL;
-
- xml_name = xmlChar_from_wchar(name);
- xmlnode = (xmlNode *)xmlNewProp(NULL, xml_name, NULL);
- heap_free(xml_name);
-
- if(!xmlnode)
- return E_FAIL;
-
- xmlnode->doc = get_doc( This );
- xmldoc_add_orphan(xmlnode->doc, xmlnode);
-
- *attribute = (IXMLDOMAttribute*)create_attribute(xmlnode);
-
- return S_OK;
+ IXMLDOMNode *node;
+ VARIANT type;
+ HRESULT hr;
+
+ TRACE("(%p)->(%s %p)\n", This, debugstr_w(name), attribute);
+
+ if (!attribute || !name) return E_INVALIDARG;
+
+ V_VT(&type) = VT_I1;
+ V_I1(&type) = NODE_ATTRIBUTE;
+
+ hr = IXMLDOMDocument_createNode(iface, type, name, NULL, &node);
+ if (hr == S_OK)
+ {
+ IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMAttribute, (void**)attribute);
+ IXMLDOMNode_Release(node);
+ }
+
+ return hr;
}
static HRESULT WINAPI domdoc_createEntityReference(
IXMLDOMDocument2 *iface,
BSTR name,
- IXMLDOMEntityReference** entityRef )
-{
- domdoc *This = impl_from_IXMLDOMDocument2( iface );
- xmlNodePtr xmlnode;
- xmlChar *xml_name;
-
- TRACE("%p\n", iface);
-
- if(!entityRef)
- return E_INVALIDARG;
-
- *entityRef = NULL;
-
- xml_name = xmlChar_from_wchar(name);
- xmlnode = xmlNewReference(get_doc( This ), xml_name );
- heap_free(xml_name);
-
- if(!xmlnode)
- return E_FAIL;
-
- xmlnode->doc = get_doc( This );
- xmldoc_add_orphan(xmlnode->doc, xmlnode);
-
- *entityRef = (IXMLDOMEntityReference*)create_doc_entity_ref(xmlnode);
-
- return S_OK;
+ IXMLDOMEntityReference** entityref )
+{
+ domdoc *This = impl_from_IXMLDOMDocument2( iface );
+ IXMLDOMNode *node;
+ VARIANT type;
+ HRESULT hr;
+
+ TRACE("(%p)->(%s %p)\n", This, debugstr_w(name), entityref);
+
+ if (!entityref) return E_INVALIDARG;
+
+ *entityref = NULL;
+
+ V_VT(&type) = VT_I1;
+ V_I1(&type) = NODE_ENTITY_REFERENCE;
+
+ hr = IXMLDOMDocument2_createNode(iface, type, name, NULL, &node);
+ if (hr == S_OK)
+ {
+ IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMEntityReference,
(void**)entityref);
+ IXMLDOMNode_Release(node);
+ }
+
+ return hr;
}
@@ -1284,7 +1300,7 @@
domdoc *This = impl_from_IXMLDOMDocument2( iface );
LPWSTR szPattern;
HRESULT hr;
- TRACE("(%p)->(%s, %p)\n", This, debugstr_w(tagName), resultList);
+ TRACE("(%p)->(%s %p)\n", This, debugstr_w(tagName), resultList);
if (tagName[0] == '*' && tagName[1] == 0)
{
@@ -1329,20 +1345,33 @@
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
DOMNodeType node_type;
- xmlNodePtr xmlnode = NULL;
+ xmlNodePtr xmlnode;
xmlChar *xml_name;
HRESULT hr;
- TRACE("(%p)->(type,%s,%s,%p)\n", This, debugstr_w(name),
debugstr_w(namespaceURI), node);
+ TRACE("(%p)->(%s %s %p)\n", This, debugstr_w(name),
debugstr_w(namespaceURI), node);
+
+ if(!node) return E_INVALIDARG;
if(namespaceURI && namespaceURI[0])
FIXME("nodes with namespaces currently not supported.\n");
hr = get_node_type(Type, &node_type);
- if(FAILED(hr))
- return hr;
+ if(FAILED(hr)) return hr;
TRACE("node_type %d\n", node_type);
+
+ /* exit earlier for types that need name */
+ switch(node_type)
+ {
+ case NODE_ELEMENT:
+ case NODE_ATTRIBUTE:
+ case NODE_ENTITY_REFERENCE:
+ case NODE_PROCESSING_INSTRUCTION:
+ if (!name || SysStringLen(name) == 0) return E_FAIL;
+ default:
+ break;
+ }
xml_name = xmlChar_from_wchar(name);
@@ -1350,30 +1379,52 @@
{
case NODE_ELEMENT:
xmlnode = xmlNewDocNode(get_doc(This), NULL, xml_name, NULL);
- *node = create_node(xmlnode);
- TRACE("created %p\n", xmlnode);
break;
case NODE_ATTRIBUTE:
- xmlnode = (xmlNode *)xmlNewProp(NULL, xml_name, NULL);
- if(xmlnode)
- {
- xmlnode->doc = get_doc( This );
-
- *node = (IXMLDOMNode*)create_attribute(xmlnode);
- }
-
- TRACE("created %p\n", xmlnode);
+ xmlnode = (xmlNodePtr)xmlNewDocProp(get_doc(This), xml_name, NULL);
break;
-
+ case NODE_TEXT:
+ xmlnode = (xmlNodePtr)xmlNewDocText(get_doc(This), NULL);
+ break;
+ case NODE_CDATA_SECTION:
+ xmlnode = xmlNewCDataBlock(get_doc(This), NULL, 0);
+ break;
+ case NODE_ENTITY_REFERENCE:
+ xmlnode = xmlNewReference(get_doc(This), xml_name);
+ break;
+ case NODE_PROCESSING_INSTRUCTION:
+#ifdef HAVE_XMLNEWDOCPI
+ xmlnode = xmlNewDocPI(get_doc(This), xml_name, NULL);
+#else
+ FIXME("xmlNewDocPI() not supported, use libxml2 2.6.15 or greater\n");
+ xmlnode = NULL;
+#endif
+ break;
+ case NODE_COMMENT:
+ xmlnode = xmlNewDocComment(get_doc(This), NULL);
+ break;
+ case NODE_DOCUMENT_FRAGMENT:
+ xmlnode = xmlNewDocFragment(get_doc(This));
+ break;
+ /* unsupported types */
+ case NODE_DOCUMENT:
+ case NODE_DOCUMENT_TYPE:
+ case NODE_ENTITY:
+ case NODE_NOTATION:
+ heap_free(xml_name);
+ return E_INVALIDARG;
default:
FIXME("unhandled node type %d\n", node_type);
+ xmlnode = NULL;
break;
}
+ *node = create_node(xmlnode);
heap_free(xml_name);
- if(xmlnode && *node)
- {
+ if(*node)
+ {
+ TRACE("created node (%d, %p, %p)\n", node_type, *node, xmlnode);
xmldoc_add_orphan(xmlnode->doc, xmlnode);
return S_OK;
}
@@ -1386,7 +1437,8 @@
BSTR idString,
IXMLDOMNode** node )
{
- FIXME("\n");
+ domdoc *This = impl_from_IXMLDOMDocument2(iface);
+ FIXME("(%p)->(%s %p)\n", This, debugstr_w(idString), node);
return E_NOTIMPL;
}
@@ -1432,7 +1484,7 @@
IStream *pStream = NULL;
xmlDocPtr xmldoc;
- TRACE("type %d\n", V_VT(&xmlSource) );
+ TRACE("(%p)->type %d\n", This, V_VT(&xmlSource) );
*isSuccessful = VARIANT_FALSE;
@@ -1528,7 +1580,8 @@
IXMLDOMDocument2 *iface,
LONG *value )
{
- FIXME("\n");
+ domdoc *This = impl_from_IXMLDOMDocument2(iface);
+ FIXME("(%p)->(%p)\n", This, value);
return E_NOTIMPL;
}
@@ -1556,7 +1609,8 @@
IXMLDOMDocument2 *iface,
BSTR* urlString )
{
- FIXME("\n");
+ domdoc *This = impl_from_IXMLDOMDocument2(iface);
+ FIXME("(%p)->(%p)\n", This, urlString);
return E_NOTIMPL;
}
@@ -1567,7 +1621,7 @@
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- TRACE("%p <- %d\n", isAsync, This->async);
+ TRACE("(%p)->(%p: %d)\n", This, isAsync, This->async);
*isAsync = This->async;
return S_OK;
}
@@ -1579,7 +1633,7 @@
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- TRACE("%d\n", isAsync);
+ TRACE("(%p)->(%d)\n", This, isAsync);
This->async = isAsync;
return S_OK;
}
@@ -1588,7 +1642,8 @@
static HRESULT WINAPI domdoc_abort(
IXMLDOMDocument2 *iface )
{
- FIXME("\n");
+ domdoc *This = impl_from_IXMLDOMDocument2(iface);
+ FIXME("%p\n", This);
return E_NOTIMPL;
}
@@ -1619,7 +1674,7 @@
int len;
HRESULT hr = S_FALSE, hr2;
- TRACE("%p %s %p\n", This, debugstr_w( bstrXML ), isSuccessful );
+ TRACE("(%p)->(%s %p)\n", This, debugstr_w( bstrXML ), isSuccessful );
assert ( &This->node );
@@ -1651,6 +1706,24 @@
return hr;
}
+static int XMLCALL domdoc_save_writecallback(void *ctx, const char *buffer,
+ int len)
+{
+ DWORD written = -1;
+
+ if(!WriteFile(ctx, buffer, len, &written, NULL))
+ {
+ WARN("write error\n");
+ return -1;
+ }
+ else
+ return written;
+}
+
+static int XMLCALL domdoc_save_closecallback(void *ctx)
+{
+ return CloseHandle(ctx) ? 0 : -1;
+}
static HRESULT WINAPI domdoc_save(
IXMLDOMDocument2 *iface,
@@ -1658,10 +1731,8 @@
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
HANDLE handle;
- xmlChar *mem, *p;
- int size;
+ xmlSaveCtxtPtr ctx;
HRESULT ret = S_OK;
- DWORD written;
TRACE("(%p)->(var(vt %d, %s))\n", This, V_VT(&destination),
V_VT(&destination) == VT_BSTR ? debugstr_w(V_BSTR(&destination)) :
NULL);
@@ -1707,31 +1778,19 @@
return S_FALSE;
}
- xmlDocDumpMemory(get_doc(This), &mem, &size);
-
- /*
- * libxml2 always adds XML declaration on top of the file and one for each processing
instruction node in DOM tree.
- * MSXML adds XML declaration only for processing instruction nodes.
- * We skip the first XML declaration generated by libxml2 to get exactly what we
need.
- */
- p = mem;
- if(size > 2 && p[0] == '<' && p[1] == '?') {
- while(p < mem+size && (p[0] != '?' || p[1] !=
'>'))
- p++;
- p += 2;
- while(p < mem+size && isspace(*p))
- p++;
- size -= p-mem;
- }
-
- if(!WriteFile(handle, p, (DWORD)size, &written, NULL) || written != (DWORD)size)
- {
- WARN("write error\n");
- ret = S_FALSE;
- }
-
- xmlFree(mem);
- CloseHandle(handle);
+ /* disable top XML declaration */
+ ctx = xmlSaveToIO(domdoc_save_writecallback, domdoc_save_closecallback,
+ handle, NULL, XML_SAVE_NO_DECL);
+ if (!ctx)
+ {
+ CloseHandle(handle);
+ return S_FALSE;
+ }
+
+ if (xmlSaveDoc(ctx, get_doc(This)) == -1) ret = S_FALSE;
+ /* will close file through close callback */
+ xmlSaveClose(ctx);
+
return ret;
}
@@ -1741,7 +1800,7 @@
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- TRACE("%p <- %d\n", isValidating, This->validating);
+ TRACE("(%p)->(%p: %d)\n", This, isValidating, This->validating);
*isValidating = This->validating;
return S_OK;
}
@@ -1753,7 +1812,7 @@
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- TRACE("%d\n", isValidating);
+ TRACE("(%p)->(%d)\n", This, isValidating);
This->validating = isValidating;
return S_OK;
}
@@ -1765,7 +1824,7 @@
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- TRACE("%p <- %d\n", isResolving, This->resolving);
+ TRACE("(%p)->(%p: %d)\n", This, isResolving, This->resolving);
*isResolving = This->resolving;
return S_OK;
}
@@ -1777,7 +1836,7 @@
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- TRACE("%d\n", isResolving);
+ TRACE("(%p)->(%d)\n", This, isResolving);
This->resolving = isResolving;
return S_OK;
}
@@ -1789,7 +1848,7 @@
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- TRACE("%p <- %d\n", isPreserving, This->preserving);
+ TRACE("(%p)->(%p: %d)\n", This, isPreserving, This->preserving);
*isPreserving = This->preserving;
return S_OK;
}
@@ -1801,7 +1860,7 @@
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- TRACE("%d\n", isPreserving);
+ TRACE("(%p)->(%d)\n", This, isPreserving);
This->preserving = isPreserving;
return S_OK;
}
@@ -1811,7 +1870,8 @@
IXMLDOMDocument2 *iface,
VARIANT readyStateChangeSink )
{
- FIXME("\n");
+ domdoc *This = impl_from_IXMLDOMDocument2( iface );
+ FIXME("%p\n", This);
return E_NOTIMPL;
}
@@ -1820,7 +1880,8 @@
IXMLDOMDocument2 *iface,
VARIANT onDataAvailableSink )
{
- FIXME("\n");
+ domdoc *This = impl_from_IXMLDOMDocument2( iface );
+ FIXME("%p\n", This);
return E_NOTIMPL;
}
@@ -1828,7 +1889,8 @@
IXMLDOMDocument2 *iface,
VARIANT onTransformNodeSink )
{
- FIXME("\n");
+ domdoc *This = impl_from_IXMLDOMDocument2( iface );
+ FIXME("%p\n", This);
return E_NOTIMPL;
}
@@ -1836,7 +1898,8 @@
IXMLDOMDocument2* iface,
IXMLDOMSchemaCollection** schemaCollection )
{
- FIXME("\n");
+ domdoc *This = impl_from_IXMLDOMDocument2( iface );
+ FIXME("(%p)->(%p)\n", This, schemaCollection);
return E_NOTIMPL;
}
@@ -1903,7 +1966,8 @@
IXMLDOMDocument2* iface,
IXMLDOMParseError** err)
{
- FIXME("\n");
+ domdoc *This = impl_from_IXMLDOMDocument2( iface );
+ FIXME("(%p)->(%p)\n", This, err);
return E_NOTIMPL;
}
@@ -1913,6 +1977,8 @@
VARIANT var)
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
+
+ TRACE("(%p)->(%s)\n", This, debugstr_w(p));
if (lstrcmpiW(p, SZ_PROPERTY_SELECTION_LANGUAGE) == 0)
{
@@ -1952,6 +2018,8 @@
VARIANT* var)
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
+
+ TRACE("(%p)->(%p)\n", This, debugstr_w(p));
if (var == NULL)
return E_INVALIDARG;
@@ -2082,7 +2150,7 @@
{
domdoc *This = impl_from_IObjectWithSite(iface);
- TRACE("%p %s %p\n", This, debugstr_guid( iid ), ppvSite );
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid( iid ), ppvSite );
if ( !This->site )
return E_FAIL;
@@ -2095,7 +2163,7 @@
{
domdoc *This = impl_from_IObjectWithSite(iface);
- TRACE("%p %p\n", iface, punk);
+ TRACE("(%p)->(%p)\n", iface, punk);
if(!punk)
{
@@ -2146,7 +2214,7 @@
return IXMLDocument_Release((IXMLDocument *)This);
}
-#define SUPPORTED_OPTIONS
(INTERFACESAFE_FOR_UNTRUSTED_CALLER|INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_SECURITY_MANAGER)
+#define SAFETY_SUPPORTED_OPTIONS
(INTERFACESAFE_FOR_UNTRUSTED_CALLER|INTERFACESAFE_FOR_UNTRUSTED_DATA)
static HRESULT WINAPI xmldoc_Safety_GetInterfaceSafetyOptions(IObjectSafety *iface,
REFIID riid,
DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions)
@@ -2158,7 +2226,7 @@
if(!pdwSupportedOptions || !pdwEnabledOptions)
return E_POINTER;
- *pdwSupportedOptions = SUPPORTED_OPTIONS;
+ *pdwSupportedOptions = SAFETY_SUPPORTED_OPTIONS;
*pdwEnabledOptions = This->safeopt;
return S_OK;
@@ -2168,13 +2236,9 @@
DWORD dwOptionSetMask, DWORD dwEnabledOptions)
{
domdoc *This = impl_from_IObjectSafety(iface);
-
TRACE("(%p)->(%s %x %x)\n", This, debugstr_guid(riid), dwOptionSetMask,
dwEnabledOptions);
- if(dwOptionSetMask & ~SUPPORTED_OPTIONS)
- return E_FAIL;
-
- This->safeopt = dwEnabledOptions & dwEnabledOptions;
+ This->safeopt = dwEnabledOptions & dwOptionSetMask &
SAFETY_SUPPORTED_OPTIONS;
return S_OK;
}
Modified: trunk/reactos/dll/win32/msxml3/domimpl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/domimpl.c…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/domimpl.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/domimpl.c [iso-8859-1] Mon Mar 1 12:10:15 2010
@@ -54,7 +54,7 @@
void** ppvObject )
{
domimpl *This = impl_from_IXMLDOMImplementation( iface );
- TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
if ( IsEqualGUID( riid, &IID_IXMLDOMImplementation ) ||
IsEqualGUID( riid, &IID_IDispatch ) ||
@@ -181,7 +181,7 @@
BOOL bValidFeature = FALSE;
BOOL bValidVersion = FALSE;
- TRACE("feature(%s) version (%s)\n", debugstr_w(feature),
debugstr_w(version));
+ TRACE("(%p)->(%s %s %p)\n", This, debugstr_w(feature),
debugstr_w(version), hasFeature);
if(!feature || !hasFeature)
return E_INVALIDARG;
Modified: trunk/reactos/dll/win32/msxml3/element.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/element.c…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/element.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/element.c [iso-8859-1] Mon Mar 1 12:10:15 2010
@@ -62,7 +62,7 @@
{
domelem *This = impl_from_IXMLDOMElement( iface );
- TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
if ( IsEqualGUID( riid, &IID_IXMLDOMElement ) ||
IsEqualGUID( riid, &IID_IDispatch ) ||
@@ -493,7 +493,7 @@
DWORD offset = 0;
LPWSTR str;
- TRACE("%p\n", This );
+ TRACE("(%p)->(%p)\n", This, p );
element = get_element( This );
if ( !element )
@@ -526,7 +526,7 @@
xmlChar *xml_name, *xml_value = NULL;
HRESULT hr = S_FALSE;
- TRACE("(%p)->(%s,%p)\n", This, debugstr_w(name), value);
+ TRACE("(%p)->(%s %p)\n", This, debugstr_w(name), value);
if(!value || !name)
return E_INVALIDARG;
@@ -567,7 +567,7 @@
HRESULT hr;
VARIANT var;
- TRACE("(%p)->(%s, var)\n", This, debugstr_w(name));
+ TRACE("(%p)->(%s var)\n", This, debugstr_w(name));
element = get_element( This );
if ( !element )
@@ -660,7 +660,8 @@
IXMLDOMAttribute* domAttribute,
IXMLDOMAttribute** attributeNode)
{
- FIXME("\n");
+ domelem *This = impl_from_IXMLDOMElement( iface );
+ FIXME("(%p)->(%p %p)\n", This, domAttribute, attributeNode);
return E_NOTIMPL;
}
@@ -669,7 +670,8 @@
IXMLDOMAttribute* domAttribute,
IXMLDOMAttribute** attributeNode)
{
- FIXME("\n");
+ domelem *This = impl_from_IXMLDOMElement( iface );
+ FIXME("(%p)->(%p %p)\n", This, domAttribute, attributeNode);
return E_NOTIMPL;
}
@@ -684,7 +686,7 @@
xmlNodePtr element;
HRESULT hr;
- TRACE("(%p)->(%s,%p)\n", This, debugstr_w(bstrName), resultList);
+ TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrName), resultList);
if (bstrName[0] == '*' && bstrName[1] == 0)
{
@@ -714,7 +716,8 @@
static HRESULT WINAPI domelem_normalize(
IXMLDOMElement *iface )
{
- FIXME("\n");
+ domelem *This = impl_from_IXMLDOMElement( iface );
+ FIXME("%p\n", This);
return E_NOTIMPL;
}
Modified: trunk/reactos/dll/win32/msxml3/entityref.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/entityref…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/entityref.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/entityref.c [iso-8859-1] Mon Mar 1 12:10:15 2010
@@ -55,7 +55,7 @@
void** ppvObject )
{
entityref *This = impl_from_IXMLDOMEntityReference( iface );
- TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
if ( IsEqualGUID( riid, &IID_IXMLDOMEntityReference ) ||
IsEqualGUID( riid, &IID_IDispatch ) ||
Modified: trunk/reactos/dll/win32/msxml3/factory.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/factory.c…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/factory.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/factory.c [iso-8859-1] Mon Mar 1 12:10:15 2010
@@ -167,7 +167,8 @@
cf = (IClassFactory*) &domdoccf.lpVtbl;
}
else if( IsEqualCLSID( rclsid, &CLSID_SAXXMLReader) ||
- IsEqualCLSID( rclsid, &CLSID_SAXXMLReader30 ))
+ IsEqualCLSID( rclsid, &CLSID_SAXXMLReader30 ) ||
+ IsEqualCLSID( rclsid, &CLSID_SAXXMLReader40 ))
{
cf = (IClassFactory*) &saxreadcf.lpVtbl;
}
Modified: trunk/reactos/dll/win32/msxml3/httprequest.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/httpreque…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/httprequest.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/httprequest.c [iso-8859-1] Mon Mar 1 12:10:15 2010
@@ -50,7 +50,7 @@
static HRESULT WINAPI httprequest_QueryInterface(IXMLHTTPRequest *iface, REFIID riid,
void **ppvObject)
{
httprequest *This = impl_from_IXMLHTTPRequest( iface );
- TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
if ( IsEqualGUID( riid, &IID_IXMLHTTPRequest) ||
IsEqualGUID( riid, &IID_IDispatch) ||
Modified: trunk/reactos/dll/win32/msxml3/msxml_private.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/msxml_pri…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/msxml_private.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/msxml_private.h [iso-8859-1] Mon Mar 1 12:10:15 2010
@@ -1,5 +1,5 @@
/*
- * MSXML Class Factory
+ * Common definitions
*
* Copyright 2005 Mike McCormack
*
@@ -174,6 +174,8 @@
if(ret)
MultiByteToWideChar( CP_UTF8, 0, (LPCSTR)str, -1, ret, len);
}
+ else
+ ret = SysAllocStringLen(NULL, 0);
return ret;
}
Modified: trunk/reactos/dll/win32/msxml3/node.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/node.c?re…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/node.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/node.c [iso-8859-1] Mon Mar 1 12:10:15 2010
@@ -87,7 +87,7 @@
{
xmlnode *This = impl_from_IXMLDOMNode( iface );
- TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
if(This->pUnkOuter)
return IUnknown_QueryInterface(This->pUnkOuter, riid, ppvObject);
@@ -230,7 +230,7 @@
xmlnode *This = impl_from_IXMLDOMNode( iface );
const xmlChar *str;
- TRACE("%p\n", This );
+ TRACE("(%p)->(%p)\n", This, name );
if (!name)
return E_INVALIDARG;
@@ -250,16 +250,16 @@
str = (const xmlChar*) "#document-fragment";
break;
case XML_TEXT_NODE:
- str = (const xmlChar*) "#text";
- break;
+ str = (const xmlChar*) "#text";
+ break;
case XML_DOCUMENT_NODE:
- str = (const xmlChar*) "#document";
- break;
- case XML_ATTRIBUTE_NODE:
- case XML_ELEMENT_NODE:
- case XML_PI_NODE:
+ str = (const xmlChar*) "#document";
+ break;
+ case XML_ATTRIBUTE_NODE:
+ case XML_ELEMENT_NODE:
+ case XML_PI_NODE:
str = This->node->name;
- break;
+ break;
default:
FIXME("nodeName not mapped correctly (%d)\n", This->node->type);
str = This->node->name;
@@ -280,7 +280,7 @@
xmlnode *This = impl_from_IXMLDOMNode( iface );
HRESULT r = S_FALSE;
- TRACE("%p %p\n", This, value);
+ TRACE("(%p)->(%p)\n", This, value);
if(!value)
return E_INVALIDARG;
@@ -327,23 +327,11 @@
{
xmlnode *This = impl_from_IXMLDOMNode( iface );
HRESULT hr;
- xmlChar *str = NULL;
- VARIANT string_value;
TRACE("%p type(%d)\n", This, This->node->type);
- VariantInit(&string_value);
- hr = VariantChangeType(&string_value, &value, 0, VT_BSTR);
- if(FAILED(hr))
- {
- VariantClear(&string_value);
- WARN("Couldn't convert to VT_BSTR\n");
- return hr;
- }
-
- hr = S_FALSE;
/* Document, Document Fragment, Document Type, Element,
- Entity, Entity Reference, Notation aren't supported. */
+ Entity, Entity Reference, Notation aren't supported. */
switch ( This->node->type )
{
case XML_ATTRIBUTE_NODE:
@@ -351,19 +339,32 @@
case XML_COMMENT_NODE:
case XML_PI_NODE:
case XML_TEXT_NODE:
- {
+ {
+ VARIANT string_value;
+ xmlChar *str;
+
+ VariantInit(&string_value);
+ hr = VariantChangeType(&string_value, &value, 0, VT_BSTR);
+ if(FAILED(hr))
+ {
+ VariantClear(&string_value);
+ WARN("Couldn't convert to VT_BSTR\n");
+ return hr;
+ }
+
str = xmlChar_from_wchar(V_BSTR(&string_value));
+ VariantClear(&string_value);
+
xmlNodeSetContent(This->node, str);
heap_free(str);
hr = S_OK;
break;
- }
+ }
default:
/* Do nothing for unsupported types. */
- break;
- }
-
- VariantClear(&string_value);
+ hr = E_FAIL;
+ break;
+ }
return hr;
}
@@ -374,7 +375,7 @@
{
xmlnode *This = impl_from_IXMLDOMNode( iface );
- TRACE("%p %p\n", This, type);
+ TRACE("(%p)->(%p)\n", This, type);
assert( (int)NODE_ELEMENT == (int)XML_ELEMENT_NODE );
assert( (int)NODE_NOTATION == (int)XML_NOTATION_NODE );
@@ -390,7 +391,7 @@
xmlNodePtr node,
IXMLDOMNode **out )
{
- TRACE("%p->%s %p\n", This, name, node );
+ TRACE("(%p)->(%s %p %p)\n", This, name, node, out );
if ( !out )
return E_INVALIDARG;
@@ -419,7 +420,7 @@
{
xmlnode *This = impl_from_IXMLDOMNode( iface );
- TRACE("%p %p\n", This, childList );
+ TRACE("(%p)->(%p)\n", This, childList );
if ( !childList )
return E_INVALIDARG;
@@ -445,7 +446,7 @@
{
xmlnode *This = impl_from_IXMLDOMNode( iface );
- TRACE("%p\n", This );
+ TRACE("(%p)->(%p)\n", This, lastChild );
if (!lastChild)
return E_INVALIDARG;
@@ -470,7 +471,7 @@
{
xmlnode *This = impl_from_IXMLDOMNode( iface );
- TRACE("%p\n", This );
+ TRACE("(%p)->(%p)\n", This, previousSibling );
if (!previousSibling)
return E_INVALIDARG;
@@ -494,7 +495,7 @@
{
xmlnode *This = impl_from_IXMLDOMNode( iface );
- TRACE("%p\n", This );
+ TRACE("(%p)->(%p)\n", This, nextSibling );
if (!nextSibling)
return E_INVALIDARG;
@@ -517,7 +518,7 @@
IXMLDOMNamedNodeMap** attributeMap)
{
xmlnode *This = impl_from_IXMLDOMNode( iface );
- TRACE("%p\n", This);
+ TRACE("(%p)->(%p)\n", This, attributeMap);
if (!attributeMap)
return E_INVALIDARG;
@@ -553,7 +554,7 @@
IXMLDOMNode *before = NULL, *new;
HRESULT hr;
- TRACE("(%p)->(%p,var,%p)\n",This,newChild,outNewChild);
+ TRACE("(%p)->(%p var %p)\n",This,newChild,outNewChild);
if (!newChild)
return E_INVALIDARG;
@@ -620,7 +621,7 @@
IXMLDOMNode *realOldChild;
HRESULT hr;
- TRACE("%p->(%p,%p,%p)\n",This,newChild,oldChild,outOldChild);
+ TRACE("(%p)->(%p %p %p)\n", This, newChild, oldChild, outOldChild);
/* Do not believe any documentation telling that newChild == NULL
means removal. It does certainly *not* apply to msxml3! */
@@ -684,7 +685,7 @@
HRESULT hr;
IXMLDOMNode *child;
- TRACE("%p->(%p, %p)\n", This, childNode, oldChild);
+ TRACE("(%p)->(%p %p)\n", This, childNode, oldChild);
if(!childNode) return E_INVALIDARG;
@@ -726,7 +727,7 @@
VARIANT var;
HRESULT hr;
- TRACE("(%p)->(%p,%p)\n", This, newChild, outNewChild);
+ TRACE("(%p)->(%p %p)\n", This, newChild, outNewChild);
hr = IXMLDOMNode_get_nodeType(newChild, &type);
if(FAILED(hr) || type == NODE_ATTRIBUTE) {
@@ -744,7 +745,7 @@
{
xmlnode *This = impl_from_IXMLDOMNode( iface );
- TRACE("%p\n", This);
+ TRACE("(%p)->(%p)\n", This, hasChild);
if (!hasChild)
return E_INVALIDARG;
@@ -764,7 +765,7 @@
{
xmlnode *This = impl_from_IXMLDOMNode( iface );
- TRACE("%p (%p)\n", This, DOMDocument);
+ TRACE("(%p)->(%p)\n", This, DOMDocument);
return DOMDocument_create_from_xmldoc(This->node->doc,
(IXMLDOMDocument2**)DOMDocument);
}
@@ -778,7 +779,7 @@
xmlNodePtr pClone = NULL;
IXMLDOMNode *pNode = NULL;
- TRACE("%p (%d)\n", This, deep);
+ TRACE("(%p)->(%d %p)\n", This, deep, cloneRoot);
if(!cloneRoot)
return E_INVALIDARG;
@@ -814,7 +815,7 @@
xmlnode *This = impl_from_IXMLDOMNode( iface );
const xmlChar *str;
- TRACE("%p\n", This );
+ TRACE("(%p)->(%p)\n", This, xmlnodeType );
if (!xmlnodeType)
return E_INVALIDARG;
@@ -878,7 +879,7 @@
BSTR str = NULL;
xmlChar *pContent;
- TRACE("%p type %d\n", This, This->node->type);
+ TRACE("(%p, type %d)->(%p)\n", This, This->node->type, text);
if ( !text )
return E_INVALIDARG;
@@ -906,7 +907,7 @@
xmlnode *This = impl_from_IXMLDOMNode( iface );
xmlChar *str, *str2;
- TRACE("%p\n", This);
+ TRACE("(%p)->(%s)\n", This, debugstr_w(text));
switch(This->node->type)
{
@@ -932,7 +933,8 @@
IXMLDOMNode *iface,
VARIANT_BOOL* isSpecified)
{
- FIXME("\n");
+ xmlnode *This = impl_from_IXMLDOMNode( iface );
+ FIXME("(%p)->(%p)\n", This, isSpecified);
return E_NOTIMPL;
}
@@ -940,11 +942,10 @@
IXMLDOMNode *iface,
IXMLDOMNode** definitionNode)
{
- FIXME("\n");
+ xmlnode *This = impl_from_IXMLDOMNode( iface );
+ FIXME("(%p)->(%p)\n", This, definitionNode);
return E_NOTIMPL;
}
-
-static HRESULT WINAPI xmlnode_get_dataType(IXMLDOMNode*, VARIANT*);
static inline BYTE hex_to_byte(xmlChar c)
{
@@ -1136,7 +1137,7 @@
xmlChar *content;
HRESULT hres = S_FALSE;
- TRACE("iface %p\n", iface);
+ TRACE("(%p)->(%p)\n", This, typedValue);
if(!typedValue)
return E_INVALIDARG;
@@ -1146,10 +1147,10 @@
if(This->node->type == XML_ELEMENT_NODE ||
This->node->type == XML_TEXT_NODE ||
This->node->type == XML_ENTITY_REF_NODE)
- hres = xmlnode_get_dataType(iface, &type);
+ hres = IXMLDOMNode_get_dataType(iface, &type);
if(hres != S_OK && This->node->type != XML_ELEMENT_NODE)
- return xmlnode_get_nodeValue(iface, typedValue);
+ return IXMLDOMNode_get_nodeValue(iface, typedValue);
content = xmlNodeGetContent(This->node);
hres = VARIANT_from_xmlChar(content, typedValue,
@@ -1164,7 +1165,8 @@
IXMLDOMNode *iface,
VARIANT typedValue)
{
- FIXME("\n");
+ xmlnode *This = impl_from_IXMLDOMNode( iface );
+ FIXME("%p\n", This);
return E_NOTIMPL;
}
@@ -1175,7 +1177,7 @@
xmlnode *This = impl_from_IXMLDOMNode( iface );
xmlChar *pVal;
- TRACE("iface %p\n", iface);
+ TRACE("(%p)->(%p)\n", This, dataTypeName);
if(!dataTypeName)
return E_INVALIDARG;
@@ -1220,7 +1222,7 @@
xmlnode *This = impl_from_IXMLDOMNode( iface );
HRESULT hr = E_FAIL;
- TRACE("iface %p\n", iface);
+ TRACE("(%p)->(%s)\n", This, debugstr_w(dataTypeName));
if(dataTypeName == NULL)
return E_INVALIDARG;
@@ -1382,7 +1384,7 @@
xmlBufferPtr pXmlBuf;
int nSize;
- TRACE("iface %p %d\n", iface, This->node->type);
+ TRACE("(%p %d)->(%p)\n", This, This->node->type, xmlString);
if(!xmlString)
return E_INVALIDARG;
@@ -1440,7 +1442,7 @@
xmlDocPtr result = NULL;
IXMLDOMNode *ssNew;
- TRACE("%p %p %p\n", This, styleSheet, xmlString);
+ TRACE("(%p)->(%p %p)\n", This, styleSheet, xmlString);
if (!libxslt_handle)
return E_NOTIMPL;
@@ -1517,7 +1519,7 @@
{
xmlnode *This = impl_from_IXMLDOMNode( iface );
- TRACE("%p %s %p\n", This, debugstr_w(queryString), resultList );
+ TRACE("(%p)->(%s %p)\n", This, debugstr_w(queryString), resultList );
return queryresult_create( This->node, queryString, resultList );
}
@@ -1531,7 +1533,7 @@
IXMLDOMNodeList *list;
HRESULT r;
- TRACE("%p %s %p\n", This, debugstr_w(queryString), resultNode );
+ TRACE("(%p)->(%s %p)\n", This, debugstr_w(queryString), resultNode );
*resultNode = NULL;
r = IXMLDOMNode_selectNodes(iface, queryString, &list);
@@ -1547,7 +1549,8 @@
IXMLDOMNode *iface,
VARIANT_BOOL* isParsed)
{
- FIXME("\n");
+ xmlnode *This = impl_from_IXMLDOMNode( iface );
+ FIXME("(%p)->(%p)\n", This, isParsed);
return E_NOTIMPL;
}
@@ -1559,7 +1562,7 @@
HRESULT hr = S_FALSE;
xmlNsPtr *pNSList;
- TRACE("%p %p\n", This, namespaceURI );
+ TRACE("(%p)->(%p)\n", This, namespaceURI );
if(!namespaceURI)
return E_INVALIDARG;
@@ -1586,7 +1589,7 @@
HRESULT hr = S_FALSE;
xmlNsPtr *pNSList;
- TRACE("%p %p\n", This, prefixString );
+ TRACE("(%p)->(%p)\n", This, prefixString );
if(!prefixString)
return E_INVALIDARG;
@@ -1613,7 +1616,7 @@
BSTR str = NULL;
HRESULT r = S_FALSE;
- TRACE("%p %p\n", This, nameString );
+ TRACE("(%p)->(%p)\n", This, nameString );
if ( !nameString )
return E_INVALIDARG;
@@ -1622,10 +1625,12 @@
{
case XML_ELEMENT_NODE:
case XML_ATTRIBUTE_NODE:
+ case XML_PI_NODE:
str = bstr_from_xmlChar( This->node->name );
r = S_OK;
break;
case XML_TEXT_NODE:
+ case XML_COMMENT_NODE:
break;
default:
ERR("Unhandled type %d\n", This->node->type );
@@ -1643,7 +1648,8 @@
IXMLDOMNode* stylesheet,
VARIANT outputObject)
{
- FIXME("\n");
+ xmlnode *This = impl_from_IXMLDOMNode( iface );
+ FIXME("(%p)->(%p)\n", This, stylesheet);
return E_NOTIMPL;
}
@@ -1738,11 +1744,20 @@
case XML_CDATA_SECTION_NODE:
pUnk = create_cdata( node );
break;
+ case XML_ENTITY_REF_NODE:
+ pUnk = create_doc_entity_ref( node );
+ break;
+ case XML_PI_NODE:
+ pUnk = create_pi( node );
+ break;
case XML_COMMENT_NODE:
pUnk = create_comment( node );
break;
case XML_DOCUMENT_NODE:
pUnk = create_domdoc( node );
+ break;
+ case XML_DOCUMENT_FRAG_NODE:
+ pUnk = create_doc_fragment( node );
break;
default: {
xmlnode *new_node;
Modified: trunk/reactos/dll/win32/msxml3/nodelist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/nodelist.…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/nodelist.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/nodelist.c [iso-8859-1] Mon Mar 1 12:10:15 2010
@@ -64,7 +64,7 @@
REFIID riid,
void** ppvObject )
{
- TRACE("%p %s %p\n", iface, debugstr_guid(riid), ppvObject);
+ TRACE("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppvObject);
if(!ppvObject)
return E_INVALIDARG;
@@ -205,7 +205,7 @@
xmlNodePtr curr;
LONG nodeIndex = 0;
- TRACE("%p %d\n", This, index);
+ TRACE("(%p)->(%d %p)\n", This, index, listItem);
if(!listItem)
return E_INVALIDARG;
@@ -238,7 +238,7 @@
xmlnodelist *This = impl_from_IXMLDOMNodeList( iface );
- TRACE("%p\n", This);
+ TRACE("(%p)->(%p)\n", This, listLength);
if(!listLength)
return E_INVALIDARG;
@@ -260,7 +260,7 @@
{
xmlnodelist *This = impl_from_IXMLDOMNodeList( iface );
- TRACE("%p %p\n", This, nextItem );
+ TRACE("(%p)->(%p)\n", This, nextItem );
if(!nextItem)
return E_INVALIDARG;
@@ -289,7 +289,8 @@
IXMLDOMNodeList* iface,
IUnknown** ppUnk)
{
- FIXME("\n");
+ xmlnodelist *This = impl_from_IXMLDOMNodeList( iface );
+ FIXME("(%p)->(%p)\n", This, ppUnk);
return E_NOTIMPL;
}
Modified: trunk/reactos/dll/win32/msxml3/nodemap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/nodemap.c…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/nodemap.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/nodemap.c [iso-8859-1] Mon Mar 1 12:10:15 2010
@@ -62,7 +62,7 @@
REFIID riid, void** ppvObject )
{
xmlnodemap *This = impl_from_IXMLDOMNamedNodeMap( iface );
- TRACE("%p %s %p\n", iface, debugstr_guid(riid), ppvObject);
+ TRACE("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppvObject);
if( IsEqualGUID( riid, &IID_IUnknown ) ||
IsEqualGUID( riid, &IID_IDispatch ) ||
@@ -207,7 +207,7 @@
xmlAttrPtr attr;
xmlNodePtr node;
- TRACE("%p %s %p\n", This, debugstr_w(name), namedItem );
+ TRACE("(%p)->(%s %p)\n", This, debugstr_w(name), namedItem );
if ( !namedItem )
return E_INVALIDARG;
@@ -242,7 +242,7 @@
IXMLDOMNode *pAttr = NULL;
xmlNodePtr node;
- TRACE("%p %p %p\n", This, newItem, namedItem );
+ TRACE("(%p)->(%p %p)\n", This, newItem, namedItem );
if(!newItem)
return E_INVALIDARG;
@@ -292,7 +292,7 @@
xmlAttrPtr attr;
xmlNodePtr node;
- TRACE("%p %s %p\n", This, debugstr_w(name), namedItem );
+ TRACE("(%p)->(%s %p)\n", This, debugstr_w(name), namedItem );
if ( !name)
return E_INVALIDARG;
@@ -337,7 +337,7 @@
xmlAttrPtr curr;
LONG attrIndex;
- TRACE("%p %d\n", This, index);
+ TRACE("(%p)->(%d %p)\n", This, index, listItem);
*listItem = NULL;
@@ -370,7 +370,7 @@
xmlnodemap *This = impl_from_IXMLDOMNamedNodeMap( iface );
- TRACE("%p\n", This);
+ TRACE("(%p)->(%p)\n", This, listLength);
if( !listLength )
return E_INVALIDARG;
@@ -402,7 +402,8 @@
BSTR namespaceURI,
IXMLDOMNode** qualifiedItem)
{
- FIXME("\n");
+ xmlnodemap *This = impl_from_IXMLDOMNamedNodeMap( iface );
+ FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(baseName),
debugstr_w(namespaceURI), qualifiedItem);
return E_NOTIMPL;
}
@@ -412,7 +413,8 @@
BSTR namespaceURI,
IXMLDOMNode** qualifiedItem)
{
- FIXME("\n");
+ xmlnodemap *This = impl_from_IXMLDOMNamedNodeMap( iface );
+ FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(baseName),
debugstr_w(namespaceURI), qualifiedItem);
return E_NOTIMPL;
}
@@ -425,7 +427,7 @@
xmlAttrPtr curr;
LONG attrIndex;
- TRACE("%p %d\n", This, This->iterator);
+ TRACE("(%p)->(%p: %d)\n", This, nextItem, This->iterator);
*nextItem = NULL;
@@ -451,7 +453,7 @@
{
xmlnodemap *This = impl_from_IXMLDOMNamedNodeMap( iface );
- TRACE("%p %d\n", This, This->iterator);
+ TRACE("(%p: %d)\n", This, This->iterator);
This->iterator = 0;
@@ -462,7 +464,8 @@
IXMLDOMNamedNodeMap *iface,
IUnknown** ppUnk)
{
- FIXME("\n");
+ xmlnodemap *This = impl_from_IXMLDOMNamedNodeMap( iface );
+ FIXME("(%p)->(%p)\n", This, ppUnk);
return E_NOTIMPL;
}
Modified: trunk/reactos/dll/win32/msxml3/parseerror.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/parseerro…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/parseerror.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/parseerror.c [iso-8859-1] Mon Mar 1 12:10:15 2010
@@ -56,7 +56,7 @@
REFIID riid,
void** ppvObject )
{
- TRACE("%p %s %p\n", iface, debugstr_guid(riid), ppvObject);
+ TRACE("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppvObject);
if ( IsEqualGUID( riid, &IID_IUnknown ) ||
IsEqualGUID( riid, &IID_IDispatch ) ||
@@ -208,7 +208,8 @@
IXMLDOMParseError *iface,
BSTR *url )
{
- FIXME("\n");
+ parse_error_t *This = impl_from_IXMLDOMParseError( iface );
+ FIXME("(%p)->(%p)\n", This, url);
return E_NOTIMPL;
}
@@ -232,7 +233,8 @@
IXMLDOMParseError *iface,
BSTR *srcText )
{
- FIXME("\n");
+ parse_error_t *This = impl_from_IXMLDOMParseError( iface );
+ FIXME("(%p)->(%p)\n", This, srcText);
return E_NOTIMPL;
}
@@ -240,7 +242,8 @@
IXMLDOMParseError *iface,
LONG *line )
{
- FIXME("\n");
+ parse_error_t *This = impl_from_IXMLDOMParseError( iface );
+ FIXME("(%p)->(%p)\n", This, line);
return E_NOTIMPL;
}
@@ -248,7 +251,8 @@
IXMLDOMParseError *iface,
LONG *linepos )
{
- FIXME("\n");
+ parse_error_t *This = impl_from_IXMLDOMParseError( iface );
+ FIXME("(%p)->(%p)\n", This, linepos);
return E_NOTIMPL;
}
@@ -256,7 +260,8 @@
IXMLDOMParseError *iface,
LONG *filepos )
{
- FIXME("\n");
+ parse_error_t *This = impl_from_IXMLDOMParseError( iface );
+ FIXME("(%p)->(%p)\n", This, filepos);
return E_NOTIMPL;
}
Modified: trunk/reactos/dll/win32/msxml3/pi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/pi.c?rev=…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/pi.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/pi.c [iso-8859-1] Mon Mar 1 12:10:15 2010
@@ -55,7 +55,7 @@
void** ppvObject )
{
dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
- TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
if ( IsEqualGUID( riid, &IID_IXMLDOMProcessingInstruction ) ||
IsEqualGUID( riid, &IID_IDispatch ) ||
@@ -526,7 +526,7 @@
BSTR sTarget;
static const WCHAR szXML[] = {'x','m','l',0};
- TRACE("%p %s\n", This, debugstr_w(data) );
+ TRACE("(%p)->(%s)\n", This, debugstr_w(data) );
/* Cannot set data to a PI node whose target is 'xml' */
hr = dom_pi_get_nodeName(iface, &sTarget);
Modified: trunk/reactos/dll/win32/msxml3/queryresult.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/queryresu…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/queryresult.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/queryresult.c [iso-8859-1] Mon Mar 1 12:10:15 2010
@@ -74,7 +74,7 @@
{
queryresult *This = impl_from_IXMLDOMNodeList( iface );
- TRACE("%p %s %p\n", iface, debugstr_guid(riid), ppvObject);
+ TRACE("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppvObject);
if(!ppvObject)
return E_INVALIDARG;
@@ -217,7 +217,7 @@
{
queryresult *This = impl_from_IXMLDOMNodeList( iface );
- TRACE("%p %d\n", This, index);
+ TRACE("(%p)->(%d %p)\n", This, index, listItem);
if(!listItem)
return E_INVALIDARG;
@@ -239,7 +239,7 @@
{
queryresult *This = impl_from_IXMLDOMNodeList( iface );
- TRACE("%p\n", This);
+ TRACE("(%p)->(%p)\n", This, listLength);
if(!listLength)
return E_INVALIDARG;
@@ -254,7 +254,7 @@
{
queryresult *This = impl_from_IXMLDOMNodeList( iface );
- TRACE("%p %p\n", This, nextItem );
+ TRACE("(%p)->(%p)\n", This, nextItem );
if(!nextItem)
return E_INVALIDARG;
@@ -283,7 +283,8 @@
IXMLDOMNodeList* iface,
IUnknown** ppUnk)
{
- FIXME("\n");
+ queryresult *This = impl_from_IXMLDOMNodeList( iface );
+ FIXME("(%p)->(%p)\n", This, ppUnk);
return E_NOTIMPL;
}
Modified: trunk/reactos/dll/win32/msxml3/schema.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/schema.c?…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/schema.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/schema.c [iso-8859-1] Mon Mar 1 12:10:15 2010
@@ -51,7 +51,7 @@
{
schema_t *This = impl_from_IXMLDOMSchemaCollection( iface );
- TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid( riid ), ppvObject );
if ( IsEqualIID( riid, &IID_IUnknown ) ||
IsEqualIID( riid, &IID_IDispatch ) ||
Modified: trunk/reactos/dll/win32/msxml3/text.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/text.c?re…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/text.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/text.c [iso-8859-1] Mon Mar 1 12:10:15 2010
@@ -56,7 +56,7 @@
void** ppvObject )
{
domtext *This = impl_from_IXMLDOMText( iface );
- TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
if ( IsEqualGUID( riid, &IID_IXMLDOMText ) ||
IsEqualGUID( riid, &IID_IXMLDOMCharacterData) ||
@@ -482,7 +482,7 @@
BSTR *p)
{
domtext *This = impl_from_IXMLDOMText( iface );
- HRESULT hr = E_FAIL;
+ HRESULT hr;
VARIANT vRet;
if(!p)
@@ -502,17 +502,14 @@
BSTR data)
{
domtext *This = impl_from_IXMLDOMText( iface );
- HRESULT hr = E_FAIL;
VARIANT val;
- TRACE("%p %s\n", This, debugstr_w(data) );
+ TRACE("(%p)->(%s)\n", This, debugstr_w(data) );
V_VT(&val) = VT_BSTR;
V_BSTR(&val) = data;
- hr = IXMLDOMNode_put_nodeValue( IXMLDOMNode_from_impl(&This->node), val );
-
- return hr;
+ return IXMLDOMNode_put_nodeValue( IXMLDOMNode_from_impl(&This->node), val );
}
static HRESULT WINAPI domtext_get_length(
@@ -520,24 +517,22 @@
LONG *len)
{
domtext *This = impl_from_IXMLDOMText( iface );
- xmlChar *pContent;
- LONG nLength = 0;
-
- TRACE("%p\n", iface);
+ HRESULT hr;
+ BSTR data;
+
+ TRACE("(%p)->(%p)\n", This, len);
if(!len)
return E_INVALIDARG;
- pContent = xmlNodeGetContent(This->node.node);
- if(pContent)
- {
- nLength = xmlStrlen(pContent);
- xmlFree(pContent);
- }
-
- *len = nLength;
-
- return S_OK;
+ hr = IXMLDOMText_get_data(iface, &data);
+ if(hr == S_OK)
+ {
+ *len = SysStringLen(data);
+ SysFreeString(data);
+ }
+
+ return hr;
}
static HRESULT WINAPI domtext_substringData(
@@ -545,11 +540,10 @@
LONG offset, LONG count, BSTR *p)
{
domtext *This = impl_from_IXMLDOMText( iface );
- xmlChar *pContent;
- LONG nLength = 0;
- HRESULT hr = S_FALSE;
-
- TRACE("%p\n", iface);
+ HRESULT hr;
+ BSTR data;
+
+ TRACE("(%p)->(%d %d %p)\n", This, offset, count, p);
if(!p)
return E_INVALIDARG;
@@ -559,26 +553,24 @@
return E_INVALIDARG;
if(count == 0)
- return hr;
-
- pContent = xmlNodeGetContent(This->node.node);
- if(pContent)
- {
- nLength = xmlStrlen(pContent);
-
- if( offset < nLength)
+ return S_FALSE;
+
+ hr = IXMLDOMText_get_data(iface, &data);
+ if(hr == S_OK)
+ {
+ LONG len = SysStringLen(data);
+
+ if(offset < len)
{
- BSTR sContent = bstr_from_xmlChar(pContent);
- if(offset + count > nLength)
- *p = SysAllocString(&sContent[offset]);
+ if(offset + count > len)
+ *p = SysAllocString(&data[offset]);
else
- *p = SysAllocStringLen(&sContent[offset], count);
-
- SysFreeString(sContent);
- hr = S_OK;
+ *p = SysAllocStringLen(&data[offset], count);
}
-
- xmlFree(pContent);
+ else
+ hr = S_FALSE;
+
+ SysFreeString(data);
}
return hr;
@@ -589,94 +581,77 @@
BSTR p)
{
domtext *This = impl_from_IXMLDOMText( iface );
- xmlChar *pContent;
- HRESULT hr = S_FALSE;
-
- TRACE("%p\n", iface);
+ HRESULT hr;
+ BSTR data;
+ LONG p_len;
+
+ TRACE("(%p)->(%s)\n", This, debugstr_w(p));
/* Nothing to do if NULL or an Empty string passed in. */
- if(p == NULL || SysStringLen(p) == 0)
+ if((p_len = SysStringLen(p)) == 0) return S_OK;
+
+ hr = IXMLDOMText_get_data(iface, &data);
+ if(hr == S_OK)
+ {
+ LONG len = SysStringLen(data);
+ BSTR str = SysAllocStringLen(NULL, p_len + len);
+
+ memcpy(str, data, len*sizeof(WCHAR));
+ memcpy(&str[len], p, p_len*sizeof(WCHAR));
+ str[len+p_len] = 0;
+
+ hr = IXMLDOMText_put_data(iface, str);
+
+ SysFreeString(str);
+ SysFreeString(data);
+ }
+
+ return hr;
+}
+
+static HRESULT WINAPI domtext_insertData(
+ IXMLDOMText *iface,
+ LONG offset, BSTR p)
+{
+ domtext *This = impl_from_IXMLDOMText( iface );
+ HRESULT hr;
+ BSTR data;
+ LONG p_len;
+
+ TRACE("(%p)->(%d %s)\n", This, offset, debugstr_w(p));
+
+ /* If have a NULL or empty string, don't do anything. */
+ if((p_len = SysStringLen(p)) == 0)
return S_OK;
- pContent = xmlChar_from_wchar( p );
- if(pContent)
- {
- if(xmlTextConcat(This->node.node, pContent, SysStringLen(p)) == 0)
- hr = S_OK;
- else
- hr = E_FAIL;
- heap_free( pContent );
- }
- else
- hr = E_FAIL;
-
- return hr;
-}
-
-static HRESULT WINAPI domtext_insertData(
- IXMLDOMText *iface,
- LONG offset, BSTR p)
-{
- domtext *This = impl_from_IXMLDOMText( iface );
- xmlChar *pXmlContent;
- BSTR sNewString;
- HRESULT hr = S_FALSE;
- LONG nLength = 0, nLengthP = 0;
- xmlChar *str = NULL;
-
- TRACE("%p\n", This);
-
- /* If have a NULL or empty string, don't do anything. */
- if(SysStringLen(p) == 0)
- return S_OK;
-
if(offset < 0)
{
return E_INVALIDARG;
}
- pXmlContent = xmlNodeGetContent(This->node.node);
- if(pXmlContent)
- {
- BSTR sContent = bstr_from_xmlChar( pXmlContent );
- nLength = SysStringLen(sContent);
- nLengthP = SysStringLen(p);
-
- if(nLength < offset)
+ hr = IXMLDOMText_get_data(iface, &data);
+ if(hr == S_OK)
+ {
+ LONG len = SysStringLen(data);
+ BSTR str;
+
+ if(len < offset)
{
- SysFreeString(sContent);
- xmlFree(pXmlContent);
-
+ SysFreeString(data);
return E_INVALIDARG;
}
- sNewString = SysAllocStringLen(NULL, nLength + nLengthP + 1);
- if(sNewString)
- {
- if(offset > 0)
- memcpy(sNewString, sContent, offset * sizeof(WCHAR));
-
- memcpy(&sNewString[offset], p, nLengthP * sizeof(WCHAR));
-
- if(offset+nLengthP < nLength)
- memcpy(&sNewString[offset+nLengthP], &sContent[offset],
(nLength-offset) * sizeof(WCHAR));
-
- sNewString[nLengthP + nLength] = 0;
-
- str = xmlChar_from_wchar(sNewString);
- if(str)
- {
- xmlNodeSetContent(This->node.node, str);
- hr = S_OK;
- }
- heap_free(str);
-
- SysFreeString(sNewString);
- }
-
- SysFreeString(sContent);
-
- xmlFree(pXmlContent);
+ str = SysAllocStringLen(NULL, len + p_len);
+ /* start part, supplied string and end part */
+ memcpy(str, data, offset*sizeof(WCHAR));
+ memcpy(&str[offset], p, p_len*sizeof(WCHAR));
+ memcpy(&str[offset+p_len], &data[offset], (len-offset)*sizeof(WCHAR));
+ str[len+p_len] = 0;
+
+ hr = IXMLDOMText_put_data(iface, str);
+
+ SysFreeString(str);
+ SysFreeString(data);
}
return hr;
@@ -690,7 +665,7 @@
LONG len = -1;
BSTR str;
- TRACE("%p %d %d\n", iface, offset, count);
+ TRACE("(%p)->(%d %d)\n", iface, offset, count);
hr = IXMLDOMText_get_length(iface, &len);
if(hr != S_OK) return hr;
@@ -733,15 +708,25 @@
IXMLDOMText *iface,
LONG offset, LONG count, BSTR p)
{
- FIXME("\n");
- return E_NOTIMPL;
+ domtext *This = impl_from_IXMLDOMText( iface );
+ HRESULT hr;
+
+ TRACE("(%p)->(%d %d %s)\n", This, offset, count, debugstr_w(p));
+
+ hr = IXMLDOMText_deleteData(iface, offset, count);
+
+ if (hr == S_OK)
+ hr = IXMLDOMText_insertData(iface, offset, p);
+
+ return hr;
}
static HRESULT WINAPI domtext_splitText(
IXMLDOMText *iface,
LONG offset, IXMLDOMText **txtNode)
{
- FIXME("\n");
+ domtext *This = impl_from_IXMLDOMText( iface );
+ FIXME("(%p)->(%d %p)\n", This, offset, txtNode);
return E_NOTIMPL;
}
Modified: trunk/reactos/include/psdk/msxml2.idl
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/msxml2.idl?re…
==============================================================================
--- trunk/reactos/include/psdk/msxml2.idl [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/msxml2.idl [iso-8859-1] Mon Mar 1 12:10:15 2010
@@ -1980,6 +1980,15 @@
};
[
+ uuid(7c6e29bc-8b8b-4c3d-859e-af6cd158be0f)
+]
+coclass SAXXMLReader40
+{
+ [default] interface IVBSAXXMLReader;
+ interface ISAXXMLReader;
+};
+
+[
uuid(fc220ad8-a72a-4ee8-926e-0b7ad152a020)
]
coclass MXXMLWriter