Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
57a391b8
Commit
57a391b8
authored
Nov 28, 2023
by
Daniel Lehman
Committed by
Alexandre Julliard
Dec 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Handle default namespace in get_namespaceURI.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53531
parent
c6f121df
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
32 deletions
+31
-32
attribute.c
dlls/msxml3/attribute.c
+29
-15
domdoc.c
dlls/msxml3/tests/domdoc.c
+0
-3
domdoc.c
dlls/msxml4/tests/domdoc.c
+0
-4
domdoc.c
dlls/msxml6/tests/domdoc.c
+2
-10
No files found.
dlls/msxml3/attribute.c
View file @
57a391b8
...
...
@@ -543,10 +543,11 @@ 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
;
BSTR
nodename
,
pfx
;
BOOL
is6
,
isdefault
;
HRESULT
hr
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
...
...
@@ -554,22 +555,35 @@ static HRESULT WINAPI domattr_get_namespaceURI(
return
E_INVALIDARG
;
*
p
=
NULL
;
nodename
=
NULL
;
hr
=
IXMLDOMAttribute_get_nodeName
(
iface
,
&
nodename
);
if
(
FAILED
(
hr
))
return
hr
;
pfx
=
NULL
;
hr
=
IXMLDOMAttribute_get_prefix
(
iface
,
&
pfx
);
if
(
FAILED
(
hr
))
{
SysFreeString
(
nodename
);
return
hr
;
}
if
(
ns
)
is6
=
xmldoc_version
(
This
->
node
.
node
->
doc
)
==
MSXML6
;
isdefault
=
!
wcscmp
(
nodename
,
L"xmlns"
);
if
(
isdefault
||
(
pfx
&&
!
wcscmp
(
L"xmlns"
,
pfx
)))
{
/* special case for default namespace definition */
if
(
xmlStrEqual
(
This
->
node
.
node
->
name
,
xmlns
))
*
p
=
bstr_from_xmlChar
(
xmlns
);
else
if
(
xmlStrEqual
(
ns
->
prefix
,
xmlns
))
{
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
);
if
(
is6
)
*
p
=
SysAllocString
(
L"http://www.w3.org/2000/xmlns/"
);
else
if
(
!
ns
||
!
isdefault
)
*
p
=
SysAllocStringLen
(
NULL
,
0
);
else
*
p
=
SysAllocString
(
L"xmlns"
);
}
else
if
(
ns
&&
ns
->
href
)
*
p
=
bstr_from_xmlChar
(
ns
->
href
);
SysFreeString
(
nodename
);
SysFreeString
(
pfx
);
TRACE
(
"uri: %s
\n
"
,
debugstr_w
(
*
p
));
...
...
dlls/msxml3/tests/domdoc.c
View file @
57a391b8
...
...
@@ -13677,7 +13677,6 @@ static void test_namespaces_as_attributes(void)
const
char
*
uris
[
3
];
const
char
*
texts
[
3
];
const
char
*
xmls
[
3
];
BOOL
todo
;
};
static
const
struct
test
tests
[]
=
{
{
...
...
@@ -13718,7 +13717,6 @@ static void test_namespaces_as_attributes(void)
{
""
},
/* namespaceURI */
{
"nshref"
},
/* text */
{
"xmlns=
\"
nshref
\"
"
},
/* xml */
TRUE
,
/* todo */
},
/* no properties or namespaces */
{
...
...
@@ -13802,7 +13800,6 @@ static void test_namespaces_as_attributes(void)
hr
=
IXMLDOMNode_get_namespaceURI
(
item
,
&
str
);
if
(
test
->
uris
[
i
])
{
todo_wine_if
(
test
->
todo
)
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
if
(
test
->
prefixes
[
i
]
&&
!
strcmp
(
test
->
prefixes
[
i
],
"xmlns"
))
ok
(
!
SysStringLen
(
str
),
"got %s
\n
"
,
wine_dbgstr_w
(
str
));
...
...
dlls/msxml4/tests/domdoc.c
View file @
57a391b8
...
...
@@ -166,7 +166,6 @@ static void test_namespaces_as_attributes(void)
const
WCHAR
*
uris
[
3
];
const
WCHAR
*
texts
[
3
];
const
WCHAR
*
xmls
[
3
];
BOOL
todo
;
};
static
const
struct
test
tests
[]
=
{
...
...
@@ -208,7 +207,6 @@ static void test_namespaces_as_attributes(void)
{
L""
},
/* namespaceURI */
{
L"nshref"
},
/* text */
{
L"xmlns=
\"
nshref
\"
"
},
/* xml */
TRUE
,
/* todo */
},
/* no properties or namespaces */
{
...
...
@@ -289,13 +287,11 @@ static void test_namespaces_as_attributes(void)
hr
=
IXMLDOMNode_get_namespaceURI
(
item
,
&
str
);
if
(
test
->
uris
[
i
])
{
todo_wine_if
(
test
->
todo
)
{
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
if
(
test
->
prefixes
[
i
]
&&
!
lstrcmpW
(
test
->
prefixes
[
i
],
L"xmlns"
))
ok
(
!
lstrcmpW
(
str
,
L""
),
"got %s
\n
"
,
wine_dbgstr_w
(
str
));
else
ok
(
!
lstrcmpW
(
str
,
test
->
uris
[
i
]),
"got %s
\n
"
,
wine_dbgstr_w
(
str
));
}
SysFreeString
(
str
);
}
else
...
...
dlls/msxml6/tests/domdoc.c
View file @
57a391b8
...
...
@@ -59,12 +59,11 @@ struct attrtest_t {
const
WCHAR
*
uri
;
const
WCHAR
*
prefix
;
const
WCHAR
*
href
;
BOOL
todo
;
};
static
struct
attrtest_t
attrtests
[]
=
{
{
L"xmlns"
,
L"http://www.w3.org/2000/xmlns/"
,
NULL
,
L"http://www.w3.org/2000/xmlns/"
,
TRUE
},
{
L"xmlns"
,
L"nondefaulturi"
,
NULL
,
L"http://www.w3.org/2000/xmlns/"
,
TRUE
},
{
L"xmlns"
,
L"http://www.w3.org/2000/xmlns/"
,
NULL
,
L"http://www.w3.org/2000/xmlns/"
},
{
L"xmlns"
,
L"nondefaulturi"
,
NULL
,
L"http://www.w3.org/2000/xmlns/"
},
{
L"c"
,
L"http://www.w3.org/2000/xmlns/"
,
NULL
,
L"http://www.w3.org/2000/xmlns/"
},
{
L"c"
,
L"nsref1"
,
NULL
,
L"nsref1"
},
{
L"ns:c"
,
L"nsref1"
,
L"ns"
,
L"nsref1"
},
...
...
@@ -113,7 +112,6 @@ static void test_create_attribute(void)
str
=
NULL
;
hr
=
IXMLDOMNode_get_namespaceURI
(
node
,
&
str
);
ok
(
hr
==
S_OK
,
"%d: unexpected hr %#lx
\n
"
,
i
,
hr
);
todo_wine_if
(
ptr
->
todo
)
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
ptr
->
href
))
||
broken
(
!
ptr
->
prefix
&&
!
lstrcmpW
(
str
,
L"xmlns"
)),
/* win7 msxml6 */
"%d: got uri %s, expected %s
\n
"
,
i
,
wine_dbgstr_w
(
str
),
wine_dbgstr_w
(
ptr
->
href
));
...
...
@@ -171,7 +169,6 @@ static void test_namespaces_as_attributes(void)
const
WCHAR
*
uris
[
3
];
const
WCHAR
*
texts
[
3
];
const
WCHAR
*
xmls
[
3
];
BOOL
todo
;
};
static
const
struct
test
tests
[]
=
{
...
...
@@ -213,7 +210,6 @@ static void test_namespaces_as_attributes(void)
{
L"http://www.w3.org/2000/xmlns/"
},
/* namespaceURI */
{
L"nshref"
},
/* text */
{
L"xmlns=
\"
nshref
\"
"
},
/* xml */
TRUE
,
/* todo */
},
/* no properties or namespaces */
{
...
...
@@ -273,10 +269,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
,
test
->
prefixes
[
i
]),
"got %s
\n
"
,
wine_dbgstr_w
(
str
));
}
SysFreeString
(
str
);
}
else
...
...
@@ -292,14 +286,12 @@ static void test_namespaces_as_attributes(void)
hr
=
IXMLDOMNode_get_namespaceURI
(
item
,
&
str
);
if
(
test
->
uris
[
i
])
{
todo_wine_if
(
test
->
todo
)
{
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
if
(
test
->
prefixes
[
i
]
&&
!
lstrcmpW
(
test
->
prefixes
[
i
],
L"xmlns"
))
ok
(
!
lstrcmpW
(
str
,
L"http://www.w3.org/2000/xmlns/"
),
"got %s
\n
"
,
wine_dbgstr_w
(
str
));
else
ok
(
!
lstrcmpW
(
str
,
test
->
uris
[
i
]),
"got %s
\n
"
,
wine_dbgstr_w
(
str
));
}
SysFreeString
(
str
);
}
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment