2 * DOM Document implementation
4 * Copyright 2005 Mike McCormack
6 * This 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 * This 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
34 #include "wine/debug.h"
36 #include "msxml_private.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(msxml);
42 typedef struct _domdoc
44 const struct IXMLDOMDocumentVtbl *lpVtbl;
51 LONG xmldoc_add_ref(xmlDocPtr doc)
53 LONG ref = InterlockedIncrement((LONG*)&doc->_private);
58 LONG xmldoc_release(xmlDocPtr doc)
60 LONG ref = InterlockedDecrement((LONG*)&doc->_private);
64 TRACE("freeing docptr %p\n", doc);
71 static inline domdoc *impl_from_IXMLDOMDocument( IXMLDOMDocument *iface )
73 return (domdoc *)((char*)iface - FIELD_OFFSET(domdoc, lpVtbl));
76 static inline xmlDocPtr get_doc( domdoc *This )
78 return (xmlDocPtr) xmlNodePtr_from_domnode( This->node, XML_DOCUMENT_NODE );
81 static HRESULT WINAPI domdoc_QueryInterface( IXMLDOMDocument *iface, REFIID riid, void** ppvObject )
83 domdoc *This = impl_from_IXMLDOMDocument( iface );
85 TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
87 if ( IsEqualGUID( riid, &IID_IXMLDOMDocument ) ||
88 IsEqualGUID( riid, &IID_IUnknown ) )
92 else if ( IsEqualGUID( riid, &IID_IXMLDOMNode ) ||
93 IsEqualGUID( riid, &IID_IDispatch ) )
95 return IUnknown_QueryInterface(This->node_unk, riid, ppvObject);
100 IXMLDOMDocument_AddRef( iface );
106 static ULONG WINAPI domdoc_AddRef(
107 IXMLDOMDocument *iface )
109 domdoc *This = impl_from_IXMLDOMDocument( iface );
110 TRACE("%p\n", This );
111 return InterlockedIncrement( &This->ref );
115 static ULONG WINAPI domdoc_Release(
116 IXMLDOMDocument *iface )
118 domdoc *This = impl_from_IXMLDOMDocument( iface );
121 TRACE("%p\n", This );
123 ref = InterlockedDecrement( &This->ref );
126 IUnknown_Release( This->node_unk );
127 HeapFree( GetProcessHeap(), 0, This );
133 static HRESULT WINAPI domdoc_GetTypeInfoCount( IXMLDOMDocument *iface, UINT* pctinfo )
139 static HRESULT WINAPI domdoc_GetTypeInfo(
140 IXMLDOMDocument *iface,
141 UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo )
147 static HRESULT WINAPI domdoc_GetIDsOfNames(
148 IXMLDOMDocument *iface,
160 static HRESULT WINAPI domdoc_Invoke(
161 IXMLDOMDocument *iface,
166 DISPPARAMS* pDispParams,
168 EXCEPINFO* pExcepInfo,
176 static HRESULT WINAPI domdoc_get_nodeName(
177 IXMLDOMDocument *iface,
180 domdoc *This = impl_from_IXMLDOMDocument( iface );
181 return IXMLDOMNode_get_nodeName( This->node, name );
185 static HRESULT WINAPI domdoc_get_nodeValue(
186 IXMLDOMDocument *iface,
189 domdoc *This = impl_from_IXMLDOMDocument( iface );
190 return IXMLDOMNode_get_nodeValue( This->node, value );
194 static HRESULT WINAPI domdoc_put_nodeValue(
195 IXMLDOMDocument *iface,
198 domdoc *This = impl_from_IXMLDOMDocument( iface );
199 return IXMLDOMNode_put_nodeValue( This->node, value );
203 static HRESULT WINAPI domdoc_get_nodeType(
204 IXMLDOMDocument *iface,
207 domdoc *This = impl_from_IXMLDOMDocument( iface );
208 return IXMLDOMNode_get_nodeType( This->node, type );
212 static HRESULT WINAPI domdoc_get_parentNode(
213 IXMLDOMDocument *iface,
214 IXMLDOMNode** parent )
216 domdoc *This = impl_from_IXMLDOMDocument( iface );
217 return IXMLDOMNode_get_parentNode( This->node, parent );
221 static HRESULT WINAPI domdoc_get_childNodes(
222 IXMLDOMDocument *iface,
223 IXMLDOMNodeList** childList )
225 domdoc *This = impl_from_IXMLDOMDocument( iface );
226 return IXMLDOMNode_get_childNodes( This->node, childList );
230 static HRESULT WINAPI domdoc_get_firstChild(
231 IXMLDOMDocument *iface,
232 IXMLDOMNode** firstChild )
234 domdoc *This = impl_from_IXMLDOMDocument( iface );
235 return IXMLDOMNode_get_firstChild( This->node, firstChild );
239 static HRESULT WINAPI domdoc_get_lastChild(
240 IXMLDOMDocument *iface,
241 IXMLDOMNode** lastChild )
243 domdoc *This = impl_from_IXMLDOMDocument( iface );
244 return IXMLDOMNode_get_lastChild( This->node, lastChild );
248 static HRESULT WINAPI domdoc_get_previousSibling(
249 IXMLDOMDocument *iface,
250 IXMLDOMNode** previousSibling )
252 domdoc *This = impl_from_IXMLDOMDocument( iface );
253 return IXMLDOMNode_get_previousSibling( This->node, previousSibling );
257 static HRESULT WINAPI domdoc_get_nextSibling(
258 IXMLDOMDocument *iface,
259 IXMLDOMNode** nextSibling )
261 domdoc *This = impl_from_IXMLDOMDocument( iface );
262 return IXMLDOMNode_get_nextSibling( This->node, nextSibling );
266 static HRESULT WINAPI domdoc_get_attributes(
267 IXMLDOMDocument *iface,
268 IXMLDOMNamedNodeMap** attributeMap )
270 domdoc *This = impl_from_IXMLDOMDocument( iface );
271 return IXMLDOMNode_get_attributes( This->node, attributeMap );
275 static HRESULT WINAPI domdoc_insertBefore(
276 IXMLDOMDocument *iface,
277 IXMLDOMNode* newChild,
279 IXMLDOMNode** outNewChild )
281 domdoc *This = impl_from_IXMLDOMDocument( iface );
282 return IXMLDOMNode_insertBefore( This->node, newChild, refChild, outNewChild );
286 static HRESULT WINAPI domdoc_replaceChild(
287 IXMLDOMDocument *iface,
288 IXMLDOMNode* newChild,
289 IXMLDOMNode* oldChild,
290 IXMLDOMNode** outOldChild)
292 domdoc *This = impl_from_IXMLDOMDocument( iface );
293 return IXMLDOMNode_replaceChild( This->node, newChild, oldChild, outOldChild );
297 static HRESULT WINAPI domdoc_removeChild(
298 IXMLDOMDocument *iface,
299 IXMLDOMNode* childNode,
300 IXMLDOMNode** oldChild)
302 domdoc *This = impl_from_IXMLDOMDocument( iface );
303 return IXMLDOMNode_removeChild( This->node, childNode, oldChild );
307 static HRESULT WINAPI domdoc_appendChild(
308 IXMLDOMDocument *iface,
309 IXMLDOMNode* newChild,
310 IXMLDOMNode** outNewChild)
312 domdoc *This = impl_from_IXMLDOMDocument( iface );
313 return IXMLDOMNode_appendChild( This->node, newChild, outNewChild );
317 static HRESULT WINAPI domdoc_hasChildNodes(
318 IXMLDOMDocument *iface,
319 VARIANT_BOOL* hasChild)
321 domdoc *This = impl_from_IXMLDOMDocument( iface );
322 return IXMLDOMNode_hasChildNodes( This->node, hasChild );
326 static HRESULT WINAPI domdoc_get_ownerDocument(
327 IXMLDOMDocument *iface,
328 IXMLDOMDocument** DOMDocument)
330 domdoc *This = impl_from_IXMLDOMDocument( iface );
331 return IXMLDOMNode_get_ownerDocument( This->node, DOMDocument );
335 static HRESULT WINAPI domdoc_cloneNode(
336 IXMLDOMDocument *iface,
338 IXMLDOMNode** cloneRoot)
340 domdoc *This = impl_from_IXMLDOMDocument( iface );
341 return IXMLDOMNode_cloneNode( This->node, deep, cloneRoot );
345 static HRESULT WINAPI domdoc_get_nodeTypeString(
346 IXMLDOMDocument *iface,
349 domdoc *This = impl_from_IXMLDOMDocument( iface );
350 return IXMLDOMNode_get_nodeTypeString( This->node, nodeType );
354 static HRESULT WINAPI domdoc_get_text(
355 IXMLDOMDocument *iface,
358 domdoc *This = impl_from_IXMLDOMDocument( iface );
359 return IXMLDOMNode_get_text( This->node, text );
363 static HRESULT WINAPI domdoc_put_text(
364 IXMLDOMDocument *iface,
367 domdoc *This = impl_from_IXMLDOMDocument( iface );
368 return IXMLDOMNode_put_text( This->node, text );
372 static HRESULT WINAPI domdoc_get_specified(
373 IXMLDOMDocument *iface,
374 VARIANT_BOOL* isSpecified )
376 domdoc *This = impl_from_IXMLDOMDocument( iface );
377 return IXMLDOMNode_get_specified( This->node, isSpecified );
381 static HRESULT WINAPI domdoc_get_definition(
382 IXMLDOMDocument *iface,
383 IXMLDOMNode** definitionNode )
385 domdoc *This = impl_from_IXMLDOMDocument( iface );
386 return IXMLDOMNode_get_definition( This->node, definitionNode );
390 static HRESULT WINAPI domdoc_get_nodeTypedValue(
391 IXMLDOMDocument *iface,
392 VARIANT* typedValue )
394 domdoc *This = impl_from_IXMLDOMDocument( iface );
395 return IXMLDOMNode_get_nodeTypedValue( This->node, typedValue );
398 static HRESULT WINAPI domdoc_put_nodeTypedValue(
399 IXMLDOMDocument *iface,
402 domdoc *This = impl_from_IXMLDOMDocument( iface );
403 return IXMLDOMNode_put_nodeTypedValue( This->node, typedValue );
407 static HRESULT WINAPI domdoc_get_dataType(
408 IXMLDOMDocument *iface,
409 VARIANT* dataTypeName )
411 domdoc *This = impl_from_IXMLDOMDocument( iface );
412 return IXMLDOMNode_get_dataType( This->node, dataTypeName );
416 static HRESULT WINAPI domdoc_put_dataType(
417 IXMLDOMDocument *iface,
420 domdoc *This = impl_from_IXMLDOMDocument( iface );
421 return IXMLDOMNode_put_dataType( This->node, dataTypeName );
425 static HRESULT WINAPI domdoc_get_xml(
426 IXMLDOMDocument *iface,
429 domdoc *This = impl_from_IXMLDOMDocument( iface );
430 return IXMLDOMNode_get_xml( This->node, xmlString );
434 static HRESULT WINAPI domdoc_transformNode(
435 IXMLDOMDocument *iface,
436 IXMLDOMNode* styleSheet,
439 domdoc *This = impl_from_IXMLDOMDocument( iface );
440 return IXMLDOMNode_transformNode( This->node, styleSheet, xmlString );
444 static HRESULT WINAPI domdoc_selectNodes(
445 IXMLDOMDocument *iface,
447 IXMLDOMNodeList** resultList )
449 domdoc *This = impl_from_IXMLDOMDocument( iface );
450 return IXMLDOMNode_selectNodes( This->node, queryString, resultList );
454 static HRESULT WINAPI domdoc_selectSingleNode(
455 IXMLDOMDocument *iface,
457 IXMLDOMNode** resultNode )
459 domdoc *This = impl_from_IXMLDOMDocument( iface );
460 return IXMLDOMNode_selectSingleNode( This->node, queryString, resultNode );
464 static HRESULT WINAPI domdoc_get_parsed(
465 IXMLDOMDocument *iface,
466 VARIANT_BOOL* isParsed )
468 domdoc *This = impl_from_IXMLDOMDocument( iface );
469 return IXMLDOMNode_get_parsed( This->node, isParsed );
473 static HRESULT WINAPI domdoc_get_namespaceURI(
474 IXMLDOMDocument *iface,
477 domdoc *This = impl_from_IXMLDOMDocument( iface );
478 return IXMLDOMNode_get_namespaceURI( This->node, namespaceURI );
482 static HRESULT WINAPI domdoc_get_prefix(
483 IXMLDOMDocument *iface,
486 domdoc *This = impl_from_IXMLDOMDocument( iface );
487 return IXMLDOMNode_get_prefix( This->node, prefixString );
491 static HRESULT WINAPI domdoc_get_baseName(
492 IXMLDOMDocument *iface,
495 domdoc *This = impl_from_IXMLDOMDocument( iface );
496 return IXMLDOMNode_get_baseName( This->node, nameString );
500 static HRESULT WINAPI domdoc_transformNodeToObject(
501 IXMLDOMDocument *iface,
502 IXMLDOMNode* stylesheet,
503 VARIANT outputObject)
505 domdoc *This = impl_from_IXMLDOMDocument( iface );
506 return IXMLDOMNode_transformNodeToObject( This->node, stylesheet, outputObject );
510 static HRESULT WINAPI domdoc_get_doctype(
511 IXMLDOMDocument *iface,
512 IXMLDOMDocumentType** documentType )
519 static HRESULT WINAPI domdoc_get_implementation(
520 IXMLDOMDocument *iface,
521 IXMLDOMImplementation** impl )
527 static HRESULT WINAPI domdoc_get_documentElement(
528 IXMLDOMDocument *iface,
529 IXMLDOMElement** DOMElement )
531 domdoc *This = impl_from_IXMLDOMDocument( iface );
532 xmlDocPtr xmldoc = NULL;
533 xmlNodePtr root = NULL;
534 IXMLDOMNode *element_node;
544 xmldoc = get_doc( This );
548 root = xmlDocGetRootElement( xmldoc );
552 element_node = create_node( root );
553 if(!element_node) return S_FALSE;
555 hr = IXMLDOMNode_QueryInterface(element_node, &IID_IXMLDOMElement, (LPVOID*)DOMElement);
556 IXMLDOMNode_Release(element_node);
562 static HRESULT WINAPI domdoc_documentElement(
563 IXMLDOMDocument *iface,
564 IXMLDOMElement* DOMElement )
571 static HRESULT WINAPI domdoc_createElement(
572 IXMLDOMDocument *iface,
574 IXMLDOMElement** element )
581 static HRESULT WINAPI domdoc_createDocumentFragment(
582 IXMLDOMDocument *iface,
583 IXMLDOMDocumentFragment** docFrag )
590 static HRESULT WINAPI domdoc_createTextNode(
591 IXMLDOMDocument *iface,
600 static HRESULT WINAPI domdoc_createComment(
601 IXMLDOMDocument *iface,
603 IXMLDOMComment** comment )
610 static HRESULT WINAPI domdoc_createCDATASection(
611 IXMLDOMDocument *iface,
613 IXMLDOMCDATASection** cdata )
620 static HRESULT WINAPI domdoc_createProcessingInstruction(
621 IXMLDOMDocument *iface,
624 IXMLDOMProcessingInstruction** pi )
631 static HRESULT WINAPI domdoc_createAttribute(
632 IXMLDOMDocument *iface,
634 IXMLDOMAttribute** attribute )
641 static HRESULT WINAPI domdoc_createEntityReference(
642 IXMLDOMDocument *iface,
644 IXMLDOMEntityReference** entityRef )
651 static HRESULT WINAPI domdoc_getElementsByTagName(
652 IXMLDOMDocument *iface,
654 IXMLDOMNodeList** resultList )
660 static DOMNodeType get_node_type(VARIANT Type)
662 if(V_VT(&Type) == VT_I4)
665 FIXME("Unsupported variant type %x\n", V_VT(&Type));
669 static HRESULT WINAPI domdoc_createNode(
670 IXMLDOMDocument *iface,
676 domdoc *This = impl_from_IXMLDOMDocument( iface );
677 DOMNodeType node_type;
678 xmlNodePtr xmlnode = NULL;
682 TRACE("(%p)->(type,%s,%s,%p)\n", This, debugstr_w(name), debugstr_w(namespaceURI), node);
684 node_type = get_node_type(Type);
685 TRACE("node_type %d\n", node_type);
687 xml_name = xmlChar_from_wchar((WCHAR*)name);
691 xmldoc = xmlNewDoc(NULL);
692 xmldoc->_private = 0;
693 attach_xmlnode(This->node, (xmlNodePtr) xmldoc);
699 xmlnode = xmlNewDocNode(get_doc(This), NULL, xml_name, NULL);
700 *node = create_node(xmlnode);
701 TRACE("created %p\n", xmlnode);
705 FIXME("unhandled node type %d\n", node_type);
709 HeapFree(GetProcessHeap(), 0, xml_name);
717 static HRESULT WINAPI domdoc_nodeFromID(
718 IXMLDOMDocument *iface,
726 static xmlDocPtr doparse( char *ptr, int len )
728 #ifdef HAVE_XMLREADMEMORY
730 * use xmlReadMemory if possible so we can suppress
731 * writing errors to stderr
733 return xmlReadMemory( ptr, len, NULL, NULL,
734 XML_PARSE_NOERROR | XML_PARSE_NOWARNING );
736 return xmlParseMemory( ptr, len );
740 static xmlDocPtr doread( LPWSTR filename )
742 HANDLE handle, mapping;
744 xmlDocPtr xmldoc = NULL;
747 TRACE("%s\n", debugstr_w( filename ));
749 handle = CreateFileW( filename, GENERIC_READ, FILE_SHARE_READ,
750 NULL, OPEN_EXISTING, 0, NULL );
751 if( handle == INVALID_HANDLE_VALUE )
754 len = GetFileSize( handle, NULL );
755 if( len != INVALID_FILE_SIZE || GetLastError() == NO_ERROR )
757 mapping = CreateFileMappingW( handle, NULL, PAGE_READONLY, 0, 0, NULL );
760 ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, len );
763 xmldoc = doparse( ptr, len );
764 UnmapViewOfFile( ptr );
766 CloseHandle( mapping );
769 CloseHandle( handle );
775 static HRESULT WINAPI domdoc_load(
776 IXMLDOMDocument *iface,
778 VARIANT_BOOL* isSuccessful )
780 domdoc *This = impl_from_IXMLDOMDocument( iface );
781 LPWSTR filename = NULL;
784 TRACE("type %d\n", V_VT(&xmlSource) );
786 *isSuccessful = VARIANT_FALSE;
788 assert( This->node );
790 attach_xmlnode(This->node, NULL);
792 switch( V_VT(&xmlSource) )
795 filename = V_BSTR(&xmlSource);
801 xmldoc = doread( filename );
802 if ( !xmldoc ) return S_FALSE;
804 xmldoc->_private = 0;
805 attach_xmlnode(This->node, (xmlNodePtr) xmldoc);
807 *isSuccessful = VARIANT_TRUE;
812 static HRESULT WINAPI domdoc_get_readyState(
813 IXMLDOMDocument *iface,
821 static HRESULT WINAPI domdoc_get_parseError(
822 IXMLDOMDocument *iface,
823 IXMLDOMParseError** errorObj )
825 FIXME("(%p)->(%p): creating a dummy parseError\n", iface, errorObj);
826 *errorObj = create_parseError(0, NULL, NULL, NULL, 0, 0, 0);
827 if(!*errorObj) return E_OUTOFMEMORY;
832 static HRESULT WINAPI domdoc_get_url(
833 IXMLDOMDocument *iface,
841 static HRESULT WINAPI domdoc_get_async(
842 IXMLDOMDocument *iface,
843 VARIANT_BOOL* isAsync )
845 domdoc *This = impl_from_IXMLDOMDocument( iface );
847 TRACE("%p <- %d\n", isAsync, This->async);
848 *isAsync = This->async;
853 static HRESULT WINAPI domdoc_put_async(
854 IXMLDOMDocument *iface,
855 VARIANT_BOOL isAsync )
857 domdoc *This = impl_from_IXMLDOMDocument( iface );
859 TRACE("%d\n", isAsync);
860 This->async = isAsync;
865 static HRESULT WINAPI domdoc_abort(
866 IXMLDOMDocument *iface )
873 BOOL bstr_to_utf8( BSTR bstr, char **pstr, int *plen )
875 UINT len, blen = SysStringLen( bstr );
878 len = WideCharToMultiByte( CP_UTF8, 0, bstr, blen, NULL, 0, NULL, NULL );
879 str = HeapAlloc( GetProcessHeap(), 0, len );
882 WideCharToMultiByte( CP_UTF8, 0, bstr, blen, str, len, NULL, NULL );
888 static HRESULT WINAPI domdoc_loadXML(
889 IXMLDOMDocument *iface,
891 VARIANT_BOOL* isSuccessful )
893 domdoc *This = impl_from_IXMLDOMDocument( iface );
898 TRACE("%p %s %p\n", This, debugstr_w( bstrXML ), isSuccessful );
900 assert ( This->node );
902 attach_xmlnode( This->node, NULL );
907 *isSuccessful = VARIANT_FALSE;
912 if ( !bstr_to_utf8( bstrXML, &str, &len ) )
915 xmldoc = doparse( str, len );
916 HeapFree( GetProcessHeap(), 0, str );
920 xmldoc->_private = 0;
921 attach_xmlnode( This->node, (xmlNodePtr) xmldoc );
923 *isSuccessful = VARIANT_TRUE;
928 static HRESULT WINAPI domdoc_save(
929 IXMLDOMDocument *iface,
930 VARIANT destination )
936 static HRESULT WINAPI domdoc_get_validateOnParse(
937 IXMLDOMDocument *iface,
938 VARIANT_BOOL* isValidating )
945 static HRESULT WINAPI domdoc_put_validateOnParse(
946 IXMLDOMDocument *iface,
947 VARIANT_BOOL isValidating )
954 static HRESULT WINAPI domdoc_get_resolveExternals(
955 IXMLDOMDocument *iface,
956 VARIANT_BOOL* isResolving )
963 static HRESULT WINAPI domdoc_put_resolveExternals(
964 IXMLDOMDocument *iface,
965 VARIANT_BOOL isValidating )
972 static HRESULT WINAPI domdoc_get_preserveWhiteSpace(
973 IXMLDOMDocument *iface,
974 VARIANT_BOOL* isPreserving )
981 static HRESULT WINAPI domdoc_put_preserveWhiteSpace(
982 IXMLDOMDocument *iface,
983 VARIANT_BOOL isPreserving )
990 static HRESULT WINAPI domdoc_put_onReadyStateChange(
991 IXMLDOMDocument *iface,
992 VARIANT readyStateChangeSink )
999 static HRESULT WINAPI domdoc_put_onDataAvailable(
1000 IXMLDOMDocument *iface,
1001 VARIANT onDataAvailableSink )
1007 static HRESULT WINAPI domdoc_put_onTransformNode(
1008 IXMLDOMDocument *iface,
1009 VARIANT onTransformNodeSink )
1015 const struct IXMLDOMDocumentVtbl domdoc_vtbl =
1017 domdoc_QueryInterface,
1020 domdoc_GetTypeInfoCount,
1022 domdoc_GetIDsOfNames,
1024 domdoc_get_nodeName,
1025 domdoc_get_nodeValue,
1026 domdoc_put_nodeValue,
1027 domdoc_get_nodeType,
1028 domdoc_get_parentNode,
1029 domdoc_get_childNodes,
1030 domdoc_get_firstChild,
1031 domdoc_get_lastChild,
1032 domdoc_get_previousSibling,
1033 domdoc_get_nextSibling,
1034 domdoc_get_attributes,
1035 domdoc_insertBefore,
1036 domdoc_replaceChild,
1039 domdoc_hasChildNodes,
1040 domdoc_get_ownerDocument,
1042 domdoc_get_nodeTypeString,
1045 domdoc_get_specified,
1046 domdoc_get_definition,
1047 domdoc_get_nodeTypedValue,
1048 domdoc_put_nodeTypedValue,
1049 domdoc_get_dataType,
1050 domdoc_put_dataType,
1052 domdoc_transformNode,
1054 domdoc_selectSingleNode,
1056 domdoc_get_namespaceURI,
1058 domdoc_get_baseName,
1059 domdoc_transformNodeToObject,
1061 domdoc_get_implementation,
1062 domdoc_get_documentElement,
1063 domdoc_documentElement,
1064 domdoc_createElement,
1065 domdoc_createDocumentFragment,
1066 domdoc_createTextNode,
1067 domdoc_createComment,
1068 domdoc_createCDATASection,
1069 domdoc_createProcessingInstruction,
1070 domdoc_createAttribute,
1071 domdoc_createEntityReference,
1072 domdoc_getElementsByTagName,
1076 domdoc_get_readyState,
1077 domdoc_get_parseError,
1084 domdoc_get_validateOnParse,
1085 domdoc_put_validateOnParse,
1086 domdoc_get_resolveExternals,
1087 domdoc_put_resolveExternals,
1088 domdoc_get_preserveWhiteSpace,
1089 domdoc_put_preserveWhiteSpace,
1090 domdoc_put_onReadyStateChange,
1091 domdoc_put_onDataAvailable,
1092 domdoc_put_onTransformNode,
1095 HRESULT DOMDocument_create(IUnknown *pUnkOuter, LPVOID *ppObj)
1100 TRACE("(%p,%p)\n", pUnkOuter, ppObj);
1102 doc = HeapAlloc( GetProcessHeap(), 0, sizeof (*doc) );
1104 return E_OUTOFMEMORY;
1106 doc->lpVtbl = &domdoc_vtbl;
1110 doc->node_unk = create_basic_node( NULL, (IUnknown*)&doc->lpVtbl );
1113 HeapFree(GetProcessHeap(), 0, doc);
1117 hr = IUnknown_QueryInterface(doc->node_unk, &IID_IXMLDOMNode, (LPVOID*)&doc->node);
1120 IUnknown_Release(doc->node_unk);
1121 HeapFree( GetProcessHeap(), 0, doc );
1124 /* The ref on doc->node is actually looped back into this object, so release it */
1125 IXMLDOMNode_Release(doc->node);
1127 *ppObj = &doc->lpVtbl;
1129 TRACE("returning iface %p\n", *ppObj);
1135 HRESULT DOMDocument_create(IUnknown *pUnkOuter, LPVOID *ppObj)
1137 MESSAGE("This program tried to use a DOMDocument object, but\n"
1138 "libxml2 support was not present at compile time.\n");