include: Add some more sublanguages and sort orders.
[wine] / dlls / msxml3 / pi.c
1 /*
2  *    DOM processing instruction node implementation
3  *
4  * Copyright 2006 Huw Davies
5  *
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.
10  *
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.
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20
21 #define COBJMACROS
22
23 #include "config.h"
24
25 #include <stdarg.h>
26 #ifdef HAVE_LIBXML2
27 # include <libxml/parser.h>
28 # include <libxml/xmlerror.h>
29 #endif
30
31 #include "windef.h"
32 #include "winbase.h"
33 #include "winuser.h"
34 #include "ole2.h"
35 #include "msxml6.h"
36
37 #include "msxml_private.h"
38
39 #include "wine/debug.h"
40
41 WINE_DEFAULT_DEBUG_CHANNEL(msxml);
42
43 #ifdef HAVE_LIBXML2
44
45 typedef struct _dom_pi
46 {
47     xmlnode node;
48     IXMLDOMProcessingInstruction IXMLDOMProcessingInstruction_iface;
49     LONG ref;
50 } dom_pi;
51
52 static inline dom_pi *impl_from_IXMLDOMProcessingInstruction( IXMLDOMProcessingInstruction *iface )
53 {
54     return CONTAINING_RECORD(iface, dom_pi, IXMLDOMProcessingInstruction_iface);
55 }
56
57 static HRESULT WINAPI dom_pi_QueryInterface(
58     IXMLDOMProcessingInstruction *iface,
59     REFIID riid,
60     void** ppvObject )
61 {
62     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
63     TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
64
65     if ( IsEqualGUID( riid, &IID_IXMLDOMProcessingInstruction ) ||
66          IsEqualGUID( riid, &IID_IXMLDOMNode ) ||
67          IsEqualGUID( riid, &IID_IDispatch ) ||
68          IsEqualGUID( riid, &IID_IUnknown ) )
69     {
70         *ppvObject = iface;
71     }
72     else if(node_query_interface(&This->node, riid, ppvObject))
73     {
74         return *ppvObject ? S_OK : E_NOINTERFACE;
75     }
76     else
77     {
78         TRACE("Unsupported interface %s\n", debugstr_guid(riid));
79         *ppvObject = NULL;
80         return E_NOINTERFACE;
81     }
82
83     IUnknown_AddRef((IUnknown*)*ppvObject);
84     return S_OK;
85 }
86
87 static ULONG WINAPI dom_pi_AddRef(
88     IXMLDOMProcessingInstruction *iface )
89 {
90     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
91     ULONG ref = InterlockedIncrement( &This->ref );
92     TRACE("(%p)->(%d)\n", This, ref);
93     return ref;
94 }
95
96 static ULONG WINAPI dom_pi_Release(
97     IXMLDOMProcessingInstruction *iface )
98 {
99     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
100     ULONG ref = InterlockedDecrement( &This->ref );
101
102     TRACE("(%p)->(%d)\n", This, ref);
103     if ( ref == 0 )
104     {
105         destroy_xmlnode(&This->node);
106         heap_free( This );
107     }
108
109     return ref;
110 }
111
112 static HRESULT WINAPI dom_pi_GetTypeInfoCount(
113     IXMLDOMProcessingInstruction *iface,
114     UINT* pctinfo )
115 {
116     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
117
118     TRACE("(%p)->(%p)\n", This, pctinfo);
119
120     *pctinfo = 1;
121
122     return S_OK;
123 }
124
125 static HRESULT WINAPI dom_pi_GetTypeInfo(
126     IXMLDOMProcessingInstruction *iface,
127     UINT iTInfo, LCID lcid,
128     ITypeInfo** ppTInfo )
129 {
130     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
131     HRESULT hr;
132
133     TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
134
135     hr = get_typeinfo(IXMLDOMProcessingInstruction_tid, ppTInfo);
136
137     return hr;
138 }
139
140 static HRESULT WINAPI dom_pi_GetIDsOfNames(
141     IXMLDOMProcessingInstruction *iface,
142     REFIID riid, LPOLESTR* rgszNames,
143     UINT cNames, LCID lcid, DISPID* rgDispId )
144 {
145     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
146     ITypeInfo *typeinfo;
147     HRESULT hr;
148
149     TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
150           lcid, rgDispId);
151
152     if(!rgszNames || cNames == 0 || !rgDispId)
153         return E_INVALIDARG;
154
155     hr = get_typeinfo(IXMLDOMProcessingInstruction_tid, &typeinfo);
156     if(SUCCEEDED(hr))
157     {
158         hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
159         ITypeInfo_Release(typeinfo);
160     }
161
162     return hr;
163 }
164
165 static HRESULT WINAPI dom_pi_Invoke(
166     IXMLDOMProcessingInstruction *iface,
167     DISPID dispIdMember, REFIID riid, LCID lcid,
168     WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult,
169     EXCEPINFO* pExcepInfo, UINT* puArgErr )
170 {
171     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
172     ITypeInfo *typeinfo;
173     HRESULT hr;
174
175     TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
176           lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
177
178     hr = get_typeinfo(IXMLDOMProcessingInstruction_tid, &typeinfo);
179     if(SUCCEEDED(hr))
180     {
181        hr = ITypeInfo_Invoke(typeinfo, &This->IXMLDOMProcessingInstruction_iface, dispIdMember,
182                 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
183         ITypeInfo_Release(typeinfo);
184     }
185
186     return hr;
187 }
188
189 static HRESULT WINAPI dom_pi_get_nodeName(
190     IXMLDOMProcessingInstruction *iface,
191     BSTR* p )
192 {
193     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
194
195     TRACE("(%p)->(%p)\n", This, p);
196
197     return node_get_nodeName(&This->node, p);
198 }
199
200 static HRESULT WINAPI dom_pi_get_nodeValue(
201     IXMLDOMProcessingInstruction *iface,
202     VARIANT* value)
203 {
204     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
205
206     TRACE("(%p)->(%p)\n", This, value);
207
208     return node_get_content(&This->node, value);
209 }
210
211 static HRESULT WINAPI dom_pi_put_nodeValue(
212     IXMLDOMProcessingInstruction *iface,
213     VARIANT value)
214 {
215     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
216     BSTR sTarget;
217     HRESULT hr;
218
219     TRACE("(%p)->(%s)\n", This, debugstr_variant(&value));
220
221     /* Cannot set data to a PI node whose target is 'xml' */
222     hr = dom_pi_get_nodeName(iface, &sTarget);
223     if(hr == S_OK)
224     {
225         static const WCHAR xmlW[] = {'x','m','l',0};
226         if(lstrcmpW( sTarget, xmlW) == 0)
227         {
228             SysFreeString(sTarget);
229             return E_FAIL;
230         }
231
232         SysFreeString(sTarget);
233     }
234
235     return node_put_value(&This->node, &value);
236 }
237
238 static HRESULT WINAPI dom_pi_get_nodeType(
239     IXMLDOMProcessingInstruction *iface,
240     DOMNodeType* domNodeType )
241 {
242     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
243
244     TRACE("(%p)->(%p)\n", This, domNodeType);
245
246     *domNodeType = NODE_PROCESSING_INSTRUCTION;
247     return S_OK;
248 }
249
250 static HRESULT WINAPI dom_pi_get_parentNode(
251     IXMLDOMProcessingInstruction *iface,
252     IXMLDOMNode** parent )
253 {
254     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
255
256     TRACE("(%p)->(%p)\n", This, parent);
257
258     return node_get_parent(&This->node, parent);
259 }
260
261 static HRESULT WINAPI dom_pi_get_childNodes(
262     IXMLDOMProcessingInstruction *iface,
263     IXMLDOMNodeList** outList)
264 {
265     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
266
267     TRACE("(%p)->(%p)\n", This, outList);
268
269     return node_get_child_nodes(&This->node, outList);
270 }
271
272 static HRESULT WINAPI dom_pi_get_firstChild(
273     IXMLDOMProcessingInstruction *iface,
274     IXMLDOMNode** domNode)
275 {
276     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
277
278     TRACE("(%p)->(%p)\n", This, domNode);
279
280     return return_null_node(domNode);
281 }
282
283 static HRESULT WINAPI dom_pi_get_lastChild(
284     IXMLDOMProcessingInstruction *iface,
285     IXMLDOMNode** domNode)
286 {
287     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
288
289     TRACE("(%p)->(%p)\n", This, domNode);
290
291     return return_null_node(domNode);
292 }
293
294 static HRESULT WINAPI dom_pi_get_previousSibling(
295     IXMLDOMProcessingInstruction *iface,
296     IXMLDOMNode** domNode)
297 {
298     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
299
300     TRACE("(%p)->(%p)\n", This, domNode);
301
302     return node_get_previous_sibling(&This->node, domNode);
303 }
304
305 static HRESULT WINAPI dom_pi_get_nextSibling(
306     IXMLDOMProcessingInstruction *iface,
307     IXMLDOMNode** domNode)
308 {
309     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
310
311     TRACE("(%p)->(%p)\n", This, domNode);
312
313     return node_get_next_sibling(&This->node, domNode);
314 }
315
316 static HRESULT WINAPI dom_pi_get_attributes(
317     IXMLDOMProcessingInstruction *iface,
318     IXMLDOMNamedNodeMap** map)
319 {
320     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
321     static const WCHAR xmlW[] = {'x','m','l',0};
322     HRESULT hr;
323     BSTR name;
324
325     TRACE("(%p)->(%p)\n", This, map);
326
327     if (!map) return E_INVALIDARG;
328
329     *map = NULL;
330
331     hr = node_get_nodeName(&This->node, &name);
332     if (hr != S_OK) return hr;
333
334     if (!strcmpW(name, xmlW))
335     {
336         FIXME("created dummy map for <?xml ?>\n");
337         *map = create_nodemap(This->node.node);
338         SysFreeString(name);
339         return S_OK;
340     }
341
342     SysFreeString(name);
343
344     return S_FALSE;
345 }
346
347 static HRESULT WINAPI dom_pi_insertBefore(
348     IXMLDOMProcessingInstruction *iface,
349     IXMLDOMNode* newNode, VARIANT refChild,
350     IXMLDOMNode** outOldNode)
351 {
352     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
353
354     FIXME("(%p)->(%p %s %p) needs test\n", This, newNode, debugstr_variant(&refChild), outOldNode);
355
356     return node_insert_before(&This->node, newNode, &refChild, outOldNode);
357 }
358
359 static HRESULT WINAPI dom_pi_replaceChild(
360     IXMLDOMProcessingInstruction *iface,
361     IXMLDOMNode* newNode,
362     IXMLDOMNode* oldNode,
363     IXMLDOMNode** outOldNode)
364 {
365     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
366
367     FIXME("(%p)->(%p %p %p) needs test\n", This, newNode, oldNode, outOldNode);
368
369     return node_replace_child(&This->node, newNode, oldNode, outOldNode);
370 }
371
372 static HRESULT WINAPI dom_pi_removeChild(
373     IXMLDOMProcessingInstruction *iface,
374     IXMLDOMNode *child, IXMLDOMNode **oldChild)
375 {
376     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
377     TRACE("(%p)->(%p %p)\n", This, child, oldChild);
378     return node_remove_child(&This->node, child, oldChild);
379 }
380
381 static HRESULT WINAPI dom_pi_appendChild(
382     IXMLDOMProcessingInstruction *iface,
383     IXMLDOMNode *child, IXMLDOMNode **outChild)
384 {
385     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
386     TRACE("(%p)->(%p %p)\n", This, child, outChild);
387     return node_append_child(&This->node, child, outChild);
388 }
389
390 static HRESULT WINAPI dom_pi_hasChildNodes(
391     IXMLDOMProcessingInstruction *iface,
392     VARIANT_BOOL *ret)
393 {
394     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
395     TRACE("(%p)->(%p)\n", This, ret);
396     return node_has_childnodes(&This->node, ret);
397 }
398
399 static HRESULT WINAPI dom_pi_get_ownerDocument(
400     IXMLDOMProcessingInstruction *iface,
401     IXMLDOMDocument **doc)
402 {
403     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
404     TRACE("(%p)->(%p)\n", This, doc);
405     return node_get_owner_doc(&This->node, doc);
406 }
407
408 static HRESULT WINAPI dom_pi_cloneNode(
409     IXMLDOMProcessingInstruction *iface,
410     VARIANT_BOOL deep, IXMLDOMNode** outNode)
411 {
412     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
413     TRACE("(%p)->(%d %p)\n", This, deep, outNode);
414     return node_clone( &This->node, deep, outNode );
415 }
416
417 static HRESULT WINAPI dom_pi_get_nodeTypeString(
418     IXMLDOMProcessingInstruction *iface,
419     BSTR* p)
420 {
421     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
422     static const WCHAR processinginstructionW[] =
423         {'p','r','o','c','e','s','s','i','n','g','i','n','s','t','r','u','c','t','i','o','n',0};
424
425     TRACE("(%p)->(%p)\n", This, p);
426
427     return return_bstr(processinginstructionW, p);
428 }
429
430 static HRESULT WINAPI dom_pi_get_text(
431     IXMLDOMProcessingInstruction *iface,
432     BSTR* p)
433 {
434     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
435     TRACE("(%p)->(%p)\n", This, p);
436     return node_get_text(&This->node, p);
437 }
438
439 static HRESULT WINAPI dom_pi_put_text(
440     IXMLDOMProcessingInstruction *iface,
441     BSTR p)
442 {
443     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
444     TRACE("(%p)->(%s)\n", This, debugstr_w(p));
445     return node_put_text( &This->node, p );
446 }
447
448 static HRESULT WINAPI dom_pi_get_specified(
449     IXMLDOMProcessingInstruction *iface,
450     VARIANT_BOOL* isSpecified)
451 {
452     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
453     FIXME("(%p)->(%p) stub!\n", This, isSpecified);
454     *isSpecified = VARIANT_TRUE;
455     return S_OK;
456 }
457
458 static HRESULT WINAPI dom_pi_get_definition(
459     IXMLDOMProcessingInstruction *iface,
460     IXMLDOMNode** definitionNode)
461 {
462     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
463     FIXME("(%p)->(%p)\n", This, definitionNode);
464     return E_NOTIMPL;
465 }
466
467 static HRESULT WINAPI dom_pi_get_nodeTypedValue(
468     IXMLDOMProcessingInstruction *iface,
469     VARIANT* v)
470 {
471     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
472     TRACE("(%p)->(%p)\n", This, v);
473     return node_get_content(&This->node, v);
474 }
475
476 static HRESULT WINAPI dom_pi_put_nodeTypedValue(
477     IXMLDOMProcessingInstruction *iface,
478     VARIANT typedValue)
479 {
480     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
481     FIXME("(%p)->(%s)\n", This, debugstr_variant(&typedValue));
482     return E_NOTIMPL;
483 }
484
485 static HRESULT WINAPI dom_pi_get_dataType(
486     IXMLDOMProcessingInstruction *iface,
487     VARIANT* typename)
488 {
489     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
490     TRACE("(%p)->(%p)\n", This, typename);
491     return return_null_var( typename );
492 }
493
494 static HRESULT WINAPI dom_pi_put_dataType(
495     IXMLDOMProcessingInstruction *iface,
496     BSTR p)
497 {
498     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
499
500     FIXME("(%p)->(%s)\n", This, debugstr_w(p));
501
502     if(!p)
503         return E_INVALIDARG;
504
505     return E_FAIL;
506 }
507
508 static HRESULT WINAPI dom_pi_get_xml(
509     IXMLDOMProcessingInstruction *iface,
510     BSTR* p)
511 {
512     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
513
514     TRACE("(%p)->(%p)\n", This, p);
515
516     return node_get_xml(&This->node, FALSE, FALSE, p);
517 }
518
519 static HRESULT WINAPI dom_pi_transformNode(
520     IXMLDOMProcessingInstruction *iface,
521     IXMLDOMNode *node, BSTR *p)
522 {
523     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
524     TRACE("(%p)->(%p %p)\n", This, node, p);
525     return node_transform_node(&This->node, node, p);
526 }
527
528 static HRESULT WINAPI dom_pi_selectNodes(
529     IXMLDOMProcessingInstruction *iface,
530     BSTR p, IXMLDOMNodeList** outList)
531 {
532     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
533     TRACE("(%p)->(%s %p)\n", This, debugstr_w(p), outList);
534     return node_select_nodes(&This->node, p, outList);
535 }
536
537 static HRESULT WINAPI dom_pi_selectSingleNode(
538     IXMLDOMProcessingInstruction *iface,
539     BSTR p, IXMLDOMNode** outNode)
540 {
541     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
542     TRACE("(%p)->(%s %p)\n", This, debugstr_w(p), outNode);
543     return node_select_singlenode(&This->node, p, outNode);
544 }
545
546 static HRESULT WINAPI dom_pi_get_parsed(
547     IXMLDOMProcessingInstruction *iface,
548     VARIANT_BOOL* isParsed)
549 {
550     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
551     FIXME("(%p)->(%p) stub!\n", This, isParsed);
552     *isParsed = VARIANT_TRUE;
553     return S_OK;
554 }
555
556 static HRESULT WINAPI dom_pi_get_namespaceURI(
557     IXMLDOMProcessingInstruction *iface,
558     BSTR* p)
559 {
560     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
561     TRACE("(%p)->(%p)\n", This, p);
562     return node_get_namespaceURI(&This->node, p);
563 }
564
565 static HRESULT WINAPI dom_pi_get_prefix(
566     IXMLDOMProcessingInstruction *iface,
567     BSTR* prefix)
568 {
569     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
570     TRACE("(%p)->(%p)\n", This, prefix);
571     return return_null_bstr( prefix );
572 }
573
574 static HRESULT WINAPI dom_pi_get_baseName(
575     IXMLDOMProcessingInstruction *iface,
576     BSTR* name)
577 {
578     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
579     TRACE("(%p)->(%p)\n", This, name);
580     return node_get_base_name( &This->node, name );
581 }
582
583 static HRESULT WINAPI dom_pi_transformNodeToObject(
584     IXMLDOMProcessingInstruction *iface,
585     IXMLDOMNode* domNode, VARIANT var1)
586 {
587     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
588     FIXME("(%p)->(%p %s)\n", This, domNode, debugstr_variant(&var1));
589     return E_NOTIMPL;
590 }
591
592 static HRESULT WINAPI dom_pi_get_target(
593     IXMLDOMProcessingInstruction *iface,
594     BSTR *p)
595 {
596     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
597
598     TRACE("(%p)->(%p)\n", This, p);
599
600     /* target returns the same value as nodeName property */
601     return node_get_nodeName(&This->node, p);
602 }
603
604 static HRESULT WINAPI dom_pi_get_data(
605     IXMLDOMProcessingInstruction *iface,
606     BSTR *p)
607 {
608     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
609     HRESULT hr;
610     VARIANT ret;
611
612     TRACE("(%p)->(%p)\n", This, p);
613
614     if(!p)
615         return E_INVALIDARG;
616
617     hr = IXMLDOMProcessingInstruction_get_nodeValue( iface, &ret );
618     if(hr == S_OK)
619     {
620         *p = V_BSTR(&ret);
621     }
622
623     return hr;
624 }
625
626 static HRESULT WINAPI dom_pi_put_data(
627     IXMLDOMProcessingInstruction *iface,
628     BSTR data)
629 {
630     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
631     HRESULT hr;
632     VARIANT val;
633     BSTR sTarget;
634
635     TRACE("(%p)->(%s)\n", This, debugstr_w(data) );
636
637     /* Cannot set data to a PI node whose target is 'xml' */
638     hr = dom_pi_get_nodeName(iface, &sTarget);
639     if(hr == S_OK)
640     {
641         static const WCHAR xmlW[] = {'x','m','l',0};
642         if(lstrcmpW( sTarget, xmlW) == 0)
643         {
644             SysFreeString(sTarget);
645             return E_FAIL;
646         }
647
648         SysFreeString(sTarget);
649     }
650
651     V_VT(&val) = VT_BSTR;
652     V_BSTR(&val) = data;
653
654     return IXMLDOMProcessingInstruction_put_nodeValue( iface, val );
655 }
656
657 static const struct IXMLDOMProcessingInstructionVtbl dom_pi_vtbl =
658 {
659     dom_pi_QueryInterface,
660     dom_pi_AddRef,
661     dom_pi_Release,
662     dom_pi_GetTypeInfoCount,
663     dom_pi_GetTypeInfo,
664     dom_pi_GetIDsOfNames,
665     dom_pi_Invoke,
666     dom_pi_get_nodeName,
667     dom_pi_get_nodeValue,
668     dom_pi_put_nodeValue,
669     dom_pi_get_nodeType,
670     dom_pi_get_parentNode,
671     dom_pi_get_childNodes,
672     dom_pi_get_firstChild,
673     dom_pi_get_lastChild,
674     dom_pi_get_previousSibling,
675     dom_pi_get_nextSibling,
676     dom_pi_get_attributes,
677     dom_pi_insertBefore,
678     dom_pi_replaceChild,
679     dom_pi_removeChild,
680     dom_pi_appendChild,
681     dom_pi_hasChildNodes,
682     dom_pi_get_ownerDocument,
683     dom_pi_cloneNode,
684     dom_pi_get_nodeTypeString,
685     dom_pi_get_text,
686     dom_pi_put_text,
687     dom_pi_get_specified,
688     dom_pi_get_definition,
689     dom_pi_get_nodeTypedValue,
690     dom_pi_put_nodeTypedValue,
691     dom_pi_get_dataType,
692     dom_pi_put_dataType,
693     dom_pi_get_xml,
694     dom_pi_transformNode,
695     dom_pi_selectNodes,
696     dom_pi_selectSingleNode,
697     dom_pi_get_parsed,
698     dom_pi_get_namespaceURI,
699     dom_pi_get_prefix,
700     dom_pi_get_baseName,
701     dom_pi_transformNodeToObject,
702
703     dom_pi_get_target,
704     dom_pi_get_data,
705     dom_pi_put_data
706 };
707
708 static const tid_t dompi_iface_tids[] = {
709     IXMLDOMProcessingInstruction_tid,
710     0
711 };
712
713 static dispex_static_data_t dompi_dispex = {
714     NULL,
715     IXMLDOMProcessingInstruction_tid,
716     NULL,
717     dompi_iface_tids
718 };
719
720 IUnknown* create_pi( xmlNodePtr pi )
721 {
722     dom_pi *This;
723
724     This = heap_alloc( sizeof *This );
725     if ( !This )
726         return NULL;
727
728     This->IXMLDOMProcessingInstruction_iface.lpVtbl = &dom_pi_vtbl;
729     This->ref = 1;
730
731     init_xmlnode(&This->node, pi, (IXMLDOMNode*)&This->IXMLDOMProcessingInstruction_iface, &dompi_dispex);
732
733     return (IUnknown*)&This->IXMLDOMProcessingInstruction_iface;
734 }
735
736 #endif