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

msxml3: Return qualified name from get_nodeName().

parent 12bb4a47
......@@ -128,12 +128,33 @@ xmlnode *get_node_obj(IXMLDOMNode *node)
HRESULT node_get_nodeName(xmlnode *This, BSTR *name)
{
BSTR prefix, base;
HRESULT hr;
if (!name)
return E_INVALIDARG;
*name = bstr_from_xmlChar(This->node->name);
if (!*name)
return S_FALSE;
hr = node_get_base_name(This, &base);
if (hr != S_OK) return hr;
hr = node_get_prefix(This, &prefix);
if (hr == S_OK)
{
static const WCHAR colW = ':';
WCHAR *ptr;
/* +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));
SysFreeString(base);
SysFreeString(prefix);
}
else
*name = base;
return S_OK;
}
......
......@@ -7009,7 +7009,7 @@ static void test_namespaces(void)
hr = IXMLDOMNode_get_nodeName(node2, &str);
EXPECT_HR(hr, S_OK);
todo_wine ok(!lstrcmpW( str, _bstr_("Model:Package")), "got %s\n", wine_dbgstr_w(str));
ok(!lstrcmpW( str, _bstr_("Model:Package")), "got %s\n", wine_dbgstr_w(str));
SysFreeString(str);
/* Test get_namespaceURI */
......@@ -7030,7 +7030,7 @@ static void test_namespaces(void)
hr = IXMLDOMAttribute_get_nodeName(attr, &str);
EXPECT_HR(hr, S_OK);
todo_wine ok(!lstrcmpW( str, _bstr_("Model:name2")), "got %s\n", wine_dbgstr_w(str));
ok(!lstrcmpW( str, _bstr_("Model:name2")), "got %s\n", wine_dbgstr_w(str));
SysFreeString(str);
hr = IXMLDOMAttribute_get_prefix(attr, &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