msvcp90: Don't define empty structure.
[wine/multimedia.git] / dlls / msxml3 / pi.c
blobb7a9c3ab65703b4c9b90a7d1ac8d7f6393cb6c24
1 /*
2 * DOM processing instruction node implementation
4 * Copyright 2006 Huw Davies
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 #ifdef HAVE_LIBXML2
27 # include <libxml/parser.h>
28 # include <libxml/xmlerror.h>
29 #endif
31 #include "windef.h"
32 #include "winbase.h"
33 #include "winuser.h"
34 #include "ole2.h"
35 #include "msxml6.h"
37 #include "msxml_private.h"
39 #include "wine/debug.h"
41 WINE_DEFAULT_DEBUG_CHANNEL(msxml);
43 #ifdef HAVE_LIBXML2
45 typedef struct _dom_pi
47 xmlnode node;
48 IXMLDOMProcessingInstruction IXMLDOMProcessingInstruction_iface;
49 LONG ref;
50 } dom_pi;
52 static const struct nodemap_funcs dom_pi_attr_map;
54 static inline dom_pi *impl_from_IXMLDOMProcessingInstruction( IXMLDOMProcessingInstruction *iface )
56 return CONTAINING_RECORD(iface, dom_pi, IXMLDOMProcessingInstruction_iface);
59 static HRESULT WINAPI dom_pi_QueryInterface(
60 IXMLDOMProcessingInstruction *iface,
61 REFIID riid,
62 void** ppvObject )
64 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
65 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
67 if ( IsEqualGUID( riid, &IID_IXMLDOMProcessingInstruction ) ||
68 IsEqualGUID( riid, &IID_IXMLDOMNode ) ||
69 IsEqualGUID( riid, &IID_IDispatch ) ||
70 IsEqualGUID( riid, &IID_IUnknown ) )
72 *ppvObject = iface;
74 else if(node_query_interface(&This->node, riid, ppvObject))
76 return *ppvObject ? S_OK : E_NOINTERFACE;
78 else
80 TRACE("Unsupported interface %s\n", debugstr_guid(riid));
81 *ppvObject = NULL;
82 return E_NOINTERFACE;
85 IUnknown_AddRef((IUnknown*)*ppvObject);
86 return S_OK;
89 static ULONG WINAPI dom_pi_AddRef(
90 IXMLDOMProcessingInstruction *iface )
92 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
93 ULONG ref = InterlockedIncrement( &This->ref );
94 TRACE("(%p)->(%d)\n", This, ref);
95 return ref;
98 static ULONG WINAPI dom_pi_Release(
99 IXMLDOMProcessingInstruction *iface )
101 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
102 ULONG ref = InterlockedDecrement( &This->ref );
104 TRACE("(%p)->(%d)\n", This, ref);
105 if ( ref == 0 )
107 destroy_xmlnode(&This->node);
108 heap_free( This );
111 return ref;
114 static HRESULT WINAPI dom_pi_GetTypeInfoCount(
115 IXMLDOMProcessingInstruction *iface,
116 UINT* pctinfo )
118 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
120 TRACE("(%p)->(%p)\n", This, pctinfo);
122 *pctinfo = 1;
124 return S_OK;
127 static HRESULT WINAPI dom_pi_GetTypeInfo(
128 IXMLDOMProcessingInstruction *iface,
129 UINT iTInfo, LCID lcid,
130 ITypeInfo** ppTInfo )
132 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
134 TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
136 return get_typeinfo(IXMLDOMProcessingInstruction_tid, ppTInfo);
139 static HRESULT WINAPI dom_pi_GetIDsOfNames(
140 IXMLDOMProcessingInstruction *iface,
141 REFIID riid, LPOLESTR* rgszNames,
142 UINT cNames, LCID lcid, DISPID* rgDispId )
144 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
145 ITypeInfo *typeinfo;
146 HRESULT hr;
148 TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
149 lcid, rgDispId);
151 if(!rgszNames || cNames == 0 || !rgDispId)
152 return E_INVALIDARG;
154 hr = get_typeinfo(IXMLDOMProcessingInstruction_tid, &typeinfo);
155 if(SUCCEEDED(hr))
157 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
158 ITypeInfo_Release(typeinfo);
161 return hr;
164 static HRESULT WINAPI dom_pi_Invoke(
165 IXMLDOMProcessingInstruction *iface,
166 DISPID dispIdMember, REFIID riid, LCID lcid,
167 WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult,
168 EXCEPINFO* pExcepInfo, UINT* puArgErr )
170 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
171 ITypeInfo *typeinfo;
172 HRESULT hr;
174 TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
175 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
177 hr = get_typeinfo(IXMLDOMProcessingInstruction_tid, &typeinfo);
178 if(SUCCEEDED(hr))
180 hr = ITypeInfo_Invoke(typeinfo, &This->IXMLDOMProcessingInstruction_iface, dispIdMember,
181 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
182 ITypeInfo_Release(typeinfo);
185 return hr;
188 static HRESULT WINAPI dom_pi_get_nodeName(
189 IXMLDOMProcessingInstruction *iface,
190 BSTR* p )
192 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
194 TRACE("(%p)->(%p)\n", This, p);
196 return node_get_nodeName(&This->node, p);
199 static HRESULT WINAPI dom_pi_get_nodeValue(
200 IXMLDOMProcessingInstruction *iface,
201 VARIANT* value)
203 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
205 TRACE("(%p)->(%p)\n", This, value);
207 return node_get_content(&This->node, value);
210 static HRESULT WINAPI dom_pi_put_nodeValue(
211 IXMLDOMProcessingInstruction *iface,
212 VARIANT value)
214 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
215 BSTR sTarget;
216 HRESULT hr;
218 TRACE("(%p)->(%s)\n", This, debugstr_variant(&value));
220 /* Cannot set data to a PI node whose target is 'xml' */
221 hr = dom_pi_get_nodeName(iface, &sTarget);
222 if(hr == S_OK)
224 static const WCHAR xmlW[] = {'x','m','l',0};
225 if(lstrcmpW( sTarget, xmlW) == 0)
227 SysFreeString(sTarget);
228 return E_FAIL;
231 SysFreeString(sTarget);
234 return node_put_value(&This->node, &value);
237 static HRESULT WINAPI dom_pi_get_nodeType(
238 IXMLDOMProcessingInstruction *iface,
239 DOMNodeType* domNodeType )
241 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
243 TRACE("(%p)->(%p)\n", This, domNodeType);
245 *domNodeType = NODE_PROCESSING_INSTRUCTION;
246 return S_OK;
249 static HRESULT WINAPI dom_pi_get_parentNode(
250 IXMLDOMProcessingInstruction *iface,
251 IXMLDOMNode** parent )
253 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
255 TRACE("(%p)->(%p)\n", This, parent);
257 return node_get_parent(&This->node, parent);
260 static HRESULT WINAPI dom_pi_get_childNodes(
261 IXMLDOMProcessingInstruction *iface,
262 IXMLDOMNodeList** outList)
264 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
266 TRACE("(%p)->(%p)\n", This, outList);
268 return node_get_child_nodes(&This->node, outList);
271 static HRESULT WINAPI dom_pi_get_firstChild(
272 IXMLDOMProcessingInstruction *iface,
273 IXMLDOMNode** domNode)
275 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
277 TRACE("(%p)->(%p)\n", This, domNode);
279 return return_null_node(domNode);
282 static HRESULT WINAPI dom_pi_get_lastChild(
283 IXMLDOMProcessingInstruction *iface,
284 IXMLDOMNode** domNode)
286 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
288 TRACE("(%p)->(%p)\n", This, domNode);
290 return return_null_node(domNode);
293 static HRESULT WINAPI dom_pi_get_previousSibling(
294 IXMLDOMProcessingInstruction *iface,
295 IXMLDOMNode** domNode)
297 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
299 TRACE("(%p)->(%p)\n", This, domNode);
301 return node_get_previous_sibling(&This->node, domNode);
304 static HRESULT WINAPI dom_pi_get_nextSibling(
305 IXMLDOMProcessingInstruction *iface,
306 IXMLDOMNode** domNode)
308 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
310 TRACE("(%p)->(%p)\n", This, domNode);
312 return node_get_next_sibling(&This->node, domNode);
315 static HRESULT WINAPI dom_pi_get_attributes(
316 IXMLDOMProcessingInstruction *iface,
317 IXMLDOMNamedNodeMap** map)
319 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
320 static const WCHAR xmlW[] = {'x','m','l',0};
321 HRESULT hr;
322 BSTR name;
324 TRACE("(%p)->(%p)\n", This, map);
326 if (!map) return E_INVALIDARG;
328 *map = NULL;
330 hr = node_get_nodeName(&This->node, &name);
331 if (hr != S_OK) return hr;
333 if (!strcmpW(name, xmlW))
335 FIXME("created dummy map for <?xml ?>\n");
336 *map = create_nodemap(This->node.node, &dom_pi_attr_map);
337 SysFreeString(name);
338 return S_OK;
341 SysFreeString(name);
343 return S_FALSE;
346 static HRESULT WINAPI dom_pi_insertBefore(
347 IXMLDOMProcessingInstruction *iface,
348 IXMLDOMNode* newNode, VARIANT refChild,
349 IXMLDOMNode** outOldNode)
351 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
353 FIXME("(%p)->(%p %s %p) needs test\n", This, newNode, debugstr_variant(&refChild), outOldNode);
355 return node_insert_before(&This->node, newNode, &refChild, outOldNode);
358 static HRESULT WINAPI dom_pi_replaceChild(
359 IXMLDOMProcessingInstruction *iface,
360 IXMLDOMNode* newNode,
361 IXMLDOMNode* oldNode,
362 IXMLDOMNode** outOldNode)
364 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
366 FIXME("(%p)->(%p %p %p) needs test\n", This, newNode, oldNode, outOldNode);
368 return node_replace_child(&This->node, newNode, oldNode, outOldNode);
371 static HRESULT WINAPI dom_pi_removeChild(
372 IXMLDOMProcessingInstruction *iface,
373 IXMLDOMNode *child, IXMLDOMNode **oldChild)
375 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
376 TRACE("(%p)->(%p %p)\n", This, child, oldChild);
377 return node_remove_child(&This->node, child, oldChild);
380 static HRESULT WINAPI dom_pi_appendChild(
381 IXMLDOMProcessingInstruction *iface,
382 IXMLDOMNode *child, IXMLDOMNode **outChild)
384 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
385 TRACE("(%p)->(%p %p)\n", This, child, outChild);
386 return node_append_child(&This->node, child, outChild);
389 static HRESULT WINAPI dom_pi_hasChildNodes(
390 IXMLDOMProcessingInstruction *iface,
391 VARIANT_BOOL *ret)
393 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
394 TRACE("(%p)->(%p)\n", This, ret);
395 return node_has_childnodes(&This->node, ret);
398 static HRESULT WINAPI dom_pi_get_ownerDocument(
399 IXMLDOMProcessingInstruction *iface,
400 IXMLDOMDocument **doc)
402 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
403 TRACE("(%p)->(%p)\n", This, doc);
404 return node_get_owner_doc(&This->node, doc);
407 static HRESULT WINAPI dom_pi_cloneNode(
408 IXMLDOMProcessingInstruction *iface,
409 VARIANT_BOOL deep, IXMLDOMNode** outNode)
411 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
412 TRACE("(%p)->(%d %p)\n", This, deep, outNode);
413 return node_clone( &This->node, deep, outNode );
416 static HRESULT WINAPI dom_pi_get_nodeTypeString(
417 IXMLDOMProcessingInstruction *iface,
418 BSTR* p)
420 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
421 static const WCHAR processinginstructionW[] =
422 {'p','r','o','c','e','s','s','i','n','g','i','n','s','t','r','u','c','t','i','o','n',0};
424 TRACE("(%p)->(%p)\n", This, p);
426 return return_bstr(processinginstructionW, p);
429 static HRESULT WINAPI dom_pi_get_text(
430 IXMLDOMProcessingInstruction *iface,
431 BSTR* p)
433 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
434 TRACE("(%p)->(%p)\n", This, p);
435 return node_get_text(&This->node, p);
438 static HRESULT WINAPI dom_pi_put_text(
439 IXMLDOMProcessingInstruction *iface,
440 BSTR p)
442 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
443 TRACE("(%p)->(%s)\n", This, debugstr_w(p));
444 return node_put_text( &This->node, p );
447 static HRESULT WINAPI dom_pi_get_specified(
448 IXMLDOMProcessingInstruction *iface,
449 VARIANT_BOOL* isSpecified)
451 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
452 FIXME("(%p)->(%p) stub!\n", This, isSpecified);
453 *isSpecified = VARIANT_TRUE;
454 return S_OK;
457 static HRESULT WINAPI dom_pi_get_definition(
458 IXMLDOMProcessingInstruction *iface,
459 IXMLDOMNode** definitionNode)
461 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
462 FIXME("(%p)->(%p)\n", This, definitionNode);
463 return E_NOTIMPL;
466 static HRESULT WINAPI dom_pi_get_nodeTypedValue(
467 IXMLDOMProcessingInstruction *iface,
468 VARIANT* v)
470 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
471 TRACE("(%p)->(%p)\n", This, v);
472 return node_get_content(&This->node, v);
475 static HRESULT WINAPI dom_pi_put_nodeTypedValue(
476 IXMLDOMProcessingInstruction *iface,
477 VARIANT typedValue)
479 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
480 FIXME("(%p)->(%s)\n", This, debugstr_variant(&typedValue));
481 return E_NOTIMPL;
484 static HRESULT WINAPI dom_pi_get_dataType(
485 IXMLDOMProcessingInstruction *iface,
486 VARIANT* typename)
488 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
489 TRACE("(%p)->(%p)\n", This, typename);
490 return return_null_var( typename );
493 static HRESULT WINAPI dom_pi_put_dataType(
494 IXMLDOMProcessingInstruction *iface,
495 BSTR p)
497 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
499 FIXME("(%p)->(%s)\n", This, debugstr_w(p));
501 if(!p)
502 return E_INVALIDARG;
504 return E_FAIL;
507 static HRESULT WINAPI dom_pi_get_xml(
508 IXMLDOMProcessingInstruction *iface,
509 BSTR* p)
511 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
513 TRACE("(%p)->(%p)\n", This, p);
515 return node_get_xml(&This->node, FALSE, FALSE, p);
518 static HRESULT WINAPI dom_pi_transformNode(
519 IXMLDOMProcessingInstruction *iface,
520 IXMLDOMNode *node, BSTR *p)
522 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
523 TRACE("(%p)->(%p %p)\n", This, node, p);
524 return node_transform_node(&This->node, node, p);
527 static HRESULT WINAPI dom_pi_selectNodes(
528 IXMLDOMProcessingInstruction *iface,
529 BSTR p, IXMLDOMNodeList** outList)
531 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
532 TRACE("(%p)->(%s %p)\n", This, debugstr_w(p), outList);
533 return node_select_nodes(&This->node, p, outList);
536 static HRESULT WINAPI dom_pi_selectSingleNode(
537 IXMLDOMProcessingInstruction *iface,
538 BSTR p, IXMLDOMNode** outNode)
540 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
541 TRACE("(%p)->(%s %p)\n", This, debugstr_w(p), outNode);
542 return node_select_singlenode(&This->node, p, outNode);
545 static HRESULT WINAPI dom_pi_get_parsed(
546 IXMLDOMProcessingInstruction *iface,
547 VARIANT_BOOL* isParsed)
549 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
550 FIXME("(%p)->(%p) stub!\n", This, isParsed);
551 *isParsed = VARIANT_TRUE;
552 return S_OK;
555 static HRESULT WINAPI dom_pi_get_namespaceURI(
556 IXMLDOMProcessingInstruction *iface,
557 BSTR* p)
559 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
560 TRACE("(%p)->(%p)\n", This, p);
561 return node_get_namespaceURI(&This->node, p);
564 static HRESULT WINAPI dom_pi_get_prefix(
565 IXMLDOMProcessingInstruction *iface,
566 BSTR* prefix)
568 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
569 TRACE("(%p)->(%p)\n", This, prefix);
570 return return_null_bstr( prefix );
573 static HRESULT WINAPI dom_pi_get_baseName(
574 IXMLDOMProcessingInstruction *iface,
575 BSTR* name)
577 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
578 TRACE("(%p)->(%p)\n", This, name);
579 return node_get_base_name( &This->node, name );
582 static HRESULT WINAPI dom_pi_transformNodeToObject(
583 IXMLDOMProcessingInstruction *iface,
584 IXMLDOMNode* domNode, VARIANT var1)
586 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
587 FIXME("(%p)->(%p %s)\n", This, domNode, debugstr_variant(&var1));
588 return E_NOTIMPL;
591 static HRESULT WINAPI dom_pi_get_target(
592 IXMLDOMProcessingInstruction *iface,
593 BSTR *p)
595 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
597 TRACE("(%p)->(%p)\n", This, p);
599 /* target returns the same value as nodeName property */
600 return node_get_nodeName(&This->node, p);
603 static HRESULT WINAPI dom_pi_get_data(
604 IXMLDOMProcessingInstruction *iface,
605 BSTR *p)
607 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
608 HRESULT hr;
609 VARIANT ret;
611 TRACE("(%p)->(%p)\n", This, p);
613 if(!p)
614 return E_INVALIDARG;
616 hr = IXMLDOMProcessingInstruction_get_nodeValue( iface, &ret );
617 if(hr == S_OK)
619 *p = V_BSTR(&ret);
622 return hr;
625 static HRESULT WINAPI dom_pi_put_data(
626 IXMLDOMProcessingInstruction *iface,
627 BSTR data)
629 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
630 HRESULT hr;
631 VARIANT val;
632 BSTR sTarget;
634 TRACE("(%p)->(%s)\n", This, debugstr_w(data) );
636 /* Cannot set data to a PI node whose target is 'xml' */
637 hr = dom_pi_get_nodeName(iface, &sTarget);
638 if(hr == S_OK)
640 static const WCHAR xmlW[] = {'x','m','l',0};
641 if(lstrcmpW( sTarget, xmlW) == 0)
643 SysFreeString(sTarget);
644 return E_FAIL;
647 SysFreeString(sTarget);
650 V_VT(&val) = VT_BSTR;
651 V_BSTR(&val) = data;
653 return IXMLDOMProcessingInstruction_put_nodeValue( iface, val );
656 static const struct IXMLDOMProcessingInstructionVtbl dom_pi_vtbl =
658 dom_pi_QueryInterface,
659 dom_pi_AddRef,
660 dom_pi_Release,
661 dom_pi_GetTypeInfoCount,
662 dom_pi_GetTypeInfo,
663 dom_pi_GetIDsOfNames,
664 dom_pi_Invoke,
665 dom_pi_get_nodeName,
666 dom_pi_get_nodeValue,
667 dom_pi_put_nodeValue,
668 dom_pi_get_nodeType,
669 dom_pi_get_parentNode,
670 dom_pi_get_childNodes,
671 dom_pi_get_firstChild,
672 dom_pi_get_lastChild,
673 dom_pi_get_previousSibling,
674 dom_pi_get_nextSibling,
675 dom_pi_get_attributes,
676 dom_pi_insertBefore,
677 dom_pi_replaceChild,
678 dom_pi_removeChild,
679 dom_pi_appendChild,
680 dom_pi_hasChildNodes,
681 dom_pi_get_ownerDocument,
682 dom_pi_cloneNode,
683 dom_pi_get_nodeTypeString,
684 dom_pi_get_text,
685 dom_pi_put_text,
686 dom_pi_get_specified,
687 dom_pi_get_definition,
688 dom_pi_get_nodeTypedValue,
689 dom_pi_put_nodeTypedValue,
690 dom_pi_get_dataType,
691 dom_pi_put_dataType,
692 dom_pi_get_xml,
693 dom_pi_transformNode,
694 dom_pi_selectNodes,
695 dom_pi_selectSingleNode,
696 dom_pi_get_parsed,
697 dom_pi_get_namespaceURI,
698 dom_pi_get_prefix,
699 dom_pi_get_baseName,
700 dom_pi_transformNodeToObject,
702 dom_pi_get_target,
703 dom_pi_get_data,
704 dom_pi_put_data
707 static HRESULT dom_pi_get_qualified_item(const xmlNodePtr node, BSTR name, BSTR uri,
708 IXMLDOMNode **item)
710 FIXME("(%p)->(%s %s %p): stub\n", node, debugstr_w(name), debugstr_w(uri), item);
711 return E_NOTIMPL;
714 static HRESULT dom_pi_get_named_item(const xmlNodePtr node, BSTR name, IXMLDOMNode **item)
716 FIXME("(%p)->(%s %p): stub\n", node, debugstr_w(name), item );
717 return E_NOTIMPL;
720 static HRESULT dom_pi_set_named_item(xmlNodePtr node, IXMLDOMNode *newItem, IXMLDOMNode **namedItem)
722 FIXME("(%p)->(%p %p): stub\n", node, newItem, namedItem );
723 return E_NOTIMPL;
726 static HRESULT dom_pi_remove_qualified_item(xmlNodePtr node, BSTR name, BSTR uri, IXMLDOMNode **item)
728 FIXME("(%p)->(%s %s %p): stub\n", node, debugstr_w(name), debugstr_w(uri), item);
729 return E_NOTIMPL;
732 static HRESULT dom_pi_remove_named_item(xmlNodePtr node, BSTR name, IXMLDOMNode **item)
734 FIXME("(%p)->(%s %p): stub\n", node, debugstr_w(name), item);
735 return E_NOTIMPL;
738 static HRESULT dom_pi_get_item(const xmlNodePtr node, LONG index, IXMLDOMNode **item)
740 FIXME("(%p)->(%d %p): stub\n", node, index, item);
741 return E_NOTIMPL;
744 static HRESULT dom_pi_get_length(const xmlNodePtr node, LONG *length)
746 FIXME("(%p)->(%p): stub\n", node, length);
748 *length = 0;
749 return S_OK;
752 static HRESULT dom_pi_next_node(const xmlNodePtr node, LONG *iter, IXMLDOMNode **nextNode)
754 FIXME("(%p)->(%d %p): stub\n", node, *iter, nextNode);
755 return E_NOTIMPL;
758 static const struct nodemap_funcs dom_pi_attr_map = {
759 dom_pi_get_named_item,
760 dom_pi_set_named_item,
761 dom_pi_remove_named_item,
762 dom_pi_get_item,
763 dom_pi_get_length,
764 dom_pi_get_qualified_item,
765 dom_pi_remove_qualified_item,
766 dom_pi_next_node
769 static const tid_t dompi_iface_tids[] = {
770 IXMLDOMProcessingInstruction_tid,
774 static dispex_static_data_t dompi_dispex = {
775 NULL,
776 IXMLDOMProcessingInstruction_tid,
777 NULL,
778 dompi_iface_tids
781 IUnknown* create_pi( xmlNodePtr pi )
783 dom_pi *This;
785 This = heap_alloc( sizeof *This );
786 if ( !This )
787 return NULL;
789 This->IXMLDOMProcessingInstruction_iface.lpVtbl = &dom_pi_vtbl;
790 This->ref = 1;
792 init_xmlnode(&This->node, pi, (IXMLDOMNode*)&This->IXMLDOMProcessingInstruction_iface, &dompi_dispex);
794 return (IUnknown*)&This->IXMLDOMProcessingInstruction_iface;
797 #endif