Commit 201b1c2a authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

xmllite: Fix reported node type for attributes.

parent f6e6b835
......@@ -937,7 +937,11 @@ static HRESULT WINAPI xmlreader_GetNodeType(IXmlReader* iface, XmlNodeType *node
{
xmlreader *This = impl_from_IXmlReader(iface);
TRACE("(%p)->(%p)\n", This, node_type);
*node_type = This->nodetype;
/* When we're on attribute always return attribute type, container node type is kept.
Note that container is not necessarily an element, and attribute doesn't mean it's
an attribute in XML spec terms. */
*node_type = This->attr ? XmlNodeType_Attribute : This->nodetype;
return This->state == XmlReadState_Closed ? S_FALSE : S_OK;
}
......
......@@ -642,6 +642,12 @@ todo_wine
/* check attributes */
hr = IXmlReader_MoveToNextAttribute(reader);
ok(hr == S_OK, "got %08x\n", hr);
type = XmlNodeType_None;
hr = IXmlReader_GetNodeType(reader, &type);
ok(hr == S_OK, "got %08x\n", hr);
ok(type == XmlNodeType_Attribute, "got %d\n", type);
ok_pos(reader, 1, 7, -1, 55, TRUE);
/* try to move from last attribute */
......@@ -652,6 +658,11 @@ todo_wine
hr = IXmlReader_MoveToNextAttribute(reader);
ok(hr == S_FALSE, "got %08x\n", hr);
type = XmlNodeType_None;
hr = IXmlReader_GetNodeType(reader, &type);
ok(hr == S_OK, "got %08x\n", hr);
ok(type == XmlNodeType_Attribute, "got %d\n", type);
hr = IXmlReader_MoveToFirstAttribute(reader);
ok(hr == S_OK, "got %08x\n", hr);
ok_pos(reader, 1, 7, -1, 55, TRUE);
......@@ -672,6 +683,11 @@ todo_wine {
hr = IXmlReader_MoveToElement(reader);
ok(hr == S_OK, "got %08x\n", hr);
type = XmlNodeType_None;
hr = IXmlReader_GetNodeType(reader, &type);
ok(hr == S_OK, "got %08x\n", hr);
ok(type == XmlNodeType_XmlDeclaration, "got %d\n", type);
IStream_Release(stream);
IXmlReader_Release(reader);
}
......
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