winecfg: Update Portuguese translation.
[wine/testsucceed.git] / dlls / msxml3 / element.c
blob617c008e288ebc325e82959947680818b701493c
1 /*
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, 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 "msxml2.h"
33 #include "msxml_private.h"
35 #include "wine/debug.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(msxml);
39 #ifdef HAVE_LIBXML2
41 typedef struct _domelem
43 xmlnode node;
44 const struct IXMLDOMElementVtbl *lpVtbl;
45 LONG ref;
46 } domelem;
48 static inline domelem *impl_from_IXMLDOMElement( IXMLDOMElement *iface )
50 return (domelem *)((char*)iface - FIELD_OFFSET(domelem, lpVtbl));
53 static inline xmlNodePtr get_element( domelem *This )
55 return This->node.node;
58 static HRESULT WINAPI domelem_QueryInterface(
59 IXMLDOMElement *iface,
60 REFIID riid,
61 void** ppvObject )
63 domelem *This = impl_from_IXMLDOMElement( iface );
65 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
67 if ( IsEqualGUID( riid, &IID_IXMLDOMElement ) ||
68 IsEqualGUID( riid, &IID_IDispatch ) ||
69 IsEqualGUID( riid, &IID_IUnknown ) )
71 *ppvObject = &This->lpVtbl;
73 else if ( IsEqualGUID( riid, &IID_IXMLDOMNode ) )
75 *ppvObject = IXMLDOMNode_from_impl(&This->node);
77 else if(dispex_query_interface(&This->node.dispex, riid, ppvObject))
79 return *ppvObject ? S_OK : E_NOINTERFACE;
81 else
83 FIXME("interface %s not implemented\n", debugstr_guid(riid));
84 return E_NOINTERFACE;
87 IUnknown_AddRef( (IUnknown*)*ppvObject );
88 return S_OK;
91 static ULONG WINAPI domelem_AddRef(
92 IXMLDOMElement *iface )
94 domelem *This = impl_from_IXMLDOMElement( iface );
95 LONG ref = InterlockedIncrement(&This->ref);
97 TRACE("(%p) ref=%d\n", This, ref);
99 return ref;
102 static ULONG WINAPI domelem_Release(
103 IXMLDOMElement *iface )
105 domelem *This = impl_from_IXMLDOMElement( iface );
106 ULONG ref = InterlockedDecrement(&This->ref);
108 TRACE("(%p) ref=%d\n", This, ref);
110 if(!ref) {
111 destroy_xmlnode(&This->node);
112 heap_free(This);
115 return ref;
118 static HRESULT WINAPI domelem_GetTypeInfoCount(
119 IXMLDOMElement *iface,
120 UINT* pctinfo )
122 domelem *This = impl_from_IXMLDOMElement( iface );
124 TRACE("(%p)->(%p)\n", This, pctinfo);
126 *pctinfo = 1;
128 return S_OK;
131 static HRESULT WINAPI domelem_GetTypeInfo(
132 IXMLDOMElement *iface,
133 UINT iTInfo, LCID lcid,
134 ITypeInfo** ppTInfo )
136 domelem *This = impl_from_IXMLDOMElement( iface );
137 HRESULT hr;
139 TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
141 hr = get_typeinfo(IXMLDOMElement_tid, ppTInfo);
143 return hr;
146 static HRESULT WINAPI domelem_GetIDsOfNames(
147 IXMLDOMElement *iface,
148 REFIID riid, LPOLESTR* rgszNames,
149 UINT cNames, LCID lcid, DISPID* rgDispId )
151 domelem *This = impl_from_IXMLDOMElement( iface );
152 ITypeInfo *typeinfo;
153 HRESULT hr;
155 TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
156 lcid, rgDispId);
158 if(!rgszNames || cNames == 0 || !rgDispId)
159 return E_INVALIDARG;
161 hr = get_typeinfo(IXMLDOMElement_tid, &typeinfo);
162 if(SUCCEEDED(hr))
164 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
165 ITypeInfo_Release(typeinfo);
168 return hr;
171 static HRESULT WINAPI domelem_Invoke(
172 IXMLDOMElement *iface,
173 DISPID dispIdMember, REFIID riid, LCID lcid,
174 WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult,
175 EXCEPINFO* pExcepInfo, UINT* puArgErr )
177 domelem *This = impl_from_IXMLDOMElement( iface );
178 ITypeInfo *typeinfo;
179 HRESULT hr;
181 TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
182 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
184 hr = get_typeinfo(IXMLDOMElement_tid, &typeinfo);
185 if(SUCCEEDED(hr))
187 hr = ITypeInfo_Invoke(typeinfo, &(This->lpVtbl), dispIdMember, wFlags, pDispParams,
188 pVarResult, pExcepInfo, puArgErr);
189 ITypeInfo_Release(typeinfo);
192 return hr;
195 static HRESULT WINAPI domelem_get_nodeName(
196 IXMLDOMElement *iface,
197 BSTR* p )
199 domelem *This = impl_from_IXMLDOMElement( iface );
200 return IXMLDOMNode_get_nodeName( IXMLDOMNode_from_impl(&This->node), p );
203 static HRESULT WINAPI domelem_get_nodeValue(
204 IXMLDOMElement *iface,
205 VARIANT* var1 )
207 domelem *This = impl_from_IXMLDOMElement( iface );
208 return IXMLDOMNode_get_nodeValue( IXMLDOMNode_from_impl(&This->node), var1 );
211 static HRESULT WINAPI domelem_put_nodeValue(
212 IXMLDOMElement *iface,
213 VARIANT var1 )
215 domelem *This = impl_from_IXMLDOMElement( iface );
216 return IXMLDOMNode_put_nodeValue( IXMLDOMNode_from_impl(&This->node), var1 );
219 static HRESULT WINAPI domelem_get_nodeType(
220 IXMLDOMElement *iface,
221 DOMNodeType* domNodeType )
223 domelem *This = impl_from_IXMLDOMElement( iface );
224 return IXMLDOMNode_get_nodeType( IXMLDOMNode_from_impl(&This->node), domNodeType );
227 static HRESULT WINAPI domelem_get_parentNode(
228 IXMLDOMElement *iface,
229 IXMLDOMNode** parent )
231 domelem *This = impl_from_IXMLDOMElement( iface );
232 return IXMLDOMNode_get_parentNode( IXMLDOMNode_from_impl(&This->node), parent );
235 static HRESULT WINAPI domelem_get_childNodes(
236 IXMLDOMElement *iface,
237 IXMLDOMNodeList** outList)
239 domelem *This = impl_from_IXMLDOMElement( iface );
240 return IXMLDOMNode_get_childNodes( IXMLDOMNode_from_impl(&This->node), outList );
243 static HRESULT WINAPI domelem_get_firstChild(
244 IXMLDOMElement *iface,
245 IXMLDOMNode** domNode)
247 domelem *This = impl_from_IXMLDOMElement( iface );
248 return IXMLDOMNode_get_firstChild( IXMLDOMNode_from_impl(&This->node), domNode );
251 static HRESULT WINAPI domelem_get_lastChild(
252 IXMLDOMElement *iface,
253 IXMLDOMNode** domNode)
255 domelem *This = impl_from_IXMLDOMElement( iface );
256 return IXMLDOMNode_get_lastChild( IXMLDOMNode_from_impl(&This->node), domNode );
259 static HRESULT WINAPI domelem_get_previousSibling(
260 IXMLDOMElement *iface,
261 IXMLDOMNode** domNode)
263 domelem *This = impl_from_IXMLDOMElement( iface );
264 return IXMLDOMNode_get_previousSibling( IXMLDOMNode_from_impl(&This->node), domNode );
267 static HRESULT WINAPI domelem_get_nextSibling(
268 IXMLDOMElement *iface,
269 IXMLDOMNode** domNode)
271 domelem *This = impl_from_IXMLDOMElement( iface );
272 return IXMLDOMNode_get_nextSibling( IXMLDOMNode_from_impl(&This->node), domNode );
275 static HRESULT WINAPI domelem_get_attributes(
276 IXMLDOMElement *iface,
277 IXMLDOMNamedNodeMap** attributeMap)
279 domelem *This = impl_from_IXMLDOMElement( iface );
280 return IXMLDOMNode_get_attributes( IXMLDOMNode_from_impl(&This->node), attributeMap );
283 static HRESULT WINAPI domelem_insertBefore(
284 IXMLDOMElement *iface,
285 IXMLDOMNode* newNode, VARIANT var1,
286 IXMLDOMNode** outOldNode)
288 domelem *This = impl_from_IXMLDOMElement( iface );
289 return IXMLDOMNode_insertBefore( IXMLDOMNode_from_impl(&This->node), newNode, var1, outOldNode );
292 static HRESULT WINAPI domelem_replaceChild(
293 IXMLDOMElement *iface,
294 IXMLDOMNode* newNode,
295 IXMLDOMNode* oldNode,
296 IXMLDOMNode** outOldNode)
298 domelem *This = impl_from_IXMLDOMElement( iface );
299 return IXMLDOMNode_replaceChild( IXMLDOMNode_from_impl(&This->node), newNode, oldNode, outOldNode );
302 static HRESULT WINAPI domelem_removeChild(
303 IXMLDOMElement *iface,
304 IXMLDOMNode* domNode, IXMLDOMNode** oldNode)
306 domelem *This = impl_from_IXMLDOMElement( iface );
307 return IXMLDOMNode_removeChild( IXMLDOMNode_from_impl(&This->node), domNode, oldNode );
310 static HRESULT WINAPI domelem_appendChild(
311 IXMLDOMElement *iface,
312 IXMLDOMNode* newNode, IXMLDOMNode** outNewNode)
314 domelem *This = impl_from_IXMLDOMElement( iface );
315 return IXMLDOMNode_appendChild( IXMLDOMNode_from_impl(&This->node), newNode, outNewNode );
318 static HRESULT WINAPI domelem_hasChildNodes(
319 IXMLDOMElement *iface,
320 VARIANT_BOOL* pbool)
322 domelem *This = impl_from_IXMLDOMElement( iface );
323 return IXMLDOMNode_hasChildNodes( IXMLDOMNode_from_impl(&This->node), pbool );
326 static HRESULT WINAPI domelem_get_ownerDocument(
327 IXMLDOMElement *iface,
328 IXMLDOMDocument** domDocument)
330 domelem *This = impl_from_IXMLDOMElement( iface );
331 return IXMLDOMNode_get_ownerDocument( IXMLDOMNode_from_impl(&This->node), domDocument );
334 static HRESULT WINAPI domelem_cloneNode(
335 IXMLDOMElement *iface,
336 VARIANT_BOOL pbool, IXMLDOMNode** outNode)
338 domelem *This = impl_from_IXMLDOMElement( iface );
339 return IXMLDOMNode_cloneNode( IXMLDOMNode_from_impl(&This->node), pbool, outNode );
342 static HRESULT WINAPI domelem_get_nodeTypeString(
343 IXMLDOMElement *iface,
344 BSTR* p)
346 domelem *This = impl_from_IXMLDOMElement( iface );
347 return IXMLDOMNode_get_nodeTypeString( IXMLDOMNode_from_impl(&This->node), p );
350 static HRESULT WINAPI domelem_get_text(
351 IXMLDOMElement *iface,
352 BSTR* p)
354 domelem *This = impl_from_IXMLDOMElement( iface );
355 return IXMLDOMNode_get_text( IXMLDOMNode_from_impl(&This->node), p );
358 static HRESULT WINAPI domelem_put_text(
359 IXMLDOMElement *iface,
360 BSTR p)
362 domelem *This = impl_from_IXMLDOMElement( iface );
363 return IXMLDOMNode_put_text( IXMLDOMNode_from_impl(&This->node), p );
366 static HRESULT WINAPI domelem_get_specified(
367 IXMLDOMElement *iface,
368 VARIANT_BOOL* pbool)
370 domelem *This = impl_from_IXMLDOMElement( iface );
371 return IXMLDOMNode_get_specified( IXMLDOMNode_from_impl(&This->node), pbool );
374 static HRESULT WINAPI domelem_get_definition(
375 IXMLDOMElement *iface,
376 IXMLDOMNode** domNode)
378 domelem *This = impl_from_IXMLDOMElement( iface );
379 return IXMLDOMNode_get_definition( IXMLDOMNode_from_impl(&This->node), domNode );
382 static HRESULT WINAPI domelem_get_nodeTypedValue(
383 IXMLDOMElement *iface,
384 VARIANT* var1)
386 domelem *This = impl_from_IXMLDOMElement( iface );
387 return IXMLDOMNode_get_nodeTypedValue( IXMLDOMNode_from_impl(&This->node), var1 );
390 static HRESULT WINAPI domelem_put_nodeTypedValue(
391 IXMLDOMElement *iface,
392 VARIANT var1)
394 domelem *This = impl_from_IXMLDOMElement( iface );
395 return IXMLDOMNode_put_nodeTypedValue( IXMLDOMNode_from_impl(&This->node), var1 );
398 static HRESULT WINAPI domelem_get_dataType(
399 IXMLDOMElement *iface,
400 VARIANT* var1)
402 domelem *This = impl_from_IXMLDOMElement( iface );
403 return IXMLDOMNode_get_dataType( IXMLDOMNode_from_impl(&This->node), var1 );
406 static HRESULT WINAPI domelem_put_dataType(
407 IXMLDOMElement *iface,
408 BSTR p)
410 domelem *This = impl_from_IXMLDOMElement( iface );
411 return IXMLDOMNode_put_dataType( IXMLDOMNode_from_impl(&This->node), p );
414 static HRESULT WINAPI domelem_get_xml(
415 IXMLDOMElement *iface,
416 BSTR* p)
418 domelem *This = impl_from_IXMLDOMElement( iface );
419 return IXMLDOMNode_get_xml( IXMLDOMNode_from_impl(&This->node), p );
422 static HRESULT WINAPI domelem_transformNode(
423 IXMLDOMElement *iface,
424 IXMLDOMNode* domNode, BSTR* p)
426 domelem *This = impl_from_IXMLDOMElement( iface );
427 return IXMLDOMNode_transformNode( IXMLDOMNode_from_impl(&This->node), domNode, p );
430 static HRESULT WINAPI domelem_selectNodes(
431 IXMLDOMElement *iface,
432 BSTR p, IXMLDOMNodeList** outList)
434 domelem *This = impl_from_IXMLDOMElement( iface );
435 return IXMLDOMNode_selectNodes( IXMLDOMNode_from_impl(&This->node), p, outList );
438 static HRESULT WINAPI domelem_selectSingleNode(
439 IXMLDOMElement *iface,
440 BSTR p, IXMLDOMNode** outNode)
442 domelem *This = impl_from_IXMLDOMElement( iface );
443 return IXMLDOMNode_selectSingleNode( IXMLDOMNode_from_impl(&This->node), p, outNode );
446 static HRESULT WINAPI domelem_get_parsed(
447 IXMLDOMElement *iface,
448 VARIANT_BOOL* pbool)
450 domelem *This = impl_from_IXMLDOMElement( iface );
451 return IXMLDOMNode_get_parsed( IXMLDOMNode_from_impl(&This->node), pbool );
454 static HRESULT WINAPI domelem_get_namespaceURI(
455 IXMLDOMElement *iface,
456 BSTR* p)
458 domelem *This = impl_from_IXMLDOMElement( iface );
459 return IXMLDOMNode_get_namespaceURI( IXMLDOMNode_from_impl(&This->node), p );
462 static HRESULT WINAPI domelem_get_prefix(
463 IXMLDOMElement *iface,
464 BSTR* p)
466 domelem *This = impl_from_IXMLDOMElement( iface );
467 return IXMLDOMNode_get_prefix( IXMLDOMNode_from_impl(&This->node), p );
470 static HRESULT WINAPI domelem_get_baseName(
471 IXMLDOMElement *iface,
472 BSTR* p)
474 domelem *This = impl_from_IXMLDOMElement( iface );
475 return IXMLDOMNode_get_baseName( IXMLDOMNode_from_impl(&This->node), p );
478 static HRESULT WINAPI domelem_transformNodeToObject(
479 IXMLDOMElement *iface,
480 IXMLDOMNode* domNode, VARIANT var1)
482 domelem *This = impl_from_IXMLDOMElement( iface );
483 return IXMLDOMNode_transformNodeToObject( IXMLDOMNode_from_impl(&This->node), domNode, var1 );
486 static HRESULT WINAPI domelem_get_tagName(
487 IXMLDOMElement *iface,
488 BSTR* p)
490 domelem *This = impl_from_IXMLDOMElement( iface );
491 xmlNodePtr element;
492 const xmlChar *prefix;
493 xmlChar *qname;
495 TRACE("(%p)->(%p)\n", This, p );
497 if (!p) return E_INVALIDARG;
499 element = get_element( This );
500 if ( !element )
501 return E_FAIL;
503 prefix = element->ns ? element->ns->prefix : NULL;
504 qname = xmlBuildQName(element->name, prefix, NULL, 0);
506 *p = bstr_from_xmlChar(qname);
507 if (qname != element->name) xmlFree(qname);
509 return *p ? S_OK : E_OUTOFMEMORY;
512 static HRESULT WINAPI domelem_getAttribute(
513 IXMLDOMElement *iface,
514 BSTR name, VARIANT* value)
516 domelem *This = impl_from_IXMLDOMElement( iface );
517 xmlNodePtr element;
518 xmlChar *xml_name, *xml_value = NULL;
519 HRESULT hr = S_FALSE;
521 TRACE("(%p)->(%s %p)\n", This, debugstr_w(name), value);
523 if(!value || !name)
524 return E_INVALIDARG;
526 element = get_element( This );
527 if ( !element )
528 return E_FAIL;
530 V_BSTR(value) = NULL;
531 V_VT(value) = VT_NULL;
533 xml_name = xmlChar_from_wchar( name );
535 if(!xmlValidateNameValue(xml_name))
536 hr = E_FAIL;
537 else
538 xml_value = xmlGetNsProp(element, xml_name, NULL);
540 heap_free(xml_name);
541 if(xml_value)
543 V_VT(value) = VT_BSTR;
544 V_BSTR(value) = bstr_from_xmlChar( xml_value );
545 xmlFree(xml_value);
546 hr = S_OK;
549 return hr;
552 static HRESULT WINAPI domelem_setAttribute(
553 IXMLDOMElement *iface,
554 BSTR name, VARIANT value)
556 domelem *This = impl_from_IXMLDOMElement( iface );
557 xmlNodePtr element;
558 xmlChar *xml_name, *xml_value;
559 HRESULT hr;
560 VARIANT var;
562 TRACE("(%p)->(%s var)\n", This, debugstr_w(name));
564 element = get_element( This );
565 if ( !element )
566 return E_FAIL;
568 VariantInit(&var);
569 hr = VariantChangeType(&var, &value, 0, VT_BSTR);
570 if(hr != S_OK)
572 FIXME("VariantChangeType failed\n");
573 return hr;
576 xml_name = xmlChar_from_wchar( name );
577 xml_value = xmlChar_from_wchar( V_BSTR(&var) );
579 if(!xmlSetNsProp(element, NULL, xml_name, xml_value))
580 hr = E_FAIL;
582 heap_free(xml_value);
583 heap_free(xml_name);
584 VariantClear(&var);
586 return hr;
589 static HRESULT WINAPI domelem_removeAttribute(
590 IXMLDOMElement *iface,
591 BSTR p)
593 domelem *This = impl_from_IXMLDOMElement( iface );
594 IXMLDOMNamedNodeMap *attr;
595 HRESULT hr;
597 TRACE("(%p)->(%s)\n", This, debugstr_w(p));
599 hr = IXMLDOMElement_get_attributes(iface, &attr);
600 if (hr != S_OK) return hr;
602 hr = IXMLDOMNamedNodeMap_removeNamedItem(attr, p, NULL);
603 IXMLDOMNamedNodeMap_Release(attr);
605 return hr;
608 static HRESULT WINAPI domelem_getAttributeNode(
609 IXMLDOMElement *iface,
610 BSTR p, IXMLDOMAttribute** attributeNode )
612 domelem *This = impl_from_IXMLDOMElement( iface );
613 xmlChar *xml_name;
614 xmlNodePtr element;
615 xmlAttrPtr attr;
616 IUnknown *unk;
617 HRESULT hr = S_FALSE;
619 TRACE("(%p)->(%s %p)\n", This, debugstr_w(p), attributeNode);
621 if(!attributeNode)
622 return E_FAIL;
624 *attributeNode = NULL;
626 element = get_element( This );
627 if ( !element )
628 return E_FAIL;
630 xml_name = xmlChar_from_wchar(p);
632 if(!xmlValidateNameValue(xml_name))
634 heap_free(xml_name);
635 return E_FAIL;
638 attr = xmlHasProp(element, xml_name);
639 if(attr) {
640 unk = create_attribute((xmlNodePtr)attr);
641 hr = IUnknown_QueryInterface(unk, &IID_IXMLDOMAttribute, (void**)attributeNode);
642 IUnknown_Release(unk);
645 heap_free(xml_name);
647 return hr;
650 static HRESULT WINAPI domelem_setAttributeNode(
651 IXMLDOMElement *iface,
652 IXMLDOMAttribute* domAttribute,
653 IXMLDOMAttribute** attributeNode)
655 domelem *This = impl_from_IXMLDOMElement( iface );
656 FIXME("(%p)->(%p %p)\n", This, domAttribute, attributeNode);
657 return E_NOTIMPL;
660 static HRESULT WINAPI domelem_removeAttributeNode(
661 IXMLDOMElement *iface,
662 IXMLDOMAttribute* domAttribute,
663 IXMLDOMAttribute** attributeNode)
665 domelem *This = impl_from_IXMLDOMElement( iface );
666 FIXME("(%p)->(%p %p)\n", This, domAttribute, attributeNode);
667 return E_NOTIMPL;
670 static HRESULT WINAPI domelem_getElementsByTagName(
671 IXMLDOMElement *iface,
672 BSTR bstrName, IXMLDOMNodeList** resultList)
674 static const WCHAR xpathformat[] =
675 { '.','/','/','*','[','l','o','c','a','l','-','n','a','m','e','(',')','=','\'','%','s','\'',']',0 };
676 domelem *This = impl_from_IXMLDOMElement( iface );
677 LPWSTR szPattern;
678 xmlNodePtr element;
679 HRESULT hr;
681 TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrName), resultList);
683 if (bstrName[0] == '*' && bstrName[1] == 0)
685 szPattern = heap_alloc(sizeof(WCHAR)*5);
686 szPattern[0] = '.';
687 szPattern[1] = szPattern[2] = '/';
688 szPattern[3] = '*';
689 szPattern[4] = 0;
691 else
693 szPattern = heap_alloc(sizeof(WCHAR)*(21+lstrlenW(bstrName)+1));
694 wsprintfW(szPattern, xpathformat, bstrName);
696 TRACE("%s\n", debugstr_w(szPattern));
698 element = get_element(This);
699 if (!element)
700 hr = E_FAIL;
701 else
702 hr = queryresult_create(element, szPattern, resultList);
703 heap_free(szPattern);
705 return hr;
708 static HRESULT WINAPI domelem_normalize(
709 IXMLDOMElement *iface )
711 domelem *This = impl_from_IXMLDOMElement( iface );
712 FIXME("%p\n", This);
713 return E_NOTIMPL;
716 static const struct IXMLDOMElementVtbl domelem_vtbl =
718 domelem_QueryInterface,
719 domelem_AddRef,
720 domelem_Release,
721 domelem_GetTypeInfoCount,
722 domelem_GetTypeInfo,
723 domelem_GetIDsOfNames,
724 domelem_Invoke,
725 domelem_get_nodeName,
726 domelem_get_nodeValue,
727 domelem_put_nodeValue,
728 domelem_get_nodeType,
729 domelem_get_parentNode,
730 domelem_get_childNodes,
731 domelem_get_firstChild,
732 domelem_get_lastChild,
733 domelem_get_previousSibling,
734 domelem_get_nextSibling,
735 domelem_get_attributes,
736 domelem_insertBefore,
737 domelem_replaceChild,
738 domelem_removeChild,
739 domelem_appendChild,
740 domelem_hasChildNodes,
741 domelem_get_ownerDocument,
742 domelem_cloneNode,
743 domelem_get_nodeTypeString,
744 domelem_get_text,
745 domelem_put_text,
746 domelem_get_specified,
747 domelem_get_definition,
748 domelem_get_nodeTypedValue,
749 domelem_put_nodeTypedValue,
750 domelem_get_dataType,
751 domelem_put_dataType,
752 domelem_get_xml,
753 domelem_transformNode,
754 domelem_selectNodes,
755 domelem_selectSingleNode,
756 domelem_get_parsed,
757 domelem_get_namespaceURI,
758 domelem_get_prefix,
759 domelem_get_baseName,
760 domelem_transformNodeToObject,
761 domelem_get_tagName,
762 domelem_getAttribute,
763 domelem_setAttribute,
764 domelem_removeAttribute,
765 domelem_getAttributeNode,
766 domelem_setAttributeNode,
767 domelem_removeAttributeNode,
768 domelem_getElementsByTagName,
769 domelem_normalize,
772 static const tid_t domelem_iface_tids[] = {
773 IXMLDOMElement_tid,
777 static dispex_static_data_t domelem_dispex = {
778 NULL,
779 IXMLDOMElement_tid,
780 NULL,
781 domelem_iface_tids
784 IUnknown* create_element( xmlNodePtr element )
786 domelem *This;
788 This = heap_alloc( sizeof *This );
789 if ( !This )
790 return NULL;
792 This->lpVtbl = &domelem_vtbl;
793 This->ref = 1;
795 init_xmlnode(&This->node, element, (IUnknown*)&This->lpVtbl, &domelem_dispex);
797 return (IUnknown*) &This->lpVtbl;
800 #endif