Commit 4e1a3cc8 authored by Daniel Lehman's avatar Daniel Lehman Committed by Alexandre Julliard

msxml3: Handle default namespace in get_nodeName.

parent b9e8a742
......@@ -186,6 +186,13 @@ HRESULT node_get_nodeName(xmlnode *This, BSTR *name)
hr = node_get_base_name(This, &base);
if (hr != S_OK) return hr;
if (!base[0] && xmldoc_version(This->node->doc) != MSXML6)
{
SysFreeString(base);
*name = SysAllocString(L"xmlns");
return S_OK;
}
hr = node_get_prefix(This, &prefix);
if (hr == S_OK)
{
......@@ -194,10 +201,17 @@ HRESULT node_get_nodeName(xmlnode *This, BSTR *name)
/* +1 for ':' */
ptr = *name = SysAllocStringLen(NULL, SysStringLen(base) + SysStringLen(prefix) + 1);
memcpy(ptr, prefix, SysStringByteLen(prefix));
ptr += SysStringLen(prefix);
memcpy(ptr++, &colW, sizeof(WCHAR));
memcpy(ptr, base, SysStringByteLen(base));
if (SysStringByteLen(prefix))
{
memcpy(ptr, prefix, SysStringByteLen(prefix));
ptr += SysStringLen(prefix);
}
if (SysStringByteLen(base))
{
if (SysStringByteLen(prefix))
memcpy(ptr++, &colW, sizeof(WCHAR));
memcpy(ptr, base, SysStringByteLen(base));
}
SysFreeString(base);
SysFreeString(prefix);
......
......@@ -13778,7 +13778,6 @@ static void test_namespaces_as_attributes(void)
str = NULL;
hr = IXMLDOMNode_get_nodeName(item, &str);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine_if(test->todo)
ok(!lstrcmpW(str, _bstr_(test->names[i])), "got %s\n", wine_dbgstr_w(str));
SysFreeString(str);
......
......@@ -261,7 +261,6 @@ static void test_namespaces_as_attributes(void)
str = NULL;
hr = IXMLDOMNode_get_nodeName(item, &str);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine_if(test->todo)
ok(!lstrcmpW(str, test->names[i]), "got %s\n", wine_dbgstr_w(str));
SysFreeString(str);
......
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