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