Commit 3fe5f25b authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

xmllite/reader: Fix prefix returned after moving back to element.

parent 70028b7d
......@@ -2890,12 +2890,14 @@ static HRESULT WINAPI xmlreader_MoveToElement(IXmlReader* iface)
/* FIXME: support other node types with 'attributes' like DTD */
if (This->is_empty_element) {
reader_set_strvalue(This, StringValue_Prefix, &This->empty_element.prefix);
reader_set_strvalue(This, StringValue_LocalName, &This->empty_element.localname);
reader_set_strvalue(This, StringValue_QualifiedName, &This->empty_element.qname);
}
else {
struct element *element = LIST_ENTRY(list_head(&This->elements), struct element, entry);
if (element) {
reader_set_strvalue(This, StringValue_Prefix, &element->prefix);
reader_set_strvalue(This, StringValue_LocalName, &element->localname);
reader_set_strvalue(This, StringValue_QualifiedName, &element->qname);
}
......
......@@ -2034,6 +2034,17 @@ static void test_prefix(void)
wine_dbgstr_w(expected));
free_str(expected);
/* back to the element, check prefix */
hr = IXmlReader_MoveToElement(reader);
ok(hr == S_OK, "MoveToElement() failed, %#x.\n", hr);
expected = a2w(prefix_tests[i].prefix1);
hr = IXmlReader_GetPrefix(reader, &prefix, NULL);
ok(hr == S_OK, "GetPrefix() failed, %#x.\n", hr);
ok(!lstrcmpW(prefix, expected), "Unexpected prefix %s, expected %s.\n", wine_dbgstr_w(prefix),
wine_dbgstr_w(expected));
free_str(expected);
IStream_Release(stream);
}
......
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