wined3d: Merge the various resource desc structures.
[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         FIXME("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** attributeMap)
319 {
320     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
321
322     TRACE("(%p)->(%p)\n", This, attributeMap);
323
324     *attributeMap = create_nodemap((IXMLDOMNode*)&This->IXMLDOMProcessingInstruction_iface);
325     return S_OK;
326 }
327
328 static HRESULT WINAPI dom_pi_insertBefore(
329     IXMLDOMProcessingInstruction *iface,
330     IXMLDOMNode* newNode, VARIANT refChild,
331     IXMLDOMNode** outOldNode)
332 {
333     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
334
335     FIXME("(%p)->(%p %s %p) needs test\n", This, newNode, debugstr_variant(&refChild), outOldNode);
336
337     return node_insert_before(&This->node, newNode, &refChild, outOldNode);
338 }
339
340 static HRESULT WINAPI dom_pi_replaceChild(
341     IXMLDOMProcessingInstruction *iface,
342     IXMLDOMNode* newNode,
343     IXMLDOMNode* oldNode,
344     IXMLDOMNode** outOldNode)
345 {
346     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
347
348     FIXME("(%p)->(%p %p %p) needs test\n", This, newNode, oldNode, outOldNode);
349
350     return node_replace_child(&This->node, newNode, oldNode, outOldNode);
351 }
352
353 static HRESULT WINAPI dom_pi_removeChild(
354     IXMLDOMProcessingInstruction *iface,
355     IXMLDOMNode *child, IXMLDOMNode **oldChild)
356 {
357     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
358     TRACE("(%p)->(%p %p)\n", This, child, oldChild);
359     return node_remove_child(&This->node, child, oldChild);
360 }
361
362 static HRESULT WINAPI dom_pi_appendChild(
363     IXMLDOMProcessingInstruction *iface,
364     IXMLDOMNode *child, IXMLDOMNode **outChild)
365 {
366     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
367     TRACE("(%p)->(%p %p)\n", This, child, outChild);
368     return node_append_child(&This->node, child, outChild);
369 }
370
371 static HRESULT WINAPI dom_pi_hasChildNodes(
372     IXMLDOMProcessingInstruction *iface,
373     VARIANT_BOOL *ret)
374 {
375     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
376     TRACE("(%p)->(%p)\n", This, ret);
377     return node_has_childnodes(&This->node, ret);
378 }
379
380 static HRESULT WINAPI dom_pi_get_ownerDocument(
381     IXMLDOMProcessingInstruction *iface,
382     IXMLDOMDocument **doc)
383 {
384     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
385     TRACE("(%p)->(%p)\n", This, doc);
386     return node_get_owner_doc(&This->node, doc);
387 }
388
389 static HRESULT WINAPI dom_pi_cloneNode(
390     IXMLDOMProcessingInstruction *iface,
391     VARIANT_BOOL deep, IXMLDOMNode** outNode)
392 {
393     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
394     TRACE("(%p)->(%d %p)\n", This, deep, outNode);
395     return node_clone( &This->node, deep, outNode );
396 }
397
398 static HRESULT WINAPI dom_pi_get_nodeTypeString(
399     IXMLDOMProcessingInstruction *iface,
400     BSTR* p)
401 {
402     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
403     static const WCHAR processinginstructionW[] =
404         {'p','r','o','c','e','s','s','i','n','g','i','n','s','t','r','u','c','t','i','o','n',0};
405
406     TRACE("(%p)->(%p)\n", This, p);
407
408     return return_bstr(processinginstructionW, p);
409 }
410
411 static HRESULT WINAPI dom_pi_get_text(
412     IXMLDOMProcessingInstruction *iface,
413     BSTR* p)
414 {
415     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
416     TRACE("(%p)->(%p)\n", This, p);
417     return node_get_text(&This->node, p);
418 }
419
420 static HRESULT WINAPI dom_pi_put_text(
421     IXMLDOMProcessingInstruction *iface,
422     BSTR p)
423 {
424     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
425     TRACE("(%p)->(%s)\n", This, debugstr_w(p));
426     return node_put_text( &This->node, p );
427 }
428
429 static HRESULT WINAPI dom_pi_get_specified(
430     IXMLDOMProcessingInstruction *iface,
431     VARIANT_BOOL* isSpecified)
432 {
433     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
434     FIXME("(%p)->(%p) stub!\n", This, isSpecified);
435     *isSpecified = VARIANT_TRUE;
436     return S_OK;
437 }
438
439 static HRESULT WINAPI dom_pi_get_definition(
440     IXMLDOMProcessingInstruction *iface,
441     IXMLDOMNode** definitionNode)
442 {
443     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
444     FIXME("(%p)->(%p)\n", This, definitionNode);
445     return E_NOTIMPL;
446 }
447
448 static HRESULT WINAPI dom_pi_get_nodeTypedValue(
449     IXMLDOMProcessingInstruction *iface,
450     VARIANT* v)
451 {
452     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
453     TRACE("(%p)->(%p)\n", This, v);
454     return node_get_content(&This->node, v);
455 }
456
457 static HRESULT WINAPI dom_pi_put_nodeTypedValue(
458     IXMLDOMProcessingInstruction *iface,
459     VARIANT typedValue)
460 {
461     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
462     FIXME("(%p)->(%s)\n", This, debugstr_variant(&typedValue));
463     return E_NOTIMPL;
464 }
465
466 static HRESULT WINAPI dom_pi_get_dataType(
467     IXMLDOMProcessingInstruction *iface,
468     VARIANT* typename)
469 {
470     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
471     TRACE("(%p)->(%p)\n", This, typename);
472     return return_null_var( typename );
473 }
474
475 static HRESULT WINAPI dom_pi_put_dataType(
476     IXMLDOMProcessingInstruction *iface,
477     BSTR p)
478 {
479     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
480
481     FIXME("(%p)->(%s)\n", This, debugstr_w(p));
482
483     if(!p)
484         return E_INVALIDARG;
485
486     return E_FAIL;
487 }
488
489 static HRESULT WINAPI dom_pi_get_xml(
490     IXMLDOMProcessingInstruction *iface,
491     BSTR* p)
492 {
493     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
494
495     TRACE("(%p)->(%p)\n", This, p);
496
497     return node_get_xml(&This->node, FALSE, FALSE, p);
498 }
499
500 static HRESULT WINAPI dom_pi_transformNode(
501     IXMLDOMProcessingInstruction *iface,
502     IXMLDOMNode *node, BSTR *p)
503 {
504     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
505     TRACE("(%p)->(%p %p)\n", This, node, p);
506     return node_transform_node(&This->node, node, p);
507 }
508
509 static HRESULT WINAPI dom_pi_selectNodes(
510     IXMLDOMProcessingInstruction *iface,
511     BSTR p, IXMLDOMNodeList** outList)
512 {
513     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
514     TRACE("(%p)->(%s %p)\n", This, debugstr_w(p), outList);
515     return node_select_nodes(&This->node, p, outList);
516 }
517
518 static HRESULT WINAPI dom_pi_selectSingleNode(
519     IXMLDOMProcessingInstruction *iface,
520     BSTR p, IXMLDOMNode** outNode)
521 {
522     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
523     TRACE("(%p)->(%s %p)\n", This, debugstr_w(p), outNode);
524     return node_select_singlenode(&This->node, p, outNode);
525 }
526
527 static HRESULT WINAPI dom_pi_get_parsed(
528     IXMLDOMProcessingInstruction *iface,
529     VARIANT_BOOL* isParsed)
530 {
531     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
532     FIXME("(%p)->(%p) stub!\n", This, isParsed);
533     *isParsed = VARIANT_TRUE;
534     return S_OK;
535 }
536
537 static HRESULT WINAPI dom_pi_get_namespaceURI(
538     IXMLDOMProcessingInstruction *iface,
539     BSTR* p)
540 {
541     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
542     TRACE("(%p)->(%p)\n", This, p);
543     return node_get_namespaceURI(&This->node, p);
544 }
545
546 static HRESULT WINAPI dom_pi_get_prefix(
547     IXMLDOMProcessingInstruction *iface,
548     BSTR* prefix)
549 {
550     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
551     TRACE("(%p)->(%p)\n", This, prefix);
552     return return_null_bstr( prefix );
553 }
554
555 static HRESULT WINAPI dom_pi_get_baseName(
556     IXMLDOMProcessingInstruction *iface,
557     BSTR* name)
558 {
559     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
560     TRACE("(%p)->(%p)\n", This, name);
561     return node_get_base_name( &This->node, name );
562 }
563
564 static HRESULT WINAPI dom_pi_transformNodeToObject(
565     IXMLDOMProcessingInstruction *iface,
566     IXMLDOMNode* domNode, VARIANT var1)
567 {
568     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
569     FIXME("(%p)->(%p %s)\n", This, domNode, debugstr_variant(&var1));
570     return E_NOTIMPL;
571 }
572
573 static HRESULT WINAPI dom_pi_get_target(
574     IXMLDOMProcessingInstruction *iface,
575     BSTR *p)
576 {
577     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
578
579     TRACE("(%p)->(%p)\n", This, p);
580
581     /* target returns the same value as nodeName property */
582     return node_get_nodeName(&This->node, p);
583 }
584
585 static HRESULT WINAPI dom_pi_get_data(
586     IXMLDOMProcessingInstruction *iface,
587     BSTR *p)
588 {
589     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
590     HRESULT hr;
591     VARIANT ret;
592
593     TRACE("(%p)->(%p)\n", This, p);
594
595     if(!p)
596         return E_INVALIDARG;
597
598     hr = IXMLDOMProcessingInstruction_get_nodeValue( iface, &ret );
599     if(hr == S_OK)
600     {
601         *p = V_BSTR(&ret);
602     }
603
604     return hr;
605 }
606
607 static HRESULT WINAPI dom_pi_put_data(
608     IXMLDOMProcessingInstruction *iface,
609     BSTR data)
610 {
611     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
612     HRESULT hr;
613     VARIANT val;
614     BSTR sTarget;
615
616     TRACE("(%p)->(%s)\n", This, debugstr_w(data) );
617
618     /* Cannot set data to a PI node whose target is 'xml' */
619     hr = dom_pi_get_nodeName(iface, &sTarget);
620     if(hr == S_OK)
621     {
622         static const WCHAR xmlW[] = {'x','m','l',0};
623         if(lstrcmpW( sTarget, xmlW) == 0)
624         {
625             SysFreeString(sTarget);
626             return E_FAIL;
627         }
628
629         SysFreeString(sTarget);
630     }
631
632     V_VT(&val) = VT_BSTR;
633     V_BSTR(&val) = data;
634
635     return IXMLDOMProcessingInstruction_put_nodeValue( iface, val );
636 }
637
638 static const struct IXMLDOMProcessingInstructionVtbl dom_pi_vtbl =
639 {
640     dom_pi_QueryInterface,
641     dom_pi_AddRef,
642     dom_pi_Release,
643     dom_pi_GetTypeInfoCount,
644     dom_pi_GetTypeInfo,
645     dom_pi_GetIDsOfNames,
646     dom_pi_Invoke,
647     dom_pi_get_nodeName,
648     dom_pi_get_nodeValue,
649     dom_pi_put_nodeValue,
650     dom_pi_get_nodeType,
651     dom_pi_get_parentNode,
652     dom_pi_get_childNodes,
653     dom_pi_get_firstChild,
654     dom_pi_get_lastChild,
655     dom_pi_get_previousSibling,
656     dom_pi_get_nextSibling,
657     dom_pi_get_attributes,
658     dom_pi_insertBefore,
659     dom_pi_replaceChild,
660     dom_pi_removeChild,
661     dom_pi_appendChild,
662     dom_pi_hasChildNodes,
663     dom_pi_get_ownerDocument,
664     dom_pi_cloneNode,
665     dom_pi_get_nodeTypeString,
666     dom_pi_get_text,
667     dom_pi_put_text,
668     dom_pi_get_specified,
669     dom_pi_get_definition,
670     dom_pi_get_nodeTypedValue,
671     dom_pi_put_nodeTypedValue,
672     dom_pi_get_dataType,
673     dom_pi_put_dataType,
674     dom_pi_get_xml,
675     dom_pi_transformNode,
676     dom_pi_selectNodes,
677     dom_pi_selectSingleNode,
678     dom_pi_get_parsed,
679     dom_pi_get_namespaceURI,
680     dom_pi_get_prefix,
681     dom_pi_get_baseName,
682     dom_pi_transformNodeToObject,
683
684     dom_pi_get_target,
685     dom_pi_get_data,
686     dom_pi_put_data
687 };
688
689 IUnknown* create_pi( xmlNodePtr pi )
690 {
691     dom_pi *This;
692
693     This = heap_alloc( sizeof *This );
694     if ( !This )
695         return NULL;
696
697     This->IXMLDOMProcessingInstruction_iface.lpVtbl = &dom_pi_vtbl;
698     This->ref = 1;
699
700     init_xmlnode(&This->node, pi, (IXMLDOMNode*)&This->IXMLDOMProcessingInstruction_iface, NULL);
701
702     return (IUnknown*)&This->IXMLDOMProcessingInstruction_iface;
703 }
704
705 #endif