Signed-off-by: Daniel Lehman dlehman25@gmail.com --- dlls/msxml3/attribute.c | 8 +++++++- dlls/msxml3/domdoc.c | 5 +++++ dlls/msxml3/msxml_private.h | 1 + dlls/msxml3/tests/domdoc.c | 14 ++++++-------- 4 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/dlls/msxml3/attribute.c b/dlls/msxml3/attribute.c index 637615b341..146d846597 100644 --- a/dlls/msxml3/attribute.c +++ b/dlls/msxml3/attribute.c @@ -44,6 +44,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msxml);
static const xmlChar xmlns[] = "xmlns"; +static const xmlChar xmlnsURI[] = "http://www.w3.org/2000/xmlns/";
typedef struct _domattr { @@ -559,7 +560,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 = bstr_from_xmlChar(xmlnsURI); + 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 94ef66b23d..aa9706defb 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 667feaa244..527a62b687 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 } };
@@ -12931,7 +12930,6 @@ void test_namespaces_as_attributes(void) { EXPECT_HR(hr, S_OK); if (prefixes[i] && !strcmp(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_(uris[i])), "got %s\n", wine_dbgstr_w(str));