mfplat: Remove duplicated GUID entry from attribute tracing.
[wine/zf.git] / dlls / msxml3 / pi.c
blobcea95708087ba377c2327c44cab5c950a57835a9
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 #ifdef HAVE_LIBXML2
43 WINE_DEFAULT_DEBUG_CHANNEL(msxml);
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 const tid_t dompi_se_tids[] = {
55 IXMLDOMNode_tid,
56 IXMLDOMProcessingInstruction_tid,
57 NULL_tid
60 static inline dom_pi *impl_from_IXMLDOMProcessingInstruction( IXMLDOMProcessingInstruction *iface )
62 return CONTAINING_RECORD(iface, dom_pi, IXMLDOMProcessingInstruction_iface);
65 static HRESULT WINAPI dom_pi_QueryInterface(
66 IXMLDOMProcessingInstruction *iface,
67 REFIID riid,
68 void** ppvObject )
70 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
71 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
73 if ( IsEqualGUID( riid, &IID_IXMLDOMProcessingInstruction ) ||
74 IsEqualGUID( riid, &IID_IXMLDOMNode ) ||
75 IsEqualGUID( riid, &IID_IDispatch ) ||
76 IsEqualGUID( riid, &IID_IUnknown ) )
78 *ppvObject = iface;
80 else if(node_query_interface(&This->node, riid, ppvObject))
82 return *ppvObject ? S_OK : E_NOINTERFACE;
84 else if(IsEqualGUID( riid, &IID_ISupportErrorInfo ))
86 return node_create_supporterrorinfo(dompi_se_tids, ppvObject);
88 else
90 TRACE("Unsupported interface %s\n", debugstr_guid(riid));
91 *ppvObject = NULL;
92 return E_NOINTERFACE;
95 IUnknown_AddRef((IUnknown*)*ppvObject);
96 return S_OK;
99 static ULONG WINAPI dom_pi_AddRef(
100 IXMLDOMProcessingInstruction *iface )
102 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
103 ULONG ref = InterlockedIncrement( &This->ref );
104 TRACE("(%p)->(%d)\n", This, ref);
105 return ref;
108 static ULONG WINAPI dom_pi_Release(
109 IXMLDOMProcessingInstruction *iface )
111 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
112 ULONG ref = InterlockedDecrement( &This->ref );
114 TRACE("(%p)->(%d)\n", This, ref);
115 if ( ref == 0 )
117 destroy_xmlnode(&This->node);
118 heap_free( This );
121 return ref;
124 static HRESULT WINAPI dom_pi_GetTypeInfoCount(
125 IXMLDOMProcessingInstruction *iface,
126 UINT* pctinfo )
128 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
129 return IDispatchEx_GetTypeInfoCount(&This->node.dispex.IDispatchEx_iface, pctinfo);
132 static HRESULT WINAPI dom_pi_GetTypeInfo(
133 IXMLDOMProcessingInstruction *iface,
134 UINT iTInfo, LCID lcid,
135 ITypeInfo** ppTInfo )
137 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
138 return IDispatchEx_GetTypeInfo(&This->node.dispex.IDispatchEx_iface,
139 iTInfo, lcid, ppTInfo);
142 static HRESULT WINAPI dom_pi_GetIDsOfNames(
143 IXMLDOMProcessingInstruction *iface,
144 REFIID riid, LPOLESTR* rgszNames,
145 UINT cNames, LCID lcid, DISPID* rgDispId )
147 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
148 return IDispatchEx_GetIDsOfNames(&This->node.dispex.IDispatchEx_iface,
149 riid, rgszNames, cNames, lcid, rgDispId);
152 static HRESULT WINAPI dom_pi_Invoke(
153 IXMLDOMProcessingInstruction *iface,
154 DISPID dispIdMember, REFIID riid, LCID lcid,
155 WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult,
156 EXCEPINFO* pExcepInfo, UINT* puArgErr )
158 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
159 return IDispatchEx_Invoke(&This->node.dispex.IDispatchEx_iface,
160 dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
163 static HRESULT WINAPI dom_pi_get_nodeName(
164 IXMLDOMProcessingInstruction *iface,
165 BSTR* p )
167 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
169 TRACE("(%p)->(%p)\n", This, p);
171 return node_get_nodeName(&This->node, p);
174 static HRESULT WINAPI dom_pi_get_nodeValue(
175 IXMLDOMProcessingInstruction *iface,
176 VARIANT* value)
178 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
180 TRACE("(%p)->(%p)\n", This, value);
182 return node_get_content(&This->node, value);
185 static HRESULT WINAPI dom_pi_put_nodeValue(
186 IXMLDOMProcessingInstruction *iface,
187 VARIANT value)
189 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
190 BSTR target;
191 HRESULT hr;
193 TRACE("(%p)->(%s)\n", This, debugstr_variant(&value));
195 /* Cannot set data to a PI node whose target is 'xml' */
196 hr = IXMLDOMProcessingInstruction_get_nodeName(iface, &target);
197 if(hr == S_OK)
199 static const WCHAR xmlW[] = {'x','m','l',0};
200 if(!strcmpW(target, xmlW))
202 SysFreeString(target);
203 return E_FAIL;
206 SysFreeString(target);
209 return node_put_value(&This->node, &value);
212 static HRESULT WINAPI dom_pi_get_nodeType(
213 IXMLDOMProcessingInstruction *iface,
214 DOMNodeType* domNodeType )
216 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
218 TRACE("(%p)->(%p)\n", This, domNodeType);
220 *domNodeType = NODE_PROCESSING_INSTRUCTION;
221 return S_OK;
224 static HRESULT WINAPI dom_pi_get_parentNode(
225 IXMLDOMProcessingInstruction *iface,
226 IXMLDOMNode** parent )
228 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
230 TRACE("(%p)->(%p)\n", This, parent);
232 return node_get_parent(&This->node, parent);
235 static HRESULT WINAPI dom_pi_get_childNodes(
236 IXMLDOMProcessingInstruction *iface,
237 IXMLDOMNodeList** outList)
239 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
241 TRACE("(%p)->(%p)\n", This, outList);
243 return node_get_child_nodes(&This->node, outList);
246 static HRESULT WINAPI dom_pi_get_firstChild(
247 IXMLDOMProcessingInstruction *iface,
248 IXMLDOMNode** domNode)
250 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
252 TRACE("(%p)->(%p)\n", This, domNode);
254 return return_null_node(domNode);
257 static HRESULT WINAPI dom_pi_get_lastChild(
258 IXMLDOMProcessingInstruction *iface,
259 IXMLDOMNode** domNode)
261 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
263 TRACE("(%p)->(%p)\n", This, domNode);
265 return return_null_node(domNode);
268 static HRESULT WINAPI dom_pi_get_previousSibling(
269 IXMLDOMProcessingInstruction *iface,
270 IXMLDOMNode** domNode)
272 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
274 TRACE("(%p)->(%p)\n", This, domNode);
276 return node_get_previous_sibling(&This->node, domNode);
279 static HRESULT WINAPI dom_pi_get_nextSibling(
280 IXMLDOMProcessingInstruction *iface,
281 IXMLDOMNode** domNode)
283 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
285 TRACE("(%p)->(%p)\n", This, domNode);
287 return node_get_next_sibling(&This->node, domNode);
290 static HRESULT WINAPI dom_pi_get_attributes(
291 IXMLDOMProcessingInstruction *iface,
292 IXMLDOMNamedNodeMap** map)
294 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
295 static const WCHAR xmlW[] = {'x','m','l',0};
296 HRESULT hr;
297 BSTR name;
299 TRACE("(%p)->(%p)\n", This, map);
301 if (!map) return E_INVALIDARG;
303 *map = NULL;
305 hr = node_get_nodeName(&This->node, &name);
306 if (hr != S_OK) return hr;
308 if (!strcmpW(name, xmlW))
310 FIXME("created dummy map for <?xml ?>\n");
311 *map = create_nodemap(This->node.node, &dom_pi_attr_map);
312 SysFreeString(name);
313 return S_OK;
316 SysFreeString(name);
318 return S_FALSE;
321 static HRESULT WINAPI dom_pi_insertBefore(
322 IXMLDOMProcessingInstruction *iface,
323 IXMLDOMNode* newNode, VARIANT refChild,
324 IXMLDOMNode** outOldNode)
326 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
328 FIXME("(%p)->(%p %s %p) needs test\n", This, newNode, debugstr_variant(&refChild), outOldNode);
330 return node_insert_before(&This->node, newNode, &refChild, outOldNode);
333 static HRESULT WINAPI dom_pi_replaceChild(
334 IXMLDOMProcessingInstruction *iface,
335 IXMLDOMNode* newNode,
336 IXMLDOMNode* oldNode,
337 IXMLDOMNode** outOldNode)
339 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
341 FIXME("(%p)->(%p %p %p) needs test\n", This, newNode, oldNode, outOldNode);
343 return node_replace_child(&This->node, newNode, oldNode, outOldNode);
346 static HRESULT WINAPI dom_pi_removeChild(
347 IXMLDOMProcessingInstruction *iface,
348 IXMLDOMNode *child, IXMLDOMNode **oldChild)
350 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
351 TRACE("(%p)->(%p %p)\n", This, child, oldChild);
352 return node_remove_child(&This->node, child, oldChild);
355 static HRESULT WINAPI dom_pi_appendChild(
356 IXMLDOMProcessingInstruction *iface,
357 IXMLDOMNode *child, IXMLDOMNode **outChild)
359 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
360 TRACE("(%p)->(%p %p)\n", This, child, outChild);
361 return node_append_child(&This->node, child, outChild);
364 static HRESULT WINAPI dom_pi_hasChildNodes(
365 IXMLDOMProcessingInstruction *iface,
366 VARIANT_BOOL *ret)
368 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
369 TRACE("(%p)->(%p)\n", This, ret);
370 return node_has_childnodes(&This->node, ret);
373 static HRESULT WINAPI dom_pi_get_ownerDocument(
374 IXMLDOMProcessingInstruction *iface,
375 IXMLDOMDocument **doc)
377 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
378 TRACE("(%p)->(%p)\n", This, doc);
379 return node_get_owner_doc(&This->node, doc);
382 static HRESULT WINAPI dom_pi_cloneNode(
383 IXMLDOMProcessingInstruction *iface,
384 VARIANT_BOOL deep, IXMLDOMNode** outNode)
386 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
387 TRACE("(%p)->(%d %p)\n", This, deep, outNode);
388 return node_clone( &This->node, deep, outNode );
391 static HRESULT WINAPI dom_pi_get_nodeTypeString(
392 IXMLDOMProcessingInstruction *iface,
393 BSTR* p)
395 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
396 static const WCHAR processinginstructionW[] =
397 {'p','r','o','c','e','s','s','i','n','g','i','n','s','t','r','u','c','t','i','o','n',0};
399 TRACE("(%p)->(%p)\n", This, p);
401 return return_bstr(processinginstructionW, p);
404 static HRESULT WINAPI dom_pi_get_text(
405 IXMLDOMProcessingInstruction *iface,
406 BSTR* p)
408 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
409 TRACE("(%p)->(%p)\n", This, p);
410 return node_get_text(&This->node, p);
413 static HRESULT WINAPI dom_pi_put_text(
414 IXMLDOMProcessingInstruction *iface,
415 BSTR p)
417 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
418 TRACE("(%p)->(%s)\n", This, debugstr_w(p));
419 return node_put_text( &This->node, p );
422 static HRESULT WINAPI dom_pi_get_specified(
423 IXMLDOMProcessingInstruction *iface,
424 VARIANT_BOOL* isSpecified)
426 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
427 FIXME("(%p)->(%p) stub!\n", This, isSpecified);
428 *isSpecified = VARIANT_TRUE;
429 return S_OK;
432 static HRESULT WINAPI dom_pi_get_definition(
433 IXMLDOMProcessingInstruction *iface,
434 IXMLDOMNode** definitionNode)
436 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
437 FIXME("(%p)->(%p)\n", This, definitionNode);
438 return E_NOTIMPL;
441 static HRESULT WINAPI dom_pi_get_nodeTypedValue(
442 IXMLDOMProcessingInstruction *iface,
443 VARIANT* v)
445 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
446 TRACE("(%p)->(%p)\n", This, v);
447 return node_get_content(&This->node, v);
450 static HRESULT WINAPI dom_pi_put_nodeTypedValue(
451 IXMLDOMProcessingInstruction *iface,
452 VARIANT typedValue)
454 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
455 FIXME("(%p)->(%s)\n", This, debugstr_variant(&typedValue));
456 return E_NOTIMPL;
459 static HRESULT WINAPI dom_pi_get_dataType(
460 IXMLDOMProcessingInstruction *iface,
461 VARIANT* typename)
463 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
464 TRACE("(%p)->(%p)\n", This, typename);
465 return return_null_var( typename );
468 static HRESULT WINAPI dom_pi_put_dataType(
469 IXMLDOMProcessingInstruction *iface,
470 BSTR p)
472 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
474 TRACE("(%p)->(%s)\n", This, debugstr_w(p));
476 if(!p)
477 return E_INVALIDARG;
479 return E_FAIL;
482 static HRESULT WINAPI dom_pi_get_xml(
483 IXMLDOMProcessingInstruction *iface,
484 BSTR* p)
486 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
488 TRACE("(%p)->(%p)\n", This, p);
490 return node_get_xml(&This->node, FALSE, p);
493 static HRESULT WINAPI dom_pi_transformNode(
494 IXMLDOMProcessingInstruction *iface,
495 IXMLDOMNode *node, BSTR *p)
497 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
498 TRACE("(%p)->(%p %p)\n", This, node, p);
499 return node_transform_node(&This->node, node, p);
502 static HRESULT WINAPI dom_pi_selectNodes(
503 IXMLDOMProcessingInstruction *iface,
504 BSTR p, IXMLDOMNodeList** outList)
506 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
507 TRACE("(%p)->(%s %p)\n", This, debugstr_w(p), outList);
508 return node_select_nodes(&This->node, p, outList);
511 static HRESULT WINAPI dom_pi_selectSingleNode(
512 IXMLDOMProcessingInstruction *iface,
513 BSTR p, IXMLDOMNode** outNode)
515 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
516 TRACE("(%p)->(%s %p)\n", This, debugstr_w(p), outNode);
517 return node_select_singlenode(&This->node, p, outNode);
520 static HRESULT WINAPI dom_pi_get_parsed(
521 IXMLDOMProcessingInstruction *iface,
522 VARIANT_BOOL* isParsed)
524 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
525 FIXME("(%p)->(%p) stub!\n", This, isParsed);
526 *isParsed = VARIANT_TRUE;
527 return S_OK;
530 static HRESULT WINAPI dom_pi_get_namespaceURI(
531 IXMLDOMProcessingInstruction *iface,
532 BSTR* p)
534 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
535 TRACE("(%p)->(%p)\n", This, p);
536 return node_get_namespaceURI(&This->node, p);
539 static HRESULT WINAPI dom_pi_get_prefix(
540 IXMLDOMProcessingInstruction *iface,
541 BSTR* prefix)
543 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
544 TRACE("(%p)->(%p)\n", This, prefix);
545 return return_null_bstr( prefix );
548 static HRESULT WINAPI dom_pi_get_baseName(
549 IXMLDOMProcessingInstruction *iface,
550 BSTR* name)
552 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
553 TRACE("(%p)->(%p)\n", This, name);
554 return node_get_base_name( &This->node, name );
557 static HRESULT WINAPI dom_pi_transformNodeToObject(
558 IXMLDOMProcessingInstruction *iface,
559 IXMLDOMNode* domNode, VARIANT var1)
561 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
562 FIXME("(%p)->(%p %s)\n", This, domNode, debugstr_variant(&var1));
563 return E_NOTIMPL;
566 static HRESULT WINAPI dom_pi_get_target(
567 IXMLDOMProcessingInstruction *iface,
568 BSTR *p)
570 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
572 TRACE("(%p)->(%p)\n", This, p);
574 /* target returns the same value as nodeName property */
575 return node_get_nodeName(&This->node, p);
578 static HRESULT WINAPI dom_pi_get_data(
579 IXMLDOMProcessingInstruction *iface,
580 BSTR *p)
582 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
583 HRESULT hr;
584 VARIANT ret;
586 TRACE("(%p)->(%p)\n", This, p);
588 if(!p)
589 return E_INVALIDARG;
591 hr = IXMLDOMProcessingInstruction_get_nodeValue( iface, &ret );
592 if(hr == S_OK)
594 *p = V_BSTR(&ret);
597 return hr;
600 static HRESULT WINAPI dom_pi_put_data(
601 IXMLDOMProcessingInstruction *iface,
602 BSTR data)
604 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
605 BSTR target;
606 HRESULT hr;
608 TRACE("(%p)->(%s)\n", This, debugstr_w(data) );
610 /* cannot set data to a PI node whose target is 'xml' */
611 hr = IXMLDOMProcessingInstruction_get_nodeName(iface, &target);
612 if(hr == S_OK)
614 static const WCHAR xmlW[] = {'x','m','l',0};
615 if(!strcmpW(target, xmlW))
617 SysFreeString(target);
618 return E_FAIL;
621 SysFreeString(target);
624 return node_set_content(&This->node, data);
627 static const struct IXMLDOMProcessingInstructionVtbl dom_pi_vtbl =
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,
673 dom_pi_get_target,
674 dom_pi_get_data,
675 dom_pi_put_data
678 static HRESULT dom_pi_get_qualified_item(const xmlNodePtr node, BSTR name, BSTR uri,
679 IXMLDOMNode **item)
681 FIXME("(%p)->(%s %s %p): stub\n", node, debugstr_w(name), debugstr_w(uri), item);
682 return E_NOTIMPL;
685 static HRESULT dom_pi_get_named_item(const xmlNodePtr node, BSTR name, IXMLDOMNode **item)
687 FIXME("(%p)->(%s %p): stub\n", node, debugstr_w(name), item );
688 if (item)
689 *item = NULL;
690 return S_FALSE;
693 static HRESULT dom_pi_set_named_item(xmlNodePtr node, IXMLDOMNode *newItem, IXMLDOMNode **namedItem)
695 FIXME("(%p)->(%p %p): stub\n", node, newItem, namedItem );
696 return E_NOTIMPL;
699 static HRESULT dom_pi_remove_qualified_item(xmlNodePtr node, BSTR name, BSTR uri, IXMLDOMNode **item)
701 FIXME("(%p)->(%s %s %p): stub\n", node, debugstr_w(name), debugstr_w(uri), item);
702 return E_NOTIMPL;
705 static HRESULT dom_pi_remove_named_item(xmlNodePtr node, BSTR name, IXMLDOMNode **item)
707 FIXME("(%p)->(%s %p): stub\n", node, debugstr_w(name), item);
708 return E_NOTIMPL;
711 static HRESULT dom_pi_get_item(const xmlNodePtr node, LONG index, IXMLDOMNode **item)
713 FIXME("(%p)->(%d %p): stub\n", node, index, item);
714 return E_NOTIMPL;
717 static HRESULT dom_pi_get_length(const xmlNodePtr node, LONG *length)
719 FIXME("(%p)->(%p): stub\n", node, length);
721 *length = 0;
722 return S_OK;
725 static HRESULT dom_pi_next_node(const xmlNodePtr node, LONG *iter, IXMLDOMNode **nextNode)
727 FIXME("(%p)->(%d %p): stub\n", node, *iter, nextNode);
728 return E_NOTIMPL;
731 static const struct nodemap_funcs dom_pi_attr_map = {
732 dom_pi_get_named_item,
733 dom_pi_set_named_item,
734 dom_pi_remove_named_item,
735 dom_pi_get_item,
736 dom_pi_get_length,
737 dom_pi_get_qualified_item,
738 dom_pi_remove_qualified_item,
739 dom_pi_next_node
742 static const tid_t dompi_iface_tids[] = {
743 IXMLDOMProcessingInstruction_tid,
747 static dispex_static_data_t dompi_dispex = {
748 NULL,
749 IXMLDOMProcessingInstruction_tid,
750 NULL,
751 dompi_iface_tids
754 IUnknown* create_pi( xmlNodePtr pi )
756 dom_pi *This;
758 This = heap_alloc( sizeof *This );
759 if ( !This )
760 return NULL;
762 This->IXMLDOMProcessingInstruction_iface.lpVtbl = &dom_pi_vtbl;
763 This->ref = 1;
765 init_xmlnode(&This->node, pi, (IXMLDOMNode*)&This->IXMLDOMProcessingInstruction_iface, &dompi_dispex);
767 return (IUnknown*)&This->IXMLDOMProcessingInstruction_iface;
770 #endif