Unicodify wineesd.
[wine] / dlls / msxml3 / domdoc.c
1 /*
2  *    DOM Document implementation
3  *
4  * Copyright 2005 Mike McCormack
5  *
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.
10  *
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.
15  *
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
19  */
20
21 #define COBJMACROS
22
23 #include "config.h"
24
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"
34
35 #include "wine/debug.h"
36
37 #include "msxml_private.h"
38
39 WINE_DEFAULT_DEBUG_CHANNEL(msxml);
40
41 #ifdef HAVE_LIBXML2
42
43 typedef struct _domdoc
44 {
45     const struct IXMLDOMDocumentVtbl *lpVtbl;
46     LONG ref;
47     VARIANT_BOOL async;
48     IXMLDOMNode *node;
49 } domdoc;
50
51 static inline domdoc *impl_from_IXMLDOMDocument( IXMLDOMDocument *iface )
52 {
53     return (domdoc *)((char*)iface - FIELD_OFFSET(domdoc, lpVtbl));
54 }
55
56 static HRESULT WINAPI domdoc_QueryInterface( IXMLDOMDocument *iface, REFIID riid, void** ppvObject )
57 {
58     domdoc *This = impl_from_IXMLDOMDocument( iface );
59
60     TRACE("%p %p %p\n", This, debugstr_guid( riid ), ppvObject );
61
62     if ( IsEqualGUID( riid, &IID_IXMLDOMDocument ) ||
63          IsEqualGUID( riid, &IID_IXMLDOMNode ) ||
64          IsEqualGUID( riid, &IID_IDispatch ) ||
65          IsEqualGUID( riid, &IID_IUnknown ) )
66     {
67         *ppvObject = iface;
68     }
69     else
70         return E_NOINTERFACE;
71
72     IXMLDOMDocument_AddRef( iface );
73
74     return S_OK;
75 }
76
77
78 static ULONG WINAPI domdoc_AddRef(
79      IXMLDOMDocument *iface )
80 {
81     domdoc *This = impl_from_IXMLDOMDocument( iface );
82     TRACE("%p\n", This );
83     return InterlockedIncrement( &This->ref );
84 }
85
86
87 static ULONG WINAPI domdoc_Release(
88      IXMLDOMDocument *iface )
89 {
90     domdoc *This = impl_from_IXMLDOMDocument( iface );
91     LONG ref;
92
93     TRACE("%p\n", This );
94
95     ref = InterlockedDecrement( &This->ref );
96     if ( ref == 0 )
97     {
98         IXMLDOMElement_Release( This->node );
99         HeapFree( GetProcessHeap(), 0, This );
100     }
101
102     return ref;
103 }
104
105 static HRESULT WINAPI domdoc_GetTypeInfoCount( IXMLDOMDocument *iface, UINT* pctinfo )
106 {
107     FIXME("\n");
108     return E_NOTIMPL;
109 }
110
111 static HRESULT WINAPI domdoc_GetTypeInfo(
112     IXMLDOMDocument *iface,
113     UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo )
114 {
115     FIXME("\n");
116     return E_NOTIMPL;
117 }
118
119 static HRESULT WINAPI domdoc_GetIDsOfNames(
120     IXMLDOMDocument *iface,
121     REFIID riid,
122     LPOLESTR* rgszNames,
123     UINT cNames,
124     LCID lcid,
125     DISPID* rgDispId)
126 {
127     FIXME("\n");
128     return E_NOTIMPL;
129 }
130
131
132 static HRESULT WINAPI domdoc_Invoke(
133     IXMLDOMDocument *iface,
134     DISPID dispIdMember,
135     REFIID riid,
136     LCID lcid,
137     WORD wFlags,
138     DISPPARAMS* pDispParams,
139     VARIANT* pVarResult,
140     EXCEPINFO* pExcepInfo,
141     UINT* puArgErr)
142 {
143     FIXME("\n");
144     return E_NOTIMPL;
145 }
146
147
148 static HRESULT WINAPI domdoc_get_nodeName(
149     IXMLDOMDocument *iface,
150     BSTR* name )
151 {
152     FIXME("\n");
153     return E_NOTIMPL;
154 }
155
156
157 static HRESULT WINAPI domdoc_get_nodeValue(
158     IXMLDOMDocument *iface,
159     VARIANT* value )
160 {
161     FIXME("\n");
162     return E_NOTIMPL;
163 }
164
165
166 static HRESULT WINAPI domdoc_put_nodeValue(
167     IXMLDOMDocument *iface,
168     VARIANT value)
169 {
170     FIXME("\n");
171     return E_NOTIMPL;
172 }
173
174
175 static HRESULT WINAPI domdoc_get_nodeType(
176     IXMLDOMDocument *iface,
177     DOMNodeType* type )
178 {
179     FIXME("\n");
180     return E_NOTIMPL;
181 }
182
183
184 static HRESULT WINAPI domdoc_get_parentNode(
185     IXMLDOMDocument *iface,
186     IXMLDOMNode** parent )
187 {
188     FIXME("\n");
189     return E_NOTIMPL;
190 }
191
192
193 static HRESULT WINAPI domdoc_get_childNodes(
194     IXMLDOMDocument *iface,
195     IXMLDOMNodeList** childList )
196 {
197     FIXME("\n");
198     return E_NOTIMPL;
199 }
200
201
202 static HRESULT WINAPI domdoc_get_firstChild(
203     IXMLDOMDocument *iface,
204     IXMLDOMNode** firstChild )
205 {
206     FIXME("\n");
207     return E_NOTIMPL;
208 }
209
210
211 static HRESULT WINAPI domdoc_get_lastChild(
212     IXMLDOMDocument *iface,
213     IXMLDOMNode** lastChild )
214 {
215     FIXME("\n");
216     return E_NOTIMPL;
217 }
218
219
220 static HRESULT WINAPI domdoc_get_previousSibling(
221     IXMLDOMDocument *iface,
222     IXMLDOMNode** previousSibling )
223 {
224     FIXME("\n");
225     return E_NOTIMPL;
226 }
227
228
229 static HRESULT WINAPI domdoc_get_nextSibling(
230     IXMLDOMDocument *iface,
231     IXMLDOMNode** nextSibling )
232 {
233     FIXME("\n");
234     return E_NOTIMPL;
235 }
236
237
238 static HRESULT WINAPI domdoc_get_attributes(
239     IXMLDOMDocument *iface,
240     IXMLDOMNamedNodeMap** attributeMap )
241 {
242     FIXME("\n");
243     return E_NOTIMPL;
244 }
245
246
247 static HRESULT WINAPI domdoc_insertBefore(
248     IXMLDOMDocument *iface,
249     IXMLDOMNode* newChild,
250     VARIANT refChild,
251     IXMLDOMNode** outNewChild )
252 {
253     FIXME("\n");
254     return E_NOTIMPL;
255 }
256
257
258 static HRESULT WINAPI domdoc_replaceChild(
259     IXMLDOMDocument *iface,
260     IXMLDOMNode* newChild,
261     IXMLDOMNode* oldChild,
262     IXMLDOMNode** outOldChild)
263 {
264     FIXME("\n");
265     return E_NOTIMPL;
266 }
267
268
269 static HRESULT WINAPI domdoc_removeChild(
270     IXMLDOMDocument *iface,
271     IXMLDOMNode* childNode,
272     IXMLDOMNode** oldChild)
273 {
274     FIXME("\n");
275     return E_NOTIMPL;
276 }
277
278
279 static HRESULT WINAPI domdoc_appendChild(
280     IXMLDOMDocument *iface,
281     IXMLDOMNode* newChild,
282     IXMLDOMNode** outNewChild)
283 {
284     FIXME("\n");
285     return E_NOTIMPL;
286 }
287
288
289 static HRESULT WINAPI domdoc_hasChildNodes(
290     IXMLDOMDocument *iface,
291     VARIANT_BOOL* hasChild)
292 {
293     FIXME("\n");
294     return E_NOTIMPL;
295 }
296
297
298 static HRESULT WINAPI domdoc_get_ownerDocument(
299     IXMLDOMDocument *iface,
300     IXMLDOMDocument** DOMDocument)
301 {
302     FIXME("\n");
303     return E_NOTIMPL;
304 }
305
306
307 static HRESULT WINAPI domdoc_cloneNode(
308     IXMLDOMDocument *iface,
309     VARIANT_BOOL deep,
310     IXMLDOMNode** cloneRoot)
311 {
312     FIXME("\n");
313     return E_NOTIMPL;
314 }
315
316
317 static HRESULT WINAPI domdoc_get_nodeTypeString(
318     IXMLDOMDocument *iface,
319     BSTR* nodeType )
320 {
321     FIXME("\n");
322     return E_NOTIMPL;
323 }
324
325
326 static HRESULT WINAPI domdoc_get_text(
327     IXMLDOMDocument *iface,
328     BSTR* text )
329 {
330     FIXME("\n");
331     return E_NOTIMPL;
332 }
333
334
335 static HRESULT WINAPI domdoc_put_text(
336     IXMLDOMDocument *iface,
337     BSTR text )
338 {
339     FIXME("\n");
340     return E_NOTIMPL;
341 }
342
343
344 static HRESULT WINAPI domdoc_get_specified(
345     IXMLDOMDocument *iface,
346     VARIANT_BOOL* isSpecified )
347 {
348     FIXME("\n");
349     return E_NOTIMPL;
350 }
351
352
353 static HRESULT WINAPI domdoc_get_definition(
354     IXMLDOMDocument *iface,
355     IXMLDOMNode** definitionNode )
356 {
357     FIXME("\n");
358     return E_NOTIMPL;
359 }
360
361
362 static HRESULT WINAPI domdoc_get_nodeTypedValue(
363     IXMLDOMDocument *iface,
364     VARIANT* typedValue )
365 {
366     FIXME("\n");
367     return E_NOTIMPL;
368 }
369
370 static HRESULT WINAPI domdoc_put_nodeTypedValue(
371     IXMLDOMDocument *iface,
372     VARIANT typedValue )
373 {
374     FIXME("\n");
375     return E_NOTIMPL;
376 }
377
378
379 static HRESULT WINAPI domdoc_get_dataType(
380     IXMLDOMDocument *iface,
381     VARIANT* dataTypeName )
382 {
383     FIXME("\n");
384     return E_NOTIMPL;
385 }
386
387
388 static HRESULT WINAPI domdoc_put_dataType(
389     IXMLDOMDocument *iface,
390     BSTR dataTypeName )
391 {
392     FIXME("\n");
393     return E_NOTIMPL;
394 }
395
396
397 static HRESULT WINAPI domdoc_get_xml(
398     IXMLDOMDocument *iface,
399     BSTR* xmlString )
400 {
401     FIXME("\n");
402     return E_NOTIMPL;
403 }
404
405
406 static HRESULT WINAPI domdoc_transformNode(
407     IXMLDOMDocument *iface,
408     IXMLDOMNode* styleSheet,
409     BSTR* xmlString )
410 {
411     FIXME("\n");
412     return E_NOTIMPL;
413 }
414
415
416 static HRESULT WINAPI domdoc_selectNodes(
417     IXMLDOMDocument *iface,
418     BSTR queryString,
419     IXMLDOMNodeList** resultList )
420 {
421     FIXME("\n");
422     return E_NOTIMPL;
423 }
424
425
426 static HRESULT WINAPI domdoc_selectSingleNode(
427     IXMLDOMDocument *iface,
428     BSTR queryString,
429     IXMLDOMNode** resultNode )
430 {
431     FIXME("\n");
432     return E_NOTIMPL;
433 }
434
435
436 static HRESULT WINAPI domdoc_get_parsed(
437     IXMLDOMDocument *iface,
438     VARIANT_BOOL* isParsed )
439 {
440     FIXME("\n");
441     return E_NOTIMPL;
442 }
443
444
445 static HRESULT WINAPI domdoc_get_namespaceURI(
446     IXMLDOMDocument *iface,
447     BSTR* namespaceURI )
448 {
449     FIXME("\n");
450     return E_NOTIMPL;
451 }
452
453
454 static HRESULT WINAPI domdoc_get_prefix(
455     IXMLDOMDocument *iface,
456     BSTR* prefixString )
457 {
458     FIXME("\n");
459     return E_NOTIMPL;
460 }
461
462
463 static HRESULT WINAPI domdoc_get_baseName(
464     IXMLDOMDocument *iface,
465     BSTR* nameString )
466 {
467     FIXME("\n");
468     return E_NOTIMPL;
469 }
470
471
472 static HRESULT WINAPI domdoc_transformNodeToObject(
473     IXMLDOMDocument *iface,
474     IXMLDOMNode* stylesheet,
475     VARIANT outputObject)
476 {
477     FIXME("\n");
478     return E_NOTIMPL;
479 }
480
481
482 static HRESULT WINAPI domdoc_get_doctype(
483     IXMLDOMDocument *iface,
484     IXMLDOMDocument** documentType )
485 {
486     FIXME("\n");
487     return E_NOTIMPL;
488 }
489
490
491 static HRESULT WINAPI domdoc_get_implementation(
492     IXMLDOMDocument *iface,
493     IXMLDOMImplementation** impl )
494 {
495     FIXME("\n");
496     return E_NOTIMPL;
497 }
498
499 static HRESULT WINAPI domdoc_get_documentElement(
500     IXMLDOMDocument *iface,
501     IXMLDOMElement** DOMElement )
502 {
503     domdoc *This = impl_from_IXMLDOMDocument( iface );
504     xmlDocPtr xmldoc = NULL;
505     xmlNodePtr root = NULL;
506
507     TRACE("%p\n", This);
508
509     *DOMElement = NULL;
510
511     if ( !This->node )
512         return S_FALSE;
513
514     xmldoc = xmldoc_from_xmlnode( This->node );
515     if ( !xmldoc )
516         return S_FALSE;
517
518     root = xmlDocGetRootElement( xmldoc );
519     if ( !root )
520         return S_FALSE;
521
522     *DOMElement = create_element( root );
523  
524     return S_OK;
525 }
526
527
528 static HRESULT WINAPI domdoc_documentElement(
529     IXMLDOMDocument *iface,
530     IXMLDOMElement* DOMElement )
531 {
532     FIXME("\n");
533     return E_NOTIMPL;
534 }
535
536
537 static HRESULT WINAPI domdoc_createElement(
538     IXMLDOMDocument *iface,
539     BSTR tagname,
540     IXMLDOMElement** element )
541 {
542     FIXME("\n");
543     return E_NOTIMPL;
544 }
545
546
547 static HRESULT WINAPI domdoc_createDocumentFragment(
548     IXMLDOMDocument *iface,
549     IXMLDOMDocumentFragment** docFrag )
550 {
551     FIXME("\n");
552     return E_NOTIMPL;
553 }
554
555
556 static HRESULT WINAPI domdoc_createTextNode(
557     IXMLDOMDocument *iface,
558     BSTR data,
559     IXMLDOMText** text )
560 {
561     FIXME("\n");
562     return E_NOTIMPL;
563 }
564
565
566 static HRESULT WINAPI domdoc_createComment(
567     IXMLDOMDocument *iface,
568     BSTR data,
569     IXMLDOMComment** comment )
570 {
571     FIXME("\n");
572     return E_NOTIMPL;
573 }
574
575
576 static HRESULT WINAPI domdoc_createCDATASection(
577     IXMLDOMDocument *iface,
578     BSTR data,
579     IXMLDOMCDATASection** cdata )
580 {
581     FIXME("\n");
582     return E_NOTIMPL;
583 }
584
585
586 static HRESULT WINAPI domdoc_createProcessingInstruction(
587     IXMLDOMDocument *iface,
588     BSTR target,
589     BSTR data,
590     IXMLDOMProcessingInstruction** pi )
591 {
592     FIXME("\n");
593     return E_NOTIMPL;
594 }
595
596
597 static HRESULT WINAPI domdoc_createAttribute(
598     IXMLDOMDocument *iface,
599     BSTR name,
600     IXMLDOMAttribute** attribute )
601 {
602     FIXME("\n");
603     return E_NOTIMPL;
604 }
605
606
607 static HRESULT WINAPI domdoc_createEntityReference(
608     IXMLDOMDocument *iface,
609     BSTR name,
610     IXMLDOMEntityReference** entityRef )
611 {
612     FIXME("\n");
613     return E_NOTIMPL;
614 }
615
616
617 static HRESULT WINAPI domdoc_getElementsByTagName(
618     IXMLDOMDocument *iface,
619     BSTR tagName,
620     IXMLDOMNodeList** resultList )
621 {
622     FIXME("\n");
623     return E_NOTIMPL;
624 }
625
626
627 static HRESULT WINAPI domdoc_createNode(
628     IXMLDOMDocument *iface,
629     VARIANT Type,
630     BSTR name,
631     BSTR namespaceURI,
632     IXMLDOMNode** node )
633 {
634     FIXME("\n");
635     return E_NOTIMPL;
636 }
637
638
639 static HRESULT WINAPI domdoc_nodeFromID(
640     IXMLDOMDocument *iface,
641     BSTR idString,
642     IXMLDOMNode** node )
643 {
644     FIXME("\n");
645     return E_NOTIMPL;
646 }
647
648 static xmlDocPtr doread( LPWSTR filename )
649 {
650     HANDLE handle, mapping;
651     DWORD len;
652     xmlDocPtr xmldoc = NULL;
653     char *ptr;
654
655     TRACE("%s\n", debugstr_w( filename ));
656
657     handle = CreateFileW( filename, GENERIC_READ, FILE_SHARE_READ,
658                          NULL, OPEN_EXISTING, 0, NULL );
659     if( handle == INVALID_HANDLE_VALUE )
660         return xmldoc;
661
662     len = GetFileSize( handle, NULL );
663     if( len != INVALID_FILE_SIZE || GetLastError() == NO_ERROR )
664     {
665         mapping = CreateFileMappingW( handle, NULL, PAGE_READONLY, 0, 0, NULL );
666         if ( mapping )
667         {
668             ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, len );
669             if ( ptr )
670             {
671                 xmldoc = xmlParseMemory( ptr, len );
672                 UnmapViewOfFile( ptr );
673             }
674             CloseHandle( mapping );
675         }
676     }
677     CloseHandle( handle );
678
679     return xmldoc;
680 }
681
682
683 static HRESULT WINAPI domdoc_load(
684     IXMLDOMDocument *iface,
685     VARIANT xmlSource,
686     VARIANT_BOOL* isSuccessful )
687 {
688     domdoc *This = impl_from_IXMLDOMDocument( iface );
689     LPWSTR filename = NULL;
690     xmlDocPtr xmldoc;
691
692     TRACE("type %d\n", V_VT(&xmlSource) );
693
694     if ( This->node )
695     {
696         IXMLDOMNode_Release( This->node );
697         This->node = NULL;
698     }
699
700     switch( V_VT(&xmlSource) )
701     {
702     case VT_BSTR:
703         filename = V_BSTR(&xmlSource);
704     }
705
706     if ( !filename )
707         return S_FALSE;
708
709     xmldoc = doread( filename );
710     if ( !xmldoc )
711         return S_FALSE;
712
713     This->node = create_domdoc_node( xmldoc );
714     if ( !This->node )
715     {
716         *isSuccessful = VARIANT_FALSE;
717         return S_FALSE;
718     }
719
720     *isSuccessful = VARIANT_TRUE;
721     return S_OK;
722 }
723
724
725 static HRESULT WINAPI domdoc_get_readyState(
726     IXMLDOMDocument *iface,
727     long* value )
728 {
729     FIXME("\n");
730     return E_NOTIMPL;
731 }
732
733
734 static HRESULT WINAPI domdoc_get_parseError(
735     IXMLDOMDocument *iface,
736     IXMLDOMParseError** errorObj )
737 {
738     FIXME("\n");
739     return E_NOTIMPL;
740 }
741
742
743 static HRESULT WINAPI domdoc_get_url(
744     IXMLDOMDocument *iface,
745     BSTR* urlString )
746 {
747     FIXME("\n");
748     return E_NOTIMPL;
749 }
750
751
752 static HRESULT WINAPI domdoc_get_async(
753     IXMLDOMDocument *iface,
754     VARIANT_BOOL* isAsync )
755 {
756     domdoc *This = impl_from_IXMLDOMDocument( iface );
757
758     TRACE("%p <- %d\n", isAsync, This->async);
759     *isAsync = This->async;
760     return S_OK;
761 }
762
763
764 static HRESULT WINAPI domdoc_put_async(
765     IXMLDOMDocument *iface,
766     VARIANT_BOOL isAsync )
767 {
768     domdoc *This = impl_from_IXMLDOMDocument( iface );
769
770     TRACE("%d\n", isAsync);
771     This->async = isAsync;
772     return S_OK;
773 }
774
775
776 static HRESULT WINAPI domdoc_abort(
777     IXMLDOMDocument *iface )
778 {
779     FIXME("\n");
780     return E_NOTIMPL;
781 }
782
783
784 static HRESULT WINAPI domdoc_loadXML(
785     IXMLDOMDocument *iface,
786     BSTR bstrXML,
787     VARIANT_BOOL* isSuccessful )
788 {
789     FIXME("\n");
790     return E_NOTIMPL;
791 }
792
793
794 static HRESULT WINAPI domdoc_save(
795     IXMLDOMDocument *iface,
796     VARIANT destination )
797 {
798     FIXME("\n");
799     return E_NOTIMPL;
800 }
801
802 static HRESULT WINAPI domdoc_get_validateOnParse(
803     IXMLDOMDocument *iface,
804     VARIANT_BOOL* isValidating )
805 {
806     FIXME("\n");
807     return E_NOTIMPL;
808 }
809
810
811 static HRESULT WINAPI domdoc_put_validateOnParse(
812     IXMLDOMDocument *iface,
813     VARIANT_BOOL isValidating )
814 {
815     FIXME("\n");
816     return E_NOTIMPL;
817 }
818
819
820 static HRESULT WINAPI domdoc_get_resolveExternals(
821     IXMLDOMDocument *iface,
822     VARIANT_BOOL* isResolving )
823 {
824     FIXME("\n");
825     return E_NOTIMPL;
826 }
827
828
829 static HRESULT WINAPI domdoc_put_resolveExternals(
830     IXMLDOMDocument *iface,
831     VARIANT_BOOL isValidating )
832 {
833     FIXME("\n");
834     return E_NOTIMPL;
835 }
836
837
838 static HRESULT WINAPI domdoc_get_preserveWhiteSpace(
839     IXMLDOMDocument *iface,
840     VARIANT_BOOL* isPreserving )
841 {
842     FIXME("\n");
843     return E_NOTIMPL;
844 }
845
846
847 static HRESULT WINAPI domdoc_put_preserveWhiteSpace(
848     IXMLDOMDocument *iface,
849     VARIANT_BOOL isPreserving )
850 {
851     FIXME("\n");
852     return E_NOTIMPL;
853 }
854
855
856 static HRESULT WINAPI domdoc_put_onReadyStateChange(
857     IXMLDOMDocument *iface,
858     VARIANT readyStateChangeSink )
859 {
860     FIXME("\n");
861     return E_NOTIMPL;
862 }
863
864
865 static HRESULT WINAPI domdoc_put_onDataAvailable(
866     IXMLDOMDocument *iface,
867     VARIANT onDataAvailableSink )
868 {
869     FIXME("\n");
870     return E_NOTIMPL;
871 }
872
873 static HRESULT WINAPI domdoc_put_onTransformNode(
874     IXMLDOMDocument *iface,
875     VARIANT onTransformNodeSink )
876 {
877     FIXME("\n");
878     return E_NOTIMPL;
879 }
880
881 const struct IXMLDOMDocumentVtbl domdoc_vtbl =
882 {
883     domdoc_QueryInterface,
884     domdoc_AddRef,
885     domdoc_Release,
886     domdoc_GetTypeInfoCount,
887     domdoc_GetTypeInfo,
888     domdoc_GetIDsOfNames,
889     domdoc_Invoke,
890     domdoc_get_nodeName,
891     domdoc_get_nodeValue,
892     domdoc_put_nodeValue,
893     domdoc_get_nodeType,
894     domdoc_get_parentNode,
895     domdoc_get_childNodes,
896     domdoc_get_firstChild,
897     domdoc_get_lastChild,
898     domdoc_get_previousSibling,
899     domdoc_get_nextSibling,
900     domdoc_get_attributes,
901     domdoc_insertBefore,
902     domdoc_replaceChild,
903     domdoc_removeChild,
904     domdoc_appendChild,
905     domdoc_hasChildNodes,
906     domdoc_get_ownerDocument,
907     domdoc_cloneNode,
908     domdoc_get_nodeTypeString,
909     domdoc_get_text,
910     domdoc_put_text,
911     domdoc_get_specified,
912     domdoc_get_definition,
913     domdoc_get_nodeTypedValue,
914     domdoc_put_nodeTypedValue,
915     domdoc_get_dataType,
916     domdoc_put_dataType,
917     domdoc_get_xml,
918     domdoc_transformNode,
919     domdoc_selectNodes,
920     domdoc_selectSingleNode,
921     domdoc_get_parsed,
922     domdoc_get_namespaceURI,
923     domdoc_get_prefix,
924     domdoc_get_baseName,
925     domdoc_transformNodeToObject,
926     domdoc_get_doctype,
927     domdoc_get_implementation,
928     domdoc_get_documentElement,
929     domdoc_documentElement,
930     domdoc_createElement,
931     domdoc_createDocumentFragment,
932     domdoc_createTextNode,
933     domdoc_createComment,
934     domdoc_createCDATASection,
935     domdoc_createProcessingInstruction,
936     domdoc_createAttribute,
937     domdoc_createEntityReference,
938     domdoc_getElementsByTagName,
939     domdoc_createNode,
940     domdoc_nodeFromID,
941     domdoc_load,
942     domdoc_get_readyState,
943     domdoc_get_parseError,
944     domdoc_get_url,
945     domdoc_get_async,
946     domdoc_put_async,
947     domdoc_abort,
948     domdoc_loadXML,
949     domdoc_save,
950     domdoc_get_validateOnParse,
951     domdoc_put_validateOnParse,
952     domdoc_get_resolveExternals,
953     domdoc_put_resolveExternals,
954     domdoc_get_preserveWhiteSpace,
955     domdoc_put_preserveWhiteSpace,
956     domdoc_put_onReadyStateChange,
957     domdoc_put_onDataAvailable,
958     domdoc_put_onTransformNode,
959 };
960
961 HRESULT DOMDocument_create(IUnknown *pUnkOuter, LPVOID *ppObj)
962 {
963     domdoc *doc;
964
965     doc = HeapAlloc( GetProcessHeap(), 0, sizeof (*doc) );
966     if( !doc )
967         return E_OUTOFMEMORY;
968
969     doc->lpVtbl = &domdoc_vtbl;
970     doc->ref = 1;
971     doc->async = 0;
972     doc->node = NULL;
973
974     *ppObj = &doc->lpVtbl;
975
976     return S_OK;
977 }
978
979 #else
980
981 HRESULT DOMDocument_create(IUnknown *pUnkOuter, LPVOID *ppObj)
982 {
983     MESSAGE("This program tried to use a DOMDocument object, but\n"
984             "libxml2 support was not present at compile time.\n");
985     return E_NOTIMPL;
986 }
987
988 #endif