Commit c26c5599 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: Add IXMLDOMSelection stub.

parent c48b7566
......@@ -24,9 +24,9 @@ C_SRCS = \
nodemap.c \
parseerror.c \
pi.c \
queryresult.c \
saxreader.c \
schema.c \
selection.c \
stylesheet.c \
text.c \
uuid.c \
......
......@@ -1926,7 +1926,7 @@ static HRESULT WINAPI domdoc_getElementsByTagName(
XPath = This->properties->XPath;
This->properties->XPath = TRUE;
query = tagName_to_XPath(tagName);
hr = queryresult_create((xmlNodePtr)get_doc(This), query, resultList);
hr = create_selection((xmlNodePtr)get_doc(This), query, resultList);
xmlFree(query);
This->properties->XPath = XPath;
......
......@@ -1278,7 +1278,7 @@ static HRESULT WINAPI domelem_getElementsByTagName(
XPath = is_xpathmode(get_element(This)->doc);
set_xpathmode(get_element(This)->doc, TRUE);
query = tagName_to_XPath(tagName);
hr = queryresult_create(get_element(This), query, resultList);
hr = create_selection(get_element(This), query, resultList);
xmlFree(query);
set_xpathmode(get_element(This)->doc, XPath);
......
......@@ -213,23 +213,22 @@ static inline xmlNodePtr wine_xmlFirstElementChild(xmlNodePtr parent)
#endif
/* constructors */
extern IUnknown *create_domdoc( xmlNodePtr document );
extern IUnknown *create_domdoc( xmlNodePtr );
extern IUnknown *create_xmldoc( void );
extern IXMLDOMNode *create_node( xmlNodePtr node );
extern IUnknown *create_element( xmlNodePtr element );
extern IUnknown *create_attribute( xmlNodePtr attribute );
extern IUnknown *create_text( xmlNodePtr text );
extern IUnknown *create_pi( xmlNodePtr pi );
extern IUnknown *create_comment( xmlNodePtr comment );
extern IUnknown *create_cdata( xmlNodePtr text );
extern IXMLDOMNode *create_node( xmlNodePtr );
extern IUnknown *create_element( xmlNodePtr );
extern IUnknown *create_attribute( xmlNodePtr );
extern IUnknown *create_text( xmlNodePtr );
extern IUnknown *create_pi( xmlNodePtr );
extern IUnknown *create_comment( xmlNodePtr );
extern IUnknown *create_cdata( xmlNodePtr );
extern IXMLDOMNodeList *create_children_nodelist( xmlNodePtr );
extern IXMLDOMNamedNodeMap *create_nodemap( const xmlNodePtr );
extern IUnknown *create_doc_Implementation(void);
extern IUnknown *create_doc_fragment( xmlNodePtr fragment );
extern IUnknown *create_doc_entity_ref( xmlNodePtr entity );
extern IUnknown *create_doc_type( xmlNodePtr doctype );
extern HRESULT queryresult_create( xmlNodePtr node, xmlChar* szQuery, IXMLDOMNodeList** out );
extern IUnknown *create_doc_fragment( xmlNodePtr );
extern IUnknown *create_doc_entity_ref( xmlNodePtr );
extern IUnknown *create_doc_type( xmlNodePtr );
extern HRESULT create_selection( xmlNodePtr, xmlChar*, IXMLDOMNodeList** );
/* data accessors */
xmlNodePtr xmlNodePtr_from_domnode( IXMLDOMNode *iface, xmlElementType type );
......
......@@ -1032,7 +1032,7 @@ HRESULT node_select_nodes(const xmlnode *This, BSTR query, IXMLDOMNodeList **nod
if (!query || !nodes) return E_INVALIDARG;
str = xmlchar_from_wchar(query);
hr = queryresult_create(This->node, str, nodes);
hr = create_selection(This->node, str, nodes);
heap_free(str);
return hr;
......
......@@ -8603,6 +8603,40 @@ static void test_get_attributes(void)
free_bstrs();
}
static void test_selection(void)
{
IXMLDOMSelection *selection;
IXMLDOMNodeList *list;
IXMLDOMDocument *doc;
VARIANT_BOOL b;
HRESULT hr;
doc = create_document(&IID_IXMLDOMDocument);
hr = IXMLDOMDocument2_loadXML(doc, _bstr_(szExampleXML), &b);
EXPECT_HR(hr, S_OK);
hr = IXMLDOMDocument_selectNodes(doc, _bstr_("root"), &list);
EXPECT_HR(hr, S_OK);
hr = IXMLDOMNodeList_QueryInterface(list, &IID_IXMLDOMSelection, (void**)&selection);
EXPECT_HR(hr, S_OK);
IXMLDOMSelection_Release(selection);
IXMLDOMNodeList_Release(list);
hr = IXMLDOMDocument_get_childNodes(doc, &list);
EXPECT_HR(hr, S_OK);
hr = IXMLDOMNodeList_QueryInterface(list, &IID_IXMLDOMSelection, (void**)&selection);
EXPECT_HR(hr, E_NOINTERFACE);
IXMLDOMNodeList_Release(list);
IXMLDOMDocument_Release(doc);
free_bstrs();
}
START_TEST(domdoc)
{
IXMLDOMDocument *doc;
......@@ -8674,6 +8708,8 @@ START_TEST(domdoc)
test_get_dataType();
test_get_nodeTypeString();
test_get_attributes();
test_selection();
test_xsltemplate();
CoUninitialize();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment