[PATCH v3 4/4] msxml3: Return URL from get_namespaceURI from attributes for MSXML6.
Daniel Lehman
dlehman25 at gmail.com
Mon Oct 15 23:14:36 CDT 2018
Signed-off-by: Daniel Lehman <dlehman25 at gmail.com>
---
dlls/msxml3/attribute.c | 9 ++++++++-
dlls/msxml3/domdoc.c | 5 +++++
dlls/msxml3/msxml_private.h | 1 +
dlls/msxml3/tests/domdoc.c | 14 ++++++--------
4 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/dlls/msxml3/attribute.c b/dlls/msxml3/attribute.c
index 8eb2695128..c303969bc3 100644
--- a/dlls/msxml3/attribute.c
+++ b/dlls/msxml3/attribute.c
@@ -549,6 +549,8 @@ static HRESULT WINAPI domattr_get_namespaceURI(
IXMLDOMAttribute *iface,
BSTR* p)
{
+ static const WCHAR w3xmlns[] = { 'h','t','t','p',':','/','/', 'w','w','w','.','w','3','.',
+ 'o','r','g','/','2','0','0','0','/','x','m','l','n','s','/',0 };
domattr *This = impl_from_IXMLDOMAttribute( iface );
xmlNsPtr ns = This->node.node->ns;
@@ -565,7 +567,12 @@ static HRESULT WINAPI domattr_get_namespaceURI(
if (xmlStrEqual(This->node.node->name, xmlns))
*p = bstr_from_xmlChar(xmlns);
else if (xmlStrEqual(ns->prefix, xmlns))
- *p = SysAllocStringLen(NULL, 0);
+ {
+ if (xmldoc_version(This->node.node->doc) == MSXML6)
+ *p = SysAllocString(w3xmlns);
+ else
+ *p = SysAllocStringLen(NULL, 0);
+ }
else if (ns->href)
*p = bstr_from_xmlChar(ns->href);
}
diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c
index 0b917c1302..445caaee69 100644
--- a/dlls/msxml3/domdoc.c
+++ b/dlls/msxml3/domdoc.c
@@ -396,6 +396,11 @@ xmlNodePtr xmldoc_unlink_xmldecl(xmlDocPtr doc)
return node;
}
+MSXML_VERSION xmldoc_version(xmlDocPtr doc)
+{
+ return properties_from_xmlDocPtr(doc)->version;
+}
+
BOOL is_preserving_whitespace(xmlNodePtr node)
{
domdoc_properties* properties = NULL;
diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h
index abc6ab3465..08f944ab1b 100644
--- a/dlls/msxml3/msxml_private.h
+++ b/dlls/msxml3/msxml_private.h
@@ -284,6 +284,7 @@ extern HRESULT xmldoc_add_orphan( xmlDocPtr doc, xmlNodePtr node ) DECLSPEC_HIDD
extern HRESULT xmldoc_remove_orphan( xmlDocPtr doc, xmlNodePtr node ) DECLSPEC_HIDDEN;
extern void xmldoc_link_xmldecl(xmlDocPtr doc, xmlNodePtr node) DECLSPEC_HIDDEN;
extern xmlNodePtr xmldoc_unlink_xmldecl(xmlDocPtr doc) DECLSPEC_HIDDEN;
+extern MSXML_VERSION xmldoc_version( xmlDocPtr doc ) DECLSPEC_HIDDEN;
extern HRESULT XMLElement_create( xmlNodePtr node, LPVOID *ppObj, BOOL own ) DECLSPEC_HIDDEN;
diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c
index 62f2e8ce45..22d9c46871 100644
--- a/dlls/msxml3/tests/domdoc.c
+++ b/dlls/msxml3/tests/domdoc.c
@@ -12834,16 +12834,15 @@ typedef struct _namespace_as_attribute_t {
const GUID *guid;
const char *clsid;
const char *xmlns_uri;
- BOOL todo;
} namespace_as_attribute_t;
static const namespace_as_attribute_t namespace_as_attribute_test_data[] = {
- { &CLSID_DOMDocument, "CLSID_DOMDocument", "", FALSE },
- { &CLSID_DOMDocument2, "CLSID_DOMDocument2", "", FALSE },
- { &CLSID_DOMDocument26, "CLSID_DOMDocument26", "", FALSE },
- { &CLSID_DOMDocument30, "CLSID_DOMDocument30", "", FALSE },
- { &CLSID_DOMDocument40, "CLSID_DOMDocument40", "", FALSE },
- { &CLSID_DOMDocument60, "CLSID_DOMDocument60", "http://www.w3.org/2000/xmlns/", TRUE },
+ { &CLSID_DOMDocument, "CLSID_DOMDocument", "" },
+ { &CLSID_DOMDocument2, "CLSID_DOMDocument2", "" },
+ { &CLSID_DOMDocument26, "CLSID_DOMDocument26", "" },
+ { &CLSID_DOMDocument30, "CLSID_DOMDocument30", "" },
+ { &CLSID_DOMDocument40, "CLSID_DOMDocument40", "" },
+ { &CLSID_DOMDocument60, "CLSID_DOMDocument60", "http://www.w3.org/2000/xmlns/" },
{ 0 }
};
@@ -12970,7 +12969,6 @@ static void test_namespaces_as_attributes(void)
{
ok(hr == S_OK, "Failed to get node name, hr %#x.\n", hr);
if (test->prefixes[i] && !strcmp(test->prefixes[i], "xmlns"))
- todo_wine_if(entry->todo)
ok(!lstrcmpW(str, _bstr_(entry->xmlns_uri)), "got %s\n", wine_dbgstr_w(str));
else
ok(!lstrcmpW(str, _bstr_(test->uris[i])), "got %s\n", wine_dbgstr_w(str));
--
2.17.1
More information about the wine-devel
mailing list