ReactOS 0.4.16-dev-2208-g6350669
selection.c
Go to the documentation of this file.
1/*
2 * XPath/XSLPattern query result node list implementation
3 *
4 * Copyright 2005 Mike McCormack
5 * Copyright 2007 Mikolaj Zalewski
6 * Copyright 2010 Adam Martinson for CodeWeavers
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 */
22
23#define COBJMACROS
24
25#include <stdarg.h>
26#include <libxml/parser.h>
27#include <libxml/xmlerror.h>
28#include <libxml/xpath.h>
30
31#include "windef.h"
32#include "winbase.h"
33#include "winuser.h"
34#include "ole2.h"
35#include "msxml6.h"
36#include "msxml2did.h"
37
38#include "msxml_private.h"
39
40#include "wine/debug.h"
41
42/* This file implements the object returned by a XPath query. Note that this is
43 * not the IXMLDOMNodeList returned by childNodes - it's implemented in nodelist.c.
44 * They are different because the list returned by XPath queries:
45 * - is static - gives the results for the XML tree as it existed during the
46 * execution of the query
47 * - supports IXMLDOMSelection
48 *
49 */
50
52
53int registerNamespaces(xmlXPathContextPtr ctxt);
54xmlChar* XSLPattern_to_XPath(xmlXPathContextPtr ctxt, xmlChar const* xslpat_str);
55
56typedef struct
57{
60
63
65
66 const struct enumvariant_funcs *funcs;
68
69typedef struct
70{
74 xmlNodePtr node;
75 xmlXPathObjectPtr result;
79
81{
83 return IXMLDOMSelection_get_item((IXMLDOMSelection*)iface, index, (IXMLDOMNode**)&V_DISPATCH(item));
84}
85
87{
89 HRESULT hr = IXMLDOMSelection_nextNode((IXMLDOMSelection*)iface, &node);
90 if (hr == S_OK) IXMLDOMNode_Release(node);
91 return hr;
92}
93
97};
98
100{
101 return CONTAINING_RECORD(iface, domselection, IXMLDOMSelection_iface);
102}
103
105{
106 return CONTAINING_RECORD(iface, enumvariant, IEnumVARIANT_iface);
107}
108
110 IXMLDOMSelection *iface,
111 REFIID riid,
112 void** ppvObject )
113{
115
116 TRACE("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppvObject);
117
118 if(!ppvObject)
119 return E_INVALIDARG;
120
121 if ( IsEqualGUID( riid, &IID_IUnknown ) ||
122 IsEqualGUID( riid, &IID_IXMLDOMNodeList ) ||
123 IsEqualGUID( riid, &IID_IXMLDOMSelection ))
124 {
125 *ppvObject = &This->IXMLDOMSelection_iface;
126 }
127 else if (IsEqualGUID( riid, &IID_IEnumVARIANT ))
128 {
129 if (!This->enumvariant)
130 {
132 if (FAILED(hr)) return hr;
133 }
134
135 return IEnumVARIANT_QueryInterface(This->enumvariant, &IID_IEnumVARIANT, ppvObject);
136 }
137 else if (dispex_query_interface(&This->dispex, riid, ppvObject))
138 {
139 return *ppvObject ? S_OK : E_NOINTERFACE;
140 }
141 else
142 {
143 TRACE("interface %s not implemented\n", debugstr_guid(riid));
144 *ppvObject = NULL;
145 return E_NOINTERFACE;
146 }
147
148 IXMLDOMSelection_AddRef( iface );
149
150 return S_OK;
151}
152
154 IXMLDOMSelection *iface )
155{
158 TRACE("%p, refcount %lu.\n", iface, ref);
159 return ref;
160}
161
163 IXMLDOMSelection *iface )
164{
167
168 TRACE("%p, refcount %lu.\n", iface, ref);
169 if ( ref == 0 )
170 {
171 xmlXPathFreeObject(This->result);
172 xmldoc_release(This->node->doc);
173 if (This->enumvariant) IEnumVARIANT_Release(This->enumvariant);
174 free(This);
175 }
176
177 return ref;
178}
179
181 IXMLDOMSelection *iface,
182 UINT* pctinfo )
183{
185 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
186}
187
189 IXMLDOMSelection *iface,
190 UINT iTInfo,
191 LCID lcid,
192 ITypeInfo** ppTInfo )
193{
195 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface,
196 iTInfo, lcid, ppTInfo);
197}
198
200 IXMLDOMSelection *iface,
201 REFIID riid,
202 LPOLESTR* rgszNames,
203 UINT cNames,
204 LCID lcid,
205 DISPID* rgDispId )
206{
208 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface,
209 riid, rgszNames, cNames, lcid, rgDispId);
210}
211
213 IXMLDOMSelection *iface,
214 DISPID dispIdMember,
215 REFIID riid,
216 LCID lcid,
217 WORD wFlags,
218 DISPPARAMS* pDispParams,
219 VARIANT* pVarResult,
220 EXCEPINFO* pExcepInfo,
221 UINT* puArgErr )
222{
224 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface,
225 dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
226}
227
229 IXMLDOMSelection* iface,
230 LONG index,
231 IXMLDOMNode** listItem)
232{
234
235 TRACE("%p, %ld, %p.\n", iface, index, listItem);
236
237 if(!listItem)
238 return E_INVALIDARG;
239
240 *listItem = NULL;
241
242 if (index < 0 || index >= xmlXPathNodeSetGetLength(This->result->nodesetval))
243 return S_FALSE;
244
245 *listItem = create_node(xmlXPathNodeSetItem(This->result->nodesetval, index));
246 This->resultPos = index + 1;
247
248 return S_OK;
249}
250
252 IXMLDOMSelection* iface,
253 LONG* listLength)
254{
256
257 TRACE("(%p)->(%p)\n", This, listLength);
258
259 if(!listLength)
260 return E_INVALIDARG;
261
262 *listLength = xmlXPathNodeSetGetLength(This->result->nodesetval);
263 return S_OK;
264}
265
267 IXMLDOMSelection* iface,
268 IXMLDOMNode** nextItem)
269{
271
272 TRACE("(%p)->(%p)\n", This, nextItem );
273
274 if(!nextItem)
275 return E_INVALIDARG;
276
277 *nextItem = NULL;
278
279 if (This->resultPos >= xmlXPathNodeSetGetLength(This->result->nodesetval))
280 return S_FALSE;
281
282 *nextItem = create_node(xmlXPathNodeSetItem(This->result->nodesetval, This->resultPos));
283 This->resultPos++;
284 return S_OK;
285}
286
288 IXMLDOMSelection* iface)
289{
291
292 TRACE("%p\n", This);
293 This->resultPos = 0;
294 return S_OK;
295}
296
298 IXMLDOMSelection* iface,
299 IUnknown** enumv)
300{
302
303 TRACE("(%p)->(%p)\n", This, enumv);
304
306}
307
309 IXMLDOMSelection* iface,
310 BSTR *p)
311{
313 FIXME("(%p)->(%p)\n", This, p);
314 return E_NOTIMPL;
315}
316
318 IXMLDOMSelection* iface,
319 BSTR p)
320{
322 FIXME("(%p)->(%s)\n", This, debugstr_w(p));
323 return E_NOTIMPL;
324}
325
327 IXMLDOMSelection* iface,
329{
331 FIXME("(%p)->(%p)\n", This, node);
332 return E_NOTIMPL;
333}
334
336 IXMLDOMSelection* iface,
338{
340 FIXME("(%p)->(%p)\n", This, node);
341 return E_NOTIMPL;
342}
343
345 IXMLDOMSelection* iface,
347{
349 FIXME("(%p)->(%p)\n", This, node);
350 return E_NOTIMPL;
351}
352
354 IXMLDOMSelection* iface,
356 IXMLDOMNode **out_node)
357{
359 FIXME("(%p)->(%p %p)\n", This, node, out_node);
360 return E_NOTIMPL;
361}
362
364 IXMLDOMSelection* iface,
366{
368 FIXME("(%p)->(%p)\n", This, node);
369 return E_NOTIMPL;
370}
371
373 IXMLDOMSelection* iface)
374{
376 FIXME("(%p)\n", This);
377 return E_NOTIMPL;
378}
379
381 IXMLDOMSelection* iface,
383{
385 FIXME("(%p)->(%p)\n", This, node);
386 return E_NOTIMPL;
387}
388
390 IXMLDOMSelection* iface,
391 BSTR p,
392 VARIANT *var)
393{
395 FIXME("(%p)->(%s %p)\n", This, debugstr_w(p), var);
396 return E_NOTIMPL;
397}
398
400 IXMLDOMSelection* iface,
401 BSTR p,
402 VARIANT var)
403{
405 FIXME("(%p)->(%s %s)\n", This, debugstr_w(p), debugstr_variant(&var));
406 return E_NOTIMPL;
407}
408
409static const struct IXMLDOMSelectionVtbl domselection_vtbl =
410{
434};
435
436/* IEnumVARIANT support */
438 IEnumVARIANT *iface,
439 REFIID riid,
440 void** ppvObject )
441{
443
444 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
445
446 *ppvObject = NULL;
447
449 {
450 if (This->own)
451 *ppvObject = &This->IEnumVARIANT_iface;
452 else
453 return IUnknown_QueryInterface(This->outer, riid, ppvObject);
454 }
455 else if (IsEqualGUID( riid, &IID_IEnumVARIANT ))
456 {
457 *ppvObject = &This->IEnumVARIANT_iface;
458 }
459 else
460 return IUnknown_QueryInterface(This->outer, riid, ppvObject);
461
462 IEnumVARIANT_AddRef( iface );
463
464 return S_OK;
465}
466
468{
471 TRACE("%p, refcount %lu.\n", iface, ref);
472 return ref;
473}
474
476{
479
480 TRACE("%p, refcount %lu.\n", iface, ref);
481 if ( ref == 0 )
482 {
483 if (This->own) IUnknown_Release(This->outer);
484 free(This);
485 }
486
487 return ref;
488}
489
491 IEnumVARIANT *iface,
492 ULONG celt,
493 VARIANT *var,
494 ULONG *fetched)
495{
497 ULONG ret_count = 0;
498
499 TRACE("%p, %lu, %p, %p.\n", iface, celt, var, fetched);
500
501 if (fetched) *fetched = 0;
502
503 if (celt && !var) return E_INVALIDARG;
504
505 for (; celt > 0; celt--, var++, This->pos++)
506 {
507 HRESULT hr = This->funcs->get_item(This->outer, This->pos, var);
508 if (hr != S_OK)
509 {
510 V_VT(var) = VT_EMPTY;
511 break;
512 }
513 ret_count++;
514 }
515
516 if (fetched) *fetched = ret_count;
517
518 /* we need to advance one step more for some reason */
519 if (ret_count)
520 {
521 if (This->funcs->next)
522 This->funcs->next(This->outer);
523 }
524
525 return celt == 0 ? S_OK : S_FALSE;
526}
527
529 IEnumVARIANT *iface,
530 ULONG celt)
531{
532 FIXME("%p, %lu: stub\n", iface, celt);
533
534 return E_NOTIMPL;
535}
536
538{
540
541 TRACE("%p\n", This);
542 This->pos = 0;
543 return S_OK;
544}
545
547 IEnumVARIANT *iface, IEnumVARIANT **ppenum)
548{
550 FIXME("(%p)->(%p): stub\n", This, ppenum);
551 return E_NOTIMPL;
552}
553
554static const struct IEnumVARIANTVtbl EnumVARIANTVtbl =
555{
563};
564
566{
568
569 This = malloc(sizeof(enumvariant));
570 if (!This) return E_OUTOFMEMORY;
571
572 This->IEnumVARIANT_iface.lpVtbl = &EnumVARIANTVtbl;
573 This->ref = 0;
574 This->outer = outer;
575 This->own = own;
576 This->pos = 0;
577 This->funcs = funcs;
578
579 if (This->own)
580 IUnknown_AddRef(This->outer);
581
582 *penum = &This->IEnumVARIANT_iface;
583 IEnumVARIANT_AddRef(*penum);
584 return S_OK;
585}
586
588{
589 WCHAR *ptr;
590 int idx = 0;
591
592 for(ptr = name; *ptr >= '0' && *ptr <= '9'; ptr++)
593 idx = idx*10 + (*ptr-'0');
594 if(*ptr)
595 return DISP_E_UNKNOWNNAME;
596
598 TRACE("ret %lx\n", *dispid);
599 return S_OK;
600}
601
603 VARIANT *res, EXCEPINFO *ei)
604{
606
607 TRACE("%p, %ld, %lx, %x, %p, %p, %p.\n", iface, id, lcid, flags, params, res, ei);
608
611
612 if (id < DISPID_DOM_COLLECTION_BASE || id > DISPID_DOM_COLLECTION_MAX)
613 return DISP_E_UNKNOWNNAME;
614
615 switch(flags)
616 {
617 case INVOKE_PROPERTYGET:
618 {
619 IXMLDOMNode *disp = NULL;
620
621 IXMLDOMSelection_get_item(&This->IXMLDOMSelection_iface, id - DISPID_DOM_COLLECTION_BASE, &disp);
622 V_DISPATCH(res) = (IDispatch*)disp;
623 break;
624 }
625 default:
626 {
627 FIXME("unimplemented flags %x\n", flags);
628 break;
629 }
630 }
631
632 TRACE("ret %p\n", V_DISPATCH(res));
633
634 return S_OK;
635}
636
640};
641
644 0
645};
649 NULL,
651};
652
653#define XSLPATTERN_CHECK_ARGS(n) \
654 if (nargs != n) { \
655 FIXME("XSLPattern syntax error: Expected %i arguments, got %i\n", n, nargs); \
656 xmlXPathSetArityError(pctx); \
657 return; \
658 }
659
660
661static void XSLPattern_index(xmlXPathParserContextPtr pctx, int nargs)
662{
664
665 xmlXPathPositionFunction(pctx, 0);
666 xmlXPathReturnNumber(pctx, xmlXPathPopNumber(pctx) - 1.0);
667}
668
669static void XSLPattern_end(xmlXPathParserContextPtr pctx, int nargs)
670{
671 double pos, last;
673
674 xmlXPathPositionFunction(pctx, 0);
675 pos = xmlXPathPopNumber(pctx);
676 xmlXPathLastFunction(pctx, 0);
677 last = xmlXPathPopNumber(pctx);
678 xmlXPathReturnBoolean(pctx, pos == last);
679}
680
681static void XSLPattern_nodeType(xmlXPathParserContextPtr pctx, int nargs)
682{
684 xmlXPathReturnNumber(pctx, pctx->context->node->type);
685}
686
687static void XSLPattern_OP_IEq(xmlXPathParserContextPtr pctx, int nargs)
688{
689 xmlChar *arg1, *arg2;
691
692 arg2 = xmlXPathPopString(pctx);
693 arg1 = xmlXPathPopString(pctx);
694 xmlXPathReturnBoolean(pctx, xmlStrcasecmp(arg1, arg2) == 0);
695 xmlFree(arg1);
696 xmlFree(arg2);
697}
698
699static void XSLPattern_OP_INEq(xmlXPathParserContextPtr pctx, int nargs)
700{
701 xmlChar *arg1, *arg2;
703
704 arg2 = xmlXPathPopString(pctx);
705 arg1 = xmlXPathPopString(pctx);
706 xmlXPathReturnBoolean(pctx, xmlStrcasecmp(arg1, arg2) != 0);
707 xmlFree(arg1);
708 xmlFree(arg2);
709}
710
711static void XSLPattern_OP_ILt(xmlXPathParserContextPtr pctx, int nargs)
712{
713 xmlChar *arg1, *arg2;
715
716 arg2 = xmlXPathPopString(pctx);
717 arg1 = xmlXPathPopString(pctx);
718 xmlXPathReturnBoolean(pctx, xmlStrcasecmp(arg1, arg2) < 0);
719 xmlFree(arg1);
720 xmlFree(arg2);
721}
722
723static void XSLPattern_OP_ILEq(xmlXPathParserContextPtr pctx, int nargs)
724{
725 xmlChar *arg1, *arg2;
727
728 arg2 = xmlXPathPopString(pctx);
729 arg1 = xmlXPathPopString(pctx);
730 xmlXPathReturnBoolean(pctx, xmlStrcasecmp(arg1, arg2) <= 0);
731 xmlFree(arg1);
732 xmlFree(arg2);
733}
734
735static void XSLPattern_OP_IGt(xmlXPathParserContextPtr pctx, int nargs)
736{
737 xmlChar *arg1, *arg2;
739
740 arg2 = xmlXPathPopString(pctx);
741 arg1 = xmlXPathPopString(pctx);
742 xmlXPathReturnBoolean(pctx, xmlStrcasecmp(arg1, arg2) > 0);
743 xmlFree(arg1);
744 xmlFree(arg2);
745}
746
747static void XSLPattern_OP_IGEq(xmlXPathParserContextPtr pctx, int nargs)
748{
749 xmlChar *arg1, *arg2;
751
752 arg2 = xmlXPathPopString(pctx);
753 arg1 = xmlXPathPopString(pctx);
754 xmlXPathReturnBoolean(pctx, xmlStrcasecmp(arg1, arg2) >= 0);
755 xmlFree(arg1);
756 xmlFree(arg2);
757}
758
759static void query_serror(void* ctx, const xmlError* err)
760{
761 LIBXML2_CALLBACK_SERROR(domselection_create, err);
762}
763
765{
767 xmlXPathContextPtr ctxt = xmlXPathNewContext(node->doc);
768 HRESULT hr;
769
770 TRACE("(%p, %s, %p)\n", node, debugstr_a((char const*)query), out);
771
772 *out = NULL;
773 if (!This || !ctxt || !query)
774 {
775 xmlXPathFreeContext(ctxt);
776 free(This);
777 return E_OUTOFMEMORY;
778 }
779
780 This->IXMLDOMSelection_iface.lpVtbl = &domselection_vtbl;
781 This->ref = 1;
782 This->resultPos = 0;
783 This->node = node;
784 This->enumvariant = NULL;
785 init_dispex(&This->dispex, (IUnknown*)&This->IXMLDOMSelection_iface, &domselection_dispex);
786 xmldoc_add_ref(This->node->doc);
787
788 ctxt->error = query_serror;
789 ctxt->node = node;
790 registerNamespaces(ctxt);
791 xmlXPathContextSetCache(ctxt, 1, -1, 0);
792
793 if (is_xpathmode(This->node->doc))
794 {
795 xmlXPathRegisterAllFunctions(ctxt);
796 This->result = xmlXPathEvalExpression(query, ctxt);
797 }
798 else
799 {
800 xmlChar* pattern_query = XSLPattern_to_XPath(ctxt, query);
801
802 xmlXPathRegisterFunc(ctxt, (xmlChar const*)"not", xmlXPathNotFunction);
803 xmlXPathRegisterFunc(ctxt, (xmlChar const*)"boolean", xmlXPathBooleanFunction);
804
805 xmlXPathRegisterFunc(ctxt, (xmlChar const*)"index", XSLPattern_index);
806 xmlXPathRegisterFunc(ctxt, (xmlChar const*)"end", XSLPattern_end);
807 xmlXPathRegisterFunc(ctxt, (xmlChar const*)"nodeType", XSLPattern_nodeType);
808
809 xmlXPathRegisterFunc(ctxt, (xmlChar const*)"OP_IEq", XSLPattern_OP_IEq);
810 xmlXPathRegisterFunc(ctxt, (xmlChar const*)"OP_INEq", XSLPattern_OP_INEq);
811 xmlXPathRegisterFunc(ctxt, (xmlChar const*)"OP_ILt", XSLPattern_OP_ILt);
812 xmlXPathRegisterFunc(ctxt, (xmlChar const*)"OP_ILEq", XSLPattern_OP_ILEq);
813 xmlXPathRegisterFunc(ctxt, (xmlChar const*)"OP_IGt", XSLPattern_OP_IGt);
814 xmlXPathRegisterFunc(ctxt, (xmlChar const*)"OP_IGEq", XSLPattern_OP_IGEq);
815
816 This->result = xmlXPathEvalExpression(pattern_query, ctxt);
817 xmlFree(pattern_query);
818 }
819
820 if (!This->result || This->result->type != XPATH_NODESET)
821 {
822 hr = E_FAIL;
823 goto cleanup;
824 }
825
826 *out = (IXMLDOMNodeList*)&This->IXMLDOMSelection_iface;
827 hr = S_OK;
828 TRACE("found %d matches\n", xmlXPathNodeSetGetLength(This->result->nodesetval));
829
830cleanup:
831 if (FAILED(hr))
832 IXMLDOMSelection_Release( &This->IXMLDOMSelection_iface );
833 xmlXPathFreeContext(ctxt);
834 return hr;
835}
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: precomp.h:53
const GUID IID_IUnknown
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int idx
Definition: utils.c:41
OLECHAR * BSTR
Definition: compat.h:2293
@ VT_EMPTY
Definition: compat.h:2295
@ VT_DISPATCH
Definition: compat.h:2304
static void cleanup(void)
Definition: main.c:1335
LCID lcid
Definition: locale.c:5656
LONG xmldoc_release(xmlDocPtr doc)
Definition: domdoc.c:653
LONG xmldoc_add_ref(xmlDocPtr doc)
Definition: domdoc.c:619
BOOL is_xpathmode(const xmlDocPtr doc)
Definition: domdoc.c:225
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint res
Definition: glext.h:9613
GLuint GLuint GLuint GLuint arg1
Definition: glext.h:9513
GLuint index
Definition: glext.h:6031
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
Definition: glext.h:9514
GLenum const GLfloat * params
Definition: glext.h:5645
GLbitfield flags
Definition: glext.h:7161
GLfloat GLfloat p
Definition: glext.h:8902
static HRESULT create_node(HTMLDocumentNode *, nsIDOMNode *, HTMLDOMNode **)
Definition: htmlnode.c:1216
tid_t
Definition: ieframe.h:311
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT init_dispex(jsdisp_t *dispex, script_ctx_t *ctx, const builtin_info_t *builtin_info, jsdisp_t *prototype)
Definition: dispex.c:919
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
static PVOID ptr
Definition: dispmode.c:27
const char * var
Definition: shader.c:5666
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
static UINT UINT last
Definition: font.c:45
static LPOLESTR
Definition: stg_prop.c:27
static VARIANTARG static DISPID
Definition: ordinal.c:49
BOOL dispex_query_interface(DispatchEx *This, REFIID riid, void **ppv)
Definition: dispex.c:1656
#define DISPID_DOM_COLLECTION_MAX
Definition: msxml2did.h:71
#define DISPID_DOM_COLLECTION_BASE
Definition: msxml2did.h:70
static HRESULT WINAPI domselection_GetTypeInfo(IXMLDOMSelection *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: selection.c:188
static HRESULT WINAPI domselection_removeNext(IXMLDOMSelection *iface, IXMLDOMNode **node)
Definition: selection.c:363
static void XSLPattern_nodeType(xmlXPathParserContextPtr pctx, int nargs)
Definition: selection.c:681
static HRESULT WINAPI enumvariant_Clone(IEnumVARIANT *iface, IEnumVARIANT **ppenum)
Definition: selection.c:546
static HRESULT WINAPI domselection_get_item(IXMLDOMSelection *iface, LONG index, IXMLDOMNode **listItem)
Definition: selection.c:228
static HRESULT selection_get_item(IUnknown *iface, LONG index, VARIANT *item)
Definition: selection.c:80
static const struct IEnumVARIANTVtbl EnumVARIANTVtbl
Definition: selection.c:554
static ULONG WINAPI enumvariant_Release(IEnumVARIANT *iface)
Definition: selection.c:475
static void XSLPattern_OP_INEq(xmlXPathParserContextPtr pctx, int nargs)
Definition: selection.c:699
static HRESULT WINAPI domselection_putref_context(IXMLDOMSelection *iface, IXMLDOMNode *node)
Definition: selection.c:335
HRESULT create_enumvariant(IUnknown *outer, BOOL own, const struct enumvariant_funcs *funcs, IEnumVARIANT **penum)
Definition: selection.c:565
static void XSLPattern_end(xmlXPathParserContextPtr pctx, int nargs)
Definition: selection.c:669
#define XSLPATTERN_CHECK_ARGS(n)
Definition: selection.c:653
static HRESULT WINAPI domselection_put_expr(IXMLDOMSelection *iface, BSTR p)
Definition: selection.c:317
static void query_serror(void *ctx, const xmlError *err)
Definition: selection.c:759
static HRESULT WINAPI domselection_clone(IXMLDOMSelection *iface, IXMLDOMSelection **node)
Definition: selection.c:380
static HRESULT WINAPI enumvariant_Reset(IEnumVARIANT *iface)
Definition: selection.c:537
static HRESULT WINAPI enumvariant_Skip(IEnumVARIANT *iface, ULONG celt)
Definition: selection.c:528
static HRESULT WINAPI domselection_peekNode(IXMLDOMSelection *iface, IXMLDOMNode **node)
Definition: selection.c:344
static HRESULT WINAPI domselection_QueryInterface(IXMLDOMSelection *iface, REFIID riid, void **ppvObject)
Definition: selection.c:109
int registerNamespaces(xmlXPathContextPtr ctxt)
Definition: domdoc.c:235
static void XSLPattern_index(xmlXPathParserContextPtr pctx, int nargs)
Definition: selection.c:661
static void XSLPattern_OP_IGEq(xmlXPathParserContextPtr pctx, int nargs)
Definition: selection.c:747
static HRESULT domselection_get_dispid(IUnknown *iface, BSTR name, DWORD flags, DISPID *dispid)
Definition: selection.c:587
static HRESULT WINAPI domselection_get__newEnum(IXMLDOMSelection *iface, IUnknown **enumv)
Definition: selection.c:297
static dispex_static_data_t domselection_dispex
Definition: selection.c:646
static HRESULT WINAPI domselection_setProperty(IXMLDOMSelection *iface, BSTR p, VARIANT var)
Definition: selection.c:399
static HRESULT selection_next(IUnknown *iface)
Definition: selection.c:86
static void XSLPattern_OP_IGt(xmlXPathParserContextPtr pctx, int nargs)
Definition: selection.c:735
static HRESULT domselection_invoke(IUnknown *iface, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei)
Definition: selection.c:602
static HRESULT WINAPI domselection_GetIDsOfNames(IXMLDOMSelection *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: selection.c:199
static HRESULT WINAPI domselection_matches(IXMLDOMSelection *iface, IXMLDOMNode *node, IXMLDOMNode **out_node)
Definition: selection.c:353
static ULONG WINAPI domselection_AddRef(IXMLDOMSelection *iface)
Definition: selection.c:153
static void XSLPattern_OP_ILEq(xmlXPathParserContextPtr pctx, int nargs)
Definition: selection.c:723
static const struct enumvariant_funcs selection_enumvariant
Definition: selection.c:94
static void XSLPattern_OP_ILt(xmlXPathParserContextPtr pctx, int nargs)
Definition: selection.c:711
static HRESULT WINAPI enumvariant_QueryInterface(IEnumVARIANT *iface, REFIID riid, void **ppvObject)
Definition: selection.c:437
static const dispex_static_data_vtbl_t domselection_dispex_vtbl
Definition: selection.c:637
static void XSLPattern_OP_IEq(xmlXPathParserContextPtr pctx, int nargs)
Definition: selection.c:687
HRESULT create_selection(xmlNodePtr node, xmlChar *query, IXMLDOMNodeList **out)
Definition: selection.c:764
static HRESULT WINAPI domselection_removeAll(IXMLDOMSelection *iface)
Definition: selection.c:372
xmlChar * XSLPattern_to_XPath(xmlXPathContextPtr ctxt, xmlChar const *xslpat_str)
static HRESULT WINAPI domselection_get_expr(IXMLDOMSelection *iface, BSTR *p)
Definition: selection.c:308
static const struct IXMLDOMSelectionVtbl domselection_vtbl
Definition: selection.c:409
static HRESULT WINAPI domselection_Invoke(IXMLDOMSelection *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: selection.c:212
static domselection * impl_from_IXMLDOMSelection(IXMLDOMSelection *iface)
Definition: selection.c:99
static enumvariant * impl_from_IEnumVARIANT(IEnumVARIANT *iface)
Definition: selection.c:104
static HRESULT WINAPI domselection_GetTypeInfoCount(IXMLDOMSelection *iface, UINT *pctinfo)
Definition: selection.c:180
static ULONG WINAPI enumvariant_AddRef(IEnumVARIANT *iface)
Definition: selection.c:467
static HRESULT WINAPI domselection_reset(IXMLDOMSelection *iface)
Definition: selection.c:287
static HRESULT WINAPI domselection_get_length(IXMLDOMSelection *iface, LONG *listLength)
Definition: selection.c:251
static HRESULT WINAPI enumvariant_Next(IEnumVARIANT *iface, ULONG celt, VARIANT *var, ULONG *fetched)
Definition: selection.c:490
static HRESULT WINAPI domselection_getProperty(IXMLDOMSelection *iface, BSTR p, VARIANT *var)
Definition: selection.c:389
static const tid_t domselection_iface_tids[]
Definition: selection.c:642
static HRESULT WINAPI domselection_nextNode(IXMLDOMSelection *iface, IXMLDOMNode **nextItem)
Definition: selection.c:266
static HRESULT WINAPI domselection_get_context(IXMLDOMSelection *iface, IXMLDOMNode **node)
Definition: selection.c:326
static ULONG WINAPI domselection_Release(IXMLDOMSelection *iface)
Definition: selection.c:162
@ IXMLDOMSelection_tid
Definition: msxml_dispex.h:57
#define LIBXML2_CALLBACK_SERROR(caller, err)
unsigned int UINT
Definition: ndis.h:50
#define V_VT(A)
Definition: oleauto.h:211
#define V_DISPATCH(A)
Definition: oleauto.h:239
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
#define err(...)
DWORD LCID
Definition: nls.h:13
static struct __wine_debug_functions funcs
Definition: debug.c:48
xmlFreeFunc xmlFree
Definition: globals.c:184
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
IEnumVARIANT * enumvariant
Definition: selection.c:77
DispatchEx dispex
Definition: selection.c:71
xmlXPathObjectPtr result
Definition: selection.c:75
int resultPos
Definition: selection.c:76
xmlNodePtr node
Definition: selection.c:74
IXMLDOMSelection IXMLDOMSelection_iface
Definition: selection.c:72
IEnumVARIANT IEnumVARIANT_iface
Definition: selection.c:58
const struct enumvariant_funcs * funcs
Definition: selection.c:66
IUnknown * outer
Definition: selection.c:61
LONG ref
Definition: selection.c:59
LONG pos
Definition: selection.c:64
BOOL own
Definition: selection.c:62
Definition: name.c:39
Definition: send.c:48
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
Definition: dlist.c:348
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
WINBASEAPI _In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon_undoc.h:337
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:3451
#define E_NOINTERFACE
Definition: winerror.h:3479
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:3618
__wchar_t WCHAR
Definition: xmlstorage.h:180
XMLPUBFUN int xmlStrcasecmp(const xmlChar *str1, const xmlChar *str2)
Definition: xmlstring.c:277
unsigned char xmlChar
Definition: xmlstring.h:28