Release 20050930.
[wine/gsoc-2012-control.git] / dlls / msxml3 / domdoc.c
blob3415fd821e633a78e033435478c4cdb0267c7a14
1 /*
2 * DOM Document implementation
4 * Copyright 2005 Mike McCormack
6 * iface library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * iface library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #define COBJMACROS
23 #include "config.h"
25 #include <stdarg.h>
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winuser.h"
29 #include "winnls.h"
30 #include "ole2.h"
31 #include "ocidl.h"
32 #include "msxml.h"
33 #include "xmldom.h"
35 #include "wine/debug.h"
37 #include "msxml_private.h"
39 WINE_DEFAULT_DEBUG_CHANNEL(msxml);
41 #ifdef HAVE_LIBXML2
43 typedef struct _domdoc
45 const struct IXMLDOMDocumentVtbl *lpVtbl;
46 LONG ref;
47 VARIANT_BOOL async;
48 IXMLDOMNode *node;
49 } domdoc;
51 static inline domdoc *impl_from_IXMLDOMDocument( IXMLDOMDocument *iface )
53 return (domdoc *)((char*)iface - FIELD_OFFSET(domdoc, lpVtbl));
56 static inline xmlDocPtr get_doc( domdoc *This )
58 return (xmlDocPtr) xmlNodePtr_from_domnode( This->node, XML_DOCUMENT_NODE );
61 static HRESULT WINAPI domdoc_QueryInterface( IXMLDOMDocument *iface, REFIID riid, void** ppvObject )
63 domdoc *This = impl_from_IXMLDOMDocument( iface );
65 TRACE("%p %p %p\n", This, debugstr_guid( riid ), ppvObject );
67 if ( IsEqualGUID( riid, &IID_IXMLDOMDocument ) ||
68 IsEqualGUID( riid, &IID_IXMLDOMNode ) ||
69 IsEqualGUID( riid, &IID_IDispatch ) ||
70 IsEqualGUID( riid, &IID_IUnknown ) )
72 *ppvObject = iface;
74 else
75 return E_NOINTERFACE;
77 IXMLDOMDocument_AddRef( iface );
79 return S_OK;
83 static ULONG WINAPI domdoc_AddRef(
84 IXMLDOMDocument *iface )
86 domdoc *This = impl_from_IXMLDOMDocument( iface );
87 TRACE("%p\n", This );
88 return InterlockedIncrement( &This->ref );
92 static ULONG WINAPI domdoc_Release(
93 IXMLDOMDocument *iface )
95 domdoc *This = impl_from_IXMLDOMDocument( iface );
96 LONG ref;
98 TRACE("%p\n", This );
100 ref = InterlockedDecrement( &This->ref );
101 if ( ref == 0 )
103 IXMLDOMElement_Release( This->node );
104 HeapFree( GetProcessHeap(), 0, This );
107 return ref;
110 static HRESULT WINAPI domdoc_GetTypeInfoCount( IXMLDOMDocument *iface, UINT* pctinfo )
112 FIXME("\n");
113 return E_NOTIMPL;
116 static HRESULT WINAPI domdoc_GetTypeInfo(
117 IXMLDOMDocument *iface,
118 UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo )
120 FIXME("\n");
121 return E_NOTIMPL;
124 static HRESULT WINAPI domdoc_GetIDsOfNames(
125 IXMLDOMDocument *iface,
126 REFIID riid,
127 LPOLESTR* rgszNames,
128 UINT cNames,
129 LCID lcid,
130 DISPID* rgDispId)
132 FIXME("\n");
133 return E_NOTIMPL;
137 static HRESULT WINAPI domdoc_Invoke(
138 IXMLDOMDocument *iface,
139 DISPID dispIdMember,
140 REFIID riid,
141 LCID lcid,
142 WORD wFlags,
143 DISPPARAMS* pDispParams,
144 VARIANT* pVarResult,
145 EXCEPINFO* pExcepInfo,
146 UINT* puArgErr)
148 FIXME("\n");
149 return E_NOTIMPL;
153 static HRESULT WINAPI domdoc_get_nodeName(
154 IXMLDOMDocument *iface,
155 BSTR* name )
157 domdoc *This = impl_from_IXMLDOMDocument( iface );
158 return IXMLDOMNode_get_nodeName( This->node, name );
162 static HRESULT WINAPI domdoc_get_nodeValue(
163 IXMLDOMDocument *iface,
164 VARIANT* value )
166 domdoc *This = impl_from_IXMLDOMDocument( iface );
167 return IXMLDOMNode_get_nodeValue( This->node, value );
171 static HRESULT WINAPI domdoc_put_nodeValue(
172 IXMLDOMDocument *iface,
173 VARIANT value)
175 domdoc *This = impl_from_IXMLDOMDocument( iface );
176 return IXMLDOMNode_put_nodeValue( This->node, value );
180 static HRESULT WINAPI domdoc_get_nodeType(
181 IXMLDOMDocument *iface,
182 DOMNodeType* type )
184 domdoc *This = impl_from_IXMLDOMDocument( iface );
185 return IXMLDOMNode_get_nodeType( This->node, type );
189 static HRESULT WINAPI domdoc_get_parentNode(
190 IXMLDOMDocument *iface,
191 IXMLDOMNode** parent )
193 domdoc *This = impl_from_IXMLDOMDocument( iface );
194 return IXMLDOMNode_get_parentNode( This->node, parent );
198 static HRESULT WINAPI domdoc_get_childNodes(
199 IXMLDOMDocument *iface,
200 IXMLDOMNodeList** childList )
202 domdoc *This = impl_from_IXMLDOMDocument( iface );
203 return IXMLDOMNode_get_childNodes( This->node, childList );
207 static HRESULT WINAPI domdoc_get_firstChild(
208 IXMLDOMDocument *iface,
209 IXMLDOMNode** firstChild )
211 domdoc *This = impl_from_IXMLDOMDocument( iface );
212 return IXMLDOMNode_get_firstChild( This->node, firstChild );
216 static HRESULT WINAPI domdoc_get_lastChild(
217 IXMLDOMDocument *iface,
218 IXMLDOMNode** lastChild )
220 domdoc *This = impl_from_IXMLDOMDocument( iface );
221 return IXMLDOMNode_get_lastChild( This->node, lastChild );
225 static HRESULT WINAPI domdoc_get_previousSibling(
226 IXMLDOMDocument *iface,
227 IXMLDOMNode** previousSibling )
229 domdoc *This = impl_from_IXMLDOMDocument( iface );
230 return IXMLDOMNode_get_previousSibling( This->node, previousSibling );
234 static HRESULT WINAPI domdoc_get_nextSibling(
235 IXMLDOMDocument *iface,
236 IXMLDOMNode** nextSibling )
238 domdoc *This = impl_from_IXMLDOMDocument( iface );
239 return IXMLDOMNode_get_nextSibling( This->node, nextSibling );
243 static HRESULT WINAPI domdoc_get_attributes(
244 IXMLDOMDocument *iface,
245 IXMLDOMNamedNodeMap** attributeMap )
247 domdoc *This = impl_from_IXMLDOMDocument( iface );
248 return IXMLDOMNode_get_attributes( This->node, attributeMap );
252 static HRESULT WINAPI domdoc_insertBefore(
253 IXMLDOMDocument *iface,
254 IXMLDOMNode* newChild,
255 VARIANT refChild,
256 IXMLDOMNode** outNewChild )
258 domdoc *This = impl_from_IXMLDOMDocument( iface );
259 return IXMLDOMNode_insertBefore( This->node, newChild, refChild, outNewChild );
263 static HRESULT WINAPI domdoc_replaceChild(
264 IXMLDOMDocument *iface,
265 IXMLDOMNode* newChild,
266 IXMLDOMNode* oldChild,
267 IXMLDOMNode** outOldChild)
269 domdoc *This = impl_from_IXMLDOMDocument( iface );
270 return IXMLDOMNode_replaceChild( This->node, newChild, oldChild, outOldChild );
274 static HRESULT WINAPI domdoc_removeChild(
275 IXMLDOMDocument *iface,
276 IXMLDOMNode* childNode,
277 IXMLDOMNode** oldChild)
279 domdoc *This = impl_from_IXMLDOMDocument( iface );
280 return IXMLDOMNode_removeChild( This->node, childNode, oldChild );
284 static HRESULT WINAPI domdoc_appendChild(
285 IXMLDOMDocument *iface,
286 IXMLDOMNode* newChild,
287 IXMLDOMNode** outNewChild)
289 domdoc *This = impl_from_IXMLDOMDocument( iface );
290 return IXMLDOMNode_appendChild( This->node, newChild, outNewChild );
294 static HRESULT WINAPI domdoc_hasChildNodes(
295 IXMLDOMDocument *iface,
296 VARIANT_BOOL* hasChild)
298 domdoc *This = impl_from_IXMLDOMDocument( iface );
299 return IXMLDOMNode_hasChildNodes( This->node, hasChild );
303 static HRESULT WINAPI domdoc_get_ownerDocument(
304 IXMLDOMDocument *iface,
305 IXMLDOMDocument** DOMDocument)
307 domdoc *This = impl_from_IXMLDOMDocument( iface );
308 return IXMLDOMNode_get_ownerDocument( This->node, DOMDocument );
312 static HRESULT WINAPI domdoc_cloneNode(
313 IXMLDOMDocument *iface,
314 VARIANT_BOOL deep,
315 IXMLDOMNode** cloneRoot)
317 domdoc *This = impl_from_IXMLDOMDocument( iface );
318 return IXMLDOMNode_cloneNode( This->node, deep, cloneRoot );
322 static HRESULT WINAPI domdoc_get_nodeTypeString(
323 IXMLDOMDocument *iface,
324 BSTR* nodeType )
326 domdoc *This = impl_from_IXMLDOMDocument( iface );
327 return IXMLDOMNode_get_nodeTypeString( This->node, nodeType );
331 static HRESULT WINAPI domdoc_get_text(
332 IXMLDOMDocument *iface,
333 BSTR* text )
335 domdoc *This = impl_from_IXMLDOMDocument( iface );
336 return IXMLDOMNode_get_text( This->node, text );
340 static HRESULT WINAPI domdoc_put_text(
341 IXMLDOMDocument *iface,
342 BSTR text )
344 domdoc *This = impl_from_IXMLDOMDocument( iface );
345 return IXMLDOMNode_put_text( This->node, text );
349 static HRESULT WINAPI domdoc_get_specified(
350 IXMLDOMDocument *iface,
351 VARIANT_BOOL* isSpecified )
353 domdoc *This = impl_from_IXMLDOMDocument( iface );
354 return IXMLDOMNode_get_specified( This->node, isSpecified );
358 static HRESULT WINAPI domdoc_get_definition(
359 IXMLDOMDocument *iface,
360 IXMLDOMNode** definitionNode )
362 domdoc *This = impl_from_IXMLDOMDocument( iface );
363 return IXMLDOMNode_get_definition( This->node, definitionNode );
367 static HRESULT WINAPI domdoc_get_nodeTypedValue(
368 IXMLDOMDocument *iface,
369 VARIANT* typedValue )
371 domdoc *This = impl_from_IXMLDOMDocument( iface );
372 return IXMLDOMNode_get_nodeTypedValue( This->node, typedValue );
375 static HRESULT WINAPI domdoc_put_nodeTypedValue(
376 IXMLDOMDocument *iface,
377 VARIANT typedValue )
379 domdoc *This = impl_from_IXMLDOMDocument( iface );
380 return IXMLDOMNode_put_nodeTypedValue( This->node, typedValue );
384 static HRESULT WINAPI domdoc_get_dataType(
385 IXMLDOMDocument *iface,
386 VARIANT* dataTypeName )
388 domdoc *This = impl_from_IXMLDOMDocument( iface );
389 return IXMLDOMNode_get_dataType( This->node, dataTypeName );
393 static HRESULT WINAPI domdoc_put_dataType(
394 IXMLDOMDocument *iface,
395 BSTR dataTypeName )
397 domdoc *This = impl_from_IXMLDOMDocument( iface );
398 return IXMLDOMNode_put_dataType( This->node, dataTypeName );
402 static HRESULT WINAPI domdoc_get_xml(
403 IXMLDOMDocument *iface,
404 BSTR* xmlString )
406 domdoc *This = impl_from_IXMLDOMDocument( iface );
407 return IXMLDOMNode_get_xml( This->node, xmlString );
411 static HRESULT WINAPI domdoc_transformNode(
412 IXMLDOMDocument *iface,
413 IXMLDOMNode* styleSheet,
414 BSTR* xmlString )
416 domdoc *This = impl_from_IXMLDOMDocument( iface );
417 return IXMLDOMNode_transformNode( This->node, styleSheet, xmlString );
421 static HRESULT WINAPI domdoc_selectNodes(
422 IXMLDOMDocument *iface,
423 BSTR queryString,
424 IXMLDOMNodeList** resultList )
426 domdoc *This = impl_from_IXMLDOMDocument( iface );
427 return IXMLDOMNode_selectNodes( This->node, queryString, resultList );
431 static HRESULT WINAPI domdoc_selectSingleNode(
432 IXMLDOMDocument *iface,
433 BSTR queryString,
434 IXMLDOMNode** resultNode )
436 domdoc *This = impl_from_IXMLDOMDocument( iface );
437 return IXMLDOMNode_selectSingleNode( This->node, queryString, resultNode );
441 static HRESULT WINAPI domdoc_get_parsed(
442 IXMLDOMDocument *iface,
443 VARIANT_BOOL* isParsed )
445 domdoc *This = impl_from_IXMLDOMDocument( iface );
446 return IXMLDOMNode_get_parsed( This->node, isParsed );
450 static HRESULT WINAPI domdoc_get_namespaceURI(
451 IXMLDOMDocument *iface,
452 BSTR* namespaceURI )
454 domdoc *This = impl_from_IXMLDOMDocument( iface );
455 return IXMLDOMNode_get_namespaceURI( This->node, namespaceURI );
459 static HRESULT WINAPI domdoc_get_prefix(
460 IXMLDOMDocument *iface,
461 BSTR* prefixString )
463 domdoc *This = impl_from_IXMLDOMDocument( iface );
464 return IXMLDOMNode_get_prefix( This->node, prefixString );
468 static HRESULT WINAPI domdoc_get_baseName(
469 IXMLDOMDocument *iface,
470 BSTR* nameString )
472 domdoc *This = impl_from_IXMLDOMDocument( iface );
473 return IXMLDOMNode_get_baseName( This->node, nameString );
477 static HRESULT WINAPI domdoc_transformNodeToObject(
478 IXMLDOMDocument *iface,
479 IXMLDOMNode* stylesheet,
480 VARIANT outputObject)
482 domdoc *This = impl_from_IXMLDOMDocument( iface );
483 return IXMLDOMNode_transformNodeToObject( This->node, stylesheet, outputObject );
487 static HRESULT WINAPI domdoc_get_doctype(
488 IXMLDOMDocument *iface,
489 IXMLDOMDocument** documentType )
491 FIXME("\n");
492 return E_NOTIMPL;
496 static HRESULT WINAPI domdoc_get_implementation(
497 IXMLDOMDocument *iface,
498 IXMLDOMImplementation** impl )
500 FIXME("\n");
501 return E_NOTIMPL;
504 static HRESULT WINAPI domdoc_get_documentElement(
505 IXMLDOMDocument *iface,
506 IXMLDOMElement** DOMElement )
508 domdoc *This = impl_from_IXMLDOMDocument( iface );
509 xmlDocPtr xmldoc = NULL;
510 xmlNodePtr root = NULL;
512 TRACE("%p\n", This);
514 *DOMElement = NULL;
516 if ( !This->node )
517 return S_FALSE;
519 xmldoc = get_doc( This );
520 if ( !xmldoc )
521 return S_FALSE;
523 root = xmlDocGetRootElement( xmldoc );
524 if ( !root )
525 return S_FALSE;
527 *DOMElement = create_element( root );
529 return S_OK;
533 static HRESULT WINAPI domdoc_documentElement(
534 IXMLDOMDocument *iface,
535 IXMLDOMElement* DOMElement )
537 FIXME("\n");
538 return E_NOTIMPL;
542 static HRESULT WINAPI domdoc_createElement(
543 IXMLDOMDocument *iface,
544 BSTR tagname,
545 IXMLDOMElement** element )
547 FIXME("\n");
548 return E_NOTIMPL;
552 static HRESULT WINAPI domdoc_createDocumentFragment(
553 IXMLDOMDocument *iface,
554 IXMLDOMDocumentFragment** docFrag )
556 FIXME("\n");
557 return E_NOTIMPL;
561 static HRESULT WINAPI domdoc_createTextNode(
562 IXMLDOMDocument *iface,
563 BSTR data,
564 IXMLDOMText** text )
566 FIXME("\n");
567 return E_NOTIMPL;
571 static HRESULT WINAPI domdoc_createComment(
572 IXMLDOMDocument *iface,
573 BSTR data,
574 IXMLDOMComment** comment )
576 FIXME("\n");
577 return E_NOTIMPL;
581 static HRESULT WINAPI domdoc_createCDATASection(
582 IXMLDOMDocument *iface,
583 BSTR data,
584 IXMLDOMCDATASection** cdata )
586 FIXME("\n");
587 return E_NOTIMPL;
591 static HRESULT WINAPI domdoc_createProcessingInstruction(
592 IXMLDOMDocument *iface,
593 BSTR target,
594 BSTR data,
595 IXMLDOMProcessingInstruction** pi )
597 FIXME("\n");
598 return E_NOTIMPL;
602 static HRESULT WINAPI domdoc_createAttribute(
603 IXMLDOMDocument *iface,
604 BSTR name,
605 IXMLDOMAttribute** attribute )
607 FIXME("\n");
608 return E_NOTIMPL;
612 static HRESULT WINAPI domdoc_createEntityReference(
613 IXMLDOMDocument *iface,
614 BSTR name,
615 IXMLDOMEntityReference** entityRef )
617 FIXME("\n");
618 return E_NOTIMPL;
622 static HRESULT WINAPI domdoc_getElementsByTagName(
623 IXMLDOMDocument *iface,
624 BSTR tagName,
625 IXMLDOMNodeList** resultList )
627 FIXME("\n");
628 return E_NOTIMPL;
632 static HRESULT WINAPI domdoc_createNode(
633 IXMLDOMDocument *iface,
634 VARIANT Type,
635 BSTR name,
636 BSTR namespaceURI,
637 IXMLDOMNode** node )
639 FIXME("\n");
640 return E_NOTIMPL;
644 static HRESULT WINAPI domdoc_nodeFromID(
645 IXMLDOMDocument *iface,
646 BSTR idString,
647 IXMLDOMNode** node )
649 FIXME("\n");
650 return E_NOTIMPL;
653 static xmlDocPtr doparse( char *ptr, int len )
655 #ifdef HAVE_XMLREADMEMORY
657 * use xmlReadMemory if possible so we can suppress
658 * writing errors to stderr
660 return xmlReadMemory( ptr, len, NULL, NULL,
661 XML_PARSE_NOERROR | XML_PARSE_NOWARNING );
662 #else
663 return xmlParseMemory( ptr, len );
664 #endif
667 static xmlDocPtr doread( LPWSTR filename )
669 HANDLE handle, mapping;
670 DWORD len;
671 xmlDocPtr xmldoc = NULL;
672 char *ptr;
674 TRACE("%s\n", debugstr_w( filename ));
676 handle = CreateFileW( filename, GENERIC_READ, FILE_SHARE_READ,
677 NULL, OPEN_EXISTING, 0, NULL );
678 if( handle == INVALID_HANDLE_VALUE )
679 return xmldoc;
681 len = GetFileSize( handle, NULL );
682 if( len != INVALID_FILE_SIZE || GetLastError() == NO_ERROR )
684 mapping = CreateFileMappingW( handle, NULL, PAGE_READONLY, 0, 0, NULL );
685 if ( mapping )
687 ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, len );
688 if ( ptr )
690 xmldoc = doparse( ptr, len );
691 UnmapViewOfFile( ptr );
693 CloseHandle( mapping );
696 CloseHandle( handle );
698 return xmldoc;
702 static HRESULT WINAPI domdoc_load(
703 IXMLDOMDocument *iface,
704 VARIANT xmlSource,
705 VARIANT_BOOL* isSuccessful )
707 domdoc *This = impl_from_IXMLDOMDocument( iface );
708 LPWSTR filename = NULL;
709 xmlDocPtr xmldoc;
711 TRACE("type %d\n", V_VT(&xmlSource) );
713 if ( This->node )
715 IXMLDOMNode_Release( This->node );
716 This->node = NULL;
719 switch( V_VT(&xmlSource) )
721 case VT_BSTR:
722 filename = V_BSTR(&xmlSource);
725 if ( !filename )
726 return S_FALSE;
728 xmldoc = doread( filename );
729 if ( !xmldoc )
730 return S_FALSE;
732 This->node = create_node( (xmlNodePtr) xmldoc );
733 if ( !This->node )
735 *isSuccessful = VARIANT_FALSE;
736 return S_FALSE;
739 *isSuccessful = VARIANT_TRUE;
740 return S_OK;
744 static HRESULT WINAPI domdoc_get_readyState(
745 IXMLDOMDocument *iface,
746 long* value )
748 FIXME("\n");
749 return E_NOTIMPL;
753 static HRESULT WINAPI domdoc_get_parseError(
754 IXMLDOMDocument *iface,
755 IXMLDOMParseError** errorObj )
757 FIXME("\n");
758 return E_NOTIMPL;
762 static HRESULT WINAPI domdoc_get_url(
763 IXMLDOMDocument *iface,
764 BSTR* urlString )
766 FIXME("\n");
767 return E_NOTIMPL;
771 static HRESULT WINAPI domdoc_get_async(
772 IXMLDOMDocument *iface,
773 VARIANT_BOOL* isAsync )
775 domdoc *This = impl_from_IXMLDOMDocument( iface );
777 TRACE("%p <- %d\n", isAsync, This->async);
778 *isAsync = This->async;
779 return S_OK;
783 static HRESULT WINAPI domdoc_put_async(
784 IXMLDOMDocument *iface,
785 VARIANT_BOOL isAsync )
787 domdoc *This = impl_from_IXMLDOMDocument( iface );
789 TRACE("%d\n", isAsync);
790 This->async = isAsync;
791 return S_OK;
795 static HRESULT WINAPI domdoc_abort(
796 IXMLDOMDocument *iface )
798 FIXME("\n");
799 return E_NOTIMPL;
803 BOOL bstr_to_utf8( BSTR bstr, char **pstr, int *plen )
805 UINT len, blen = SysStringLen( bstr );
806 LPSTR str;
808 len = WideCharToMultiByte( CP_UTF8, 0, bstr, blen, NULL, 0, NULL, NULL );
809 str = HeapAlloc( GetProcessHeap(), 0, len );
810 if ( !str )
811 return FALSE;
812 WideCharToMultiByte( CP_UTF8, 0, bstr, blen, str, len, NULL, NULL );
813 *plen = len;
814 *pstr = str;
815 return TRUE;
818 static HRESULT WINAPI domdoc_loadXML(
819 IXMLDOMDocument *iface,
820 BSTR bstrXML,
821 VARIANT_BOOL* isSuccessful )
823 domdoc *This = impl_from_IXMLDOMDocument( iface );
824 xmlDocPtr xmldoc;
825 char *str;
826 int len;
828 TRACE("%p %s %p\n", This, debugstr_w( bstrXML ), isSuccessful );
830 if ( This->node )
832 IXMLDOMNode_Release( This->node );
833 This->node = NULL;
836 if ( !isSuccessful )
837 return S_FALSE;
839 *isSuccessful = VARIANT_FALSE;
841 if ( !bstrXML )
842 return S_FALSE;
844 if ( !bstr_to_utf8( bstrXML, &str, &len ) )
845 return S_FALSE;
847 xmldoc = doparse( str, len );
848 HeapFree( GetProcessHeap(), 0, str );
850 This->node = create_node( (xmlNodePtr) xmldoc );
851 if( !This->node )
852 return S_FALSE;
854 *isSuccessful = VARIANT_TRUE;
855 return S_OK;
859 static HRESULT WINAPI domdoc_save(
860 IXMLDOMDocument *iface,
861 VARIANT destination )
863 FIXME("\n");
864 return E_NOTIMPL;
867 static HRESULT WINAPI domdoc_get_validateOnParse(
868 IXMLDOMDocument *iface,
869 VARIANT_BOOL* isValidating )
871 FIXME("\n");
872 return E_NOTIMPL;
876 static HRESULT WINAPI domdoc_put_validateOnParse(
877 IXMLDOMDocument *iface,
878 VARIANT_BOOL isValidating )
880 FIXME("\n");
881 return E_NOTIMPL;
885 static HRESULT WINAPI domdoc_get_resolveExternals(
886 IXMLDOMDocument *iface,
887 VARIANT_BOOL* isResolving )
889 FIXME("\n");
890 return E_NOTIMPL;
894 static HRESULT WINAPI domdoc_put_resolveExternals(
895 IXMLDOMDocument *iface,
896 VARIANT_BOOL isValidating )
898 FIXME("\n");
899 return E_NOTIMPL;
903 static HRESULT WINAPI domdoc_get_preserveWhiteSpace(
904 IXMLDOMDocument *iface,
905 VARIANT_BOOL* isPreserving )
907 FIXME("\n");
908 return E_NOTIMPL;
912 static HRESULT WINAPI domdoc_put_preserveWhiteSpace(
913 IXMLDOMDocument *iface,
914 VARIANT_BOOL isPreserving )
916 FIXME("\n");
917 return E_NOTIMPL;
921 static HRESULT WINAPI domdoc_put_onReadyStateChange(
922 IXMLDOMDocument *iface,
923 VARIANT readyStateChangeSink )
925 FIXME("\n");
926 return E_NOTIMPL;
930 static HRESULT WINAPI domdoc_put_onDataAvailable(
931 IXMLDOMDocument *iface,
932 VARIANT onDataAvailableSink )
934 FIXME("\n");
935 return E_NOTIMPL;
938 static HRESULT WINAPI domdoc_put_onTransformNode(
939 IXMLDOMDocument *iface,
940 VARIANT onTransformNodeSink )
942 FIXME("\n");
943 return E_NOTIMPL;
946 const struct IXMLDOMDocumentVtbl domdoc_vtbl =
948 domdoc_QueryInterface,
949 domdoc_AddRef,
950 domdoc_Release,
951 domdoc_GetTypeInfoCount,
952 domdoc_GetTypeInfo,
953 domdoc_GetIDsOfNames,
954 domdoc_Invoke,
955 domdoc_get_nodeName,
956 domdoc_get_nodeValue,
957 domdoc_put_nodeValue,
958 domdoc_get_nodeType,
959 domdoc_get_parentNode,
960 domdoc_get_childNodes,
961 domdoc_get_firstChild,
962 domdoc_get_lastChild,
963 domdoc_get_previousSibling,
964 domdoc_get_nextSibling,
965 domdoc_get_attributes,
966 domdoc_insertBefore,
967 domdoc_replaceChild,
968 domdoc_removeChild,
969 domdoc_appendChild,
970 domdoc_hasChildNodes,
971 domdoc_get_ownerDocument,
972 domdoc_cloneNode,
973 domdoc_get_nodeTypeString,
974 domdoc_get_text,
975 domdoc_put_text,
976 domdoc_get_specified,
977 domdoc_get_definition,
978 domdoc_get_nodeTypedValue,
979 domdoc_put_nodeTypedValue,
980 domdoc_get_dataType,
981 domdoc_put_dataType,
982 domdoc_get_xml,
983 domdoc_transformNode,
984 domdoc_selectNodes,
985 domdoc_selectSingleNode,
986 domdoc_get_parsed,
987 domdoc_get_namespaceURI,
988 domdoc_get_prefix,
989 domdoc_get_baseName,
990 domdoc_transformNodeToObject,
991 domdoc_get_doctype,
992 domdoc_get_implementation,
993 domdoc_get_documentElement,
994 domdoc_documentElement,
995 domdoc_createElement,
996 domdoc_createDocumentFragment,
997 domdoc_createTextNode,
998 domdoc_createComment,
999 domdoc_createCDATASection,
1000 domdoc_createProcessingInstruction,
1001 domdoc_createAttribute,
1002 domdoc_createEntityReference,
1003 domdoc_getElementsByTagName,
1004 domdoc_createNode,
1005 domdoc_nodeFromID,
1006 domdoc_load,
1007 domdoc_get_readyState,
1008 domdoc_get_parseError,
1009 domdoc_get_url,
1010 domdoc_get_async,
1011 domdoc_put_async,
1012 domdoc_abort,
1013 domdoc_loadXML,
1014 domdoc_save,
1015 domdoc_get_validateOnParse,
1016 domdoc_put_validateOnParse,
1017 domdoc_get_resolveExternals,
1018 domdoc_put_resolveExternals,
1019 domdoc_get_preserveWhiteSpace,
1020 domdoc_put_preserveWhiteSpace,
1021 domdoc_put_onReadyStateChange,
1022 domdoc_put_onDataAvailable,
1023 domdoc_put_onTransformNode,
1026 HRESULT DOMDocument_create(IUnknown *pUnkOuter, LPVOID *ppObj)
1028 domdoc *doc;
1030 doc = HeapAlloc( GetProcessHeap(), 0, sizeof (*doc) );
1031 if( !doc )
1032 return E_OUTOFMEMORY;
1034 doc->lpVtbl = &domdoc_vtbl;
1035 doc->ref = 1;
1036 doc->async = 0;
1037 doc->node = NULL;
1039 *ppObj = &doc->lpVtbl;
1041 return S_OK;
1044 #else
1046 HRESULT DOMDocument_create(IUnknown *pUnkOuter, LPVOID *ppObj)
1048 MESSAGE("This program tried to use a DOMDocument object, but\n"
1049 "libxml2 support was not present at compile time.\n");
1050 return E_NOTIMPL;
1053 #endif