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

msxml3: Implement IXMLDocument::get_doctype().

parent 04288208
......@@ -39,6 +39,7 @@ static void create_xml_file(LPCSTR filename)
static const char data[] =
"<?xml version=\"1.0\" ?>\n"
"<!DOCTYPE BankAccount>\n"
"<BankAccount>\n"
" <Number>1234</Number>\n"
" <Name>Captain Ahab</Name>\n"
......@@ -125,6 +126,15 @@ static void test_xmldoc(void)
ok(!lstrcmpW(name, szVersion), "Expected 1.0, got %s\n", wine_dbgstr_w(name));
SysFreeString(name);
/* doctype */
hr = IXMLDocument_get_doctype(doc, NULL);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
hr = IXMLDocument_get_doctype(doc, &name);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
ok(!lstrcmpW(name, szBankAccount), "Expected BANKACCOUNT, got %s\n", wine_dbgstr_w(name));
SysFreeString(name);
hr = IXMLDocument_get_root(doc, &element);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
ok(element != NULL, "Expected non-NULL element\n");
......
......@@ -451,8 +451,20 @@ static HRESULT WINAPI xmldoc_get_version(IXMLDocument *iface, BSTR *p)
static HRESULT WINAPI xmldoc_get_doctype(IXMLDocument *iface, BSTR *p)
{
FIXME("(%p, %p): stub\n", iface, p);
return E_NOTIMPL;
xmldoc *This = impl_from_IXMLDocument(iface);
xmlDtd *dtd;
TRACE("(%p, %p)\n", This, p);
if (!p) return E_INVALIDARG;
dtd = xmlGetIntSubset(This->xmldoc);
if (!dtd) return S_FALSE;
*p = bstr_from_xmlChar(dtd->name);
CharUpperBuffW(*p, SysStringLen(*p));
return S_OK;
}
static HRESULT WINAPI xmldoc_get_dtdURl(IXMLDocument *iface, BSTR *p)
......
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