--- dlls/xmllite/reader.c | 3 +-- dlls/xmllite/tests/reader.c | 35 ++++++++++------------------------- 2 files changed, 11 insertions(+), 27 deletions(-)
diff --git a/dlls/xmllite/reader.c b/dlls/xmllite/reader.c index 02097d0789..66870d63ec 100644 --- a/dlls/xmllite/reader.c +++ b/dlls/xmllite/reader.c @@ -1919,7 +1919,6 @@ static HRESULT reader_parse_dtd(xmlreader *reader)
reader->nodetype = XmlNodeType_DocumentType; reader_set_strvalue(reader, StringValue_LocalName, &name); - reader_set_strvalue(reader, StringValue_QualifiedName, &name);
return S_OK; } @@ -3114,7 +3113,6 @@ static HRESULT WINAPI xmlreader_MoveToElement(IXmlReader* iface)
This->attr = NULL;
- /* 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_QualifiedName, &This->empty_element.qname); @@ -3184,6 +3182,7 @@ static HRESULT WINAPI xmlreader_GetQualifiedName(IXmlReader* iface, LPCWSTR *nam } break; case XmlNodeType_XmlDeclaration: + case XmlNodeType_DocumentType: *name = This->strvalues[StringValue_LocalName].str; *len = This->strvalues[StringValue_LocalName].len; break; diff --git a/dlls/xmllite/tests/reader.c b/dlls/xmllite/tests/reader.c index 64ae6191a6..e38f1e5f37 100644 --- a/dlls/xmllite/tests/reader.c +++ b/dlls/xmllite/tests/reader.c @@ -1270,11 +1270,10 @@ static const char test_public_dtd[] =
static void test_read_public_dtd(void) { - static const WCHAR dtdnameW[] = {'t','e','s','t','d','t','d',0}; IXmlReader *reader; - const WCHAR *str; + const WCHAR *name, *qname; XmlNodeType type; - UINT len, count; + UINT count; HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); @@ -1314,16 +1313,10 @@ static void test_read_public_dtd(void) reader_value(reader, "externalid uri");
move_to_element(reader); - reader_name(reader, "testdtd"); + name = reader_name(reader, "testdtd"); + qname = reader_qname(reader, "testdtd"); + ok(name == qname, "name != qname\n");
- len = 0; - str = NULL; - hr = IXmlReader_GetQualifiedName(reader, &str, &len); - ok(hr == S_OK, "got 0x%08x\n", hr); -todo_wine { - ok(len == lstrlenW(dtdnameW), "got %u\n", len); - ok(!lstrcmpW(str, dtdnameW), "got %s\n", wine_dbgstr_w(str)); -} IXmlReader_Release(reader); }
@@ -1333,11 +1326,10 @@ static const char test_system_dtd[] =
static void test_read_system_dtd(void) { - static const WCHAR dtdnameW[] = {'t','e','s','t','d','t','d',0}; IXmlReader *reader; - const WCHAR *str; + const WCHAR *name, *qname; XmlNodeType type; - UINT len, count; + UINT count; HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); @@ -1367,16 +1359,9 @@ static void test_read_system_dtd(void) reader_value(reader, "externalid uri");
move_to_element(reader); - reader_name(reader, "testdtd"); - - len = 0; - str = NULL; - hr = IXmlReader_GetQualifiedName(reader, &str, &len); - ok(hr == S_OK, "got 0x%08x\n", hr); -todo_wine { - ok(len == lstrlenW(dtdnameW), "got %u\n", len); - ok(!lstrcmpW(str, dtdnameW), "got %s\n", wine_dbgstr_w(str)); -} + name = reader_name(reader, "testdtd"); + qname = reader_qname(reader, "testdtd"); + ok(name == qname, "name != qname\n");
read_node(reader, XmlNodeType_Comment);