Commit f0c08bd0 authored by Daniel Lehman's avatar Daniel Lehman Committed by Alexandre Julliard

msxml3: Handle default namespace in get_prefix.

parent 814807a1
......@@ -589,14 +589,11 @@ static HRESULT WINAPI domattr_get_prefix(
*prefix = NULL;
if (ns)
{
/* special case for default namespace definition */
if (xmlStrEqual(This->node.node->name, xmlns))
*prefix = bstr_from_xmlChar(xmlns);
else if (ns->prefix)
*prefix = bstr_from_xmlChar(ns->prefix);
}
if (xmldoc_version(This->node.node->doc) != MSXML6 &&
xmlStrEqual(This->node.node->name, xmlns))
*prefix = bstr_from_xmlChar(xmlns);
else if (ns && ns->prefix)
*prefix = bstr_from_xmlChar(ns->prefix);
TRACE("prefix: %s\n", debugstr_w(*prefix));
......
......@@ -13785,10 +13785,8 @@ static void test_namespaces_as_attributes(void)
hr = IXMLDOMNode_get_prefix(item, &str);
if (test->prefixes[i])
{
todo_wine_if(test->todo) {
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!lstrcmpW(str, _bstr_(test->prefixes[i])), "got %s\n", wine_dbgstr_w(str));
}
SysFreeString(str);
}
else
......
......@@ -269,11 +269,9 @@ static void test_namespaces_as_attributes(void)
if (test->prefixes[i])
{
/* MSXML4 can report different results with different service packs */
todo_wine_if(test->todo) {
ok(hr == S_OK || broken(hr == S_FALSE), "Unexpected hr %#lx.\n", hr);
ok(!lstrcmpW(str, test->prefixes[i]) || broken(!str),
"got %s\n", wine_dbgstr_w(str));
}
SysFreeString(str);
}
else
......
......@@ -105,10 +105,8 @@ static void test_create_attribute(void)
}
else
{
todo_wine_if(ptr->todo) {
ok(hr == S_FALSE, "%d: unexpected hr %#lx\n", i, hr);
ok(str == NULL, "%d: got prefix %s\n", i, 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