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
79b27421
Commit
79b27421
authored
Jun 12, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Jun 12, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Fix domelem_get_tagName to return a string with the namespace prefixed, if it is present.
parent
6dd935bc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
1 deletion
+64
-1
element.c
dlls/msxml3/element.c
+18
-1
domdoc.c
dlls/msxml3/tests/domdoc.c
+46
-0
No files found.
dlls/msxml3/element.c
View file @
79b27421
...
...
@@ -26,6 +26,7 @@
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winnls.h"
#include "ole2.h"
#include "msxml2.h"
...
...
@@ -440,6 +441,9 @@ static HRESULT WINAPI domelem_get_tagName(
{
domelem
*
This
=
impl_from_IXMLDOMElement
(
iface
);
xmlNodePtr
element
;
DWORD
len
;
DWORD
offset
=
0
;
LPWSTR
str
;
TRACE
(
"%p
\n
"
,
This
);
...
...
@@ -450,7 +454,20 @@ static HRESULT WINAPI domelem_get_tagName(
if
(
!
element
)
return
E_FAIL
;
*
p
=
bstr_from_xmlChar
(
element
->
name
);
len
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
(
LPCSTR
)
element
->
name
,
-
1
,
NULL
,
0
);
if
(
element
->
ns
)
len
+=
MultiByteToWideChar
(
CP_UTF8
,
0
,
(
LPCSTR
)
element
->
ns
->
prefix
,
-
1
,
NULL
,
0
);
str
=
(
LPWSTR
)
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
if
(
!
str
)
return
E_OUTOFMEMORY
;
if
(
element
->
ns
)
{
offset
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
(
LPCSTR
)
element
->
ns
->
prefix
,
-
1
,
str
,
len
);
str
[
offset
-
1
]
=
':'
;
}
MultiByteToWideChar
(
CP_UTF8
,
0
,
(
LPCSTR
)
element
->
name
,
-
1
,
str
+
offset
,
len
-
offset
);
*
p
=
SysAllocString
(
str
);
HeapFree
(
GetProcessHeap
(),
0
,
str
);
return
S_OK
;
}
...
...
dlls/msxml3/tests/domdoc.c
View file @
79b27421
...
...
@@ -61,6 +61,20 @@ static const WCHAR szComplete4[] = {
'<'
,
'e'
,
'm'
,
'p'
,
't'
,
'y'
,
'>'
,
'<'
,
'/'
,
'e'
,
'm'
,
'p'
,
't'
,
'y'
,
'>'
,
'\n'
,
'<'
,
'/'
,
'l'
,
'c'
,
'>'
,
'\n'
,
0
};
static
const
WCHAR
szComplete5
[]
=
{
'<'
,
'S'
,
':'
,
's'
,
'e'
,
'a'
,
'r'
,
'c'
,
'h'
,
' '
,
'x'
,
'm'
,
'l'
,
'n'
,
's'
,
':'
,
'D'
,
'='
,
'"'
,
'D'
,
'A'
,
'V'
,
':'
,
'"'
,
' '
,
'x'
,
'm'
,
'l'
,
'n'
,
's'
,
':'
,
'C'
,
'='
,
'"'
,
'u'
,
'r'
,
'n'
,
':'
,
's'
,
'c'
,
'h'
,
'e'
,
'm'
,
'a'
,
's'
,
'-'
,
'm'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'-'
,
'c'
,
'o'
,
'm'
,
':'
,
'o'
,
'f'
,
'f'
,
'i'
,
'c'
,
'e'
,
':'
,
'c'
,
'l'
,
'i'
,
'p'
,
'g'
,
'a'
,
'l'
,
'l'
,
'e'
,
'r'
,
'y'
,
'"'
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'
,
0
};
static
const
WCHAR
szNonExistentFile
[]
=
{
'c'
,
':'
,
'\\'
,
'N'
,
'o'
,
'n'
,
'e'
,
'x'
,
'i'
,
's'
,
't'
,
'e'
,
'n'
,
't'
,
'.'
,
'x'
,
'm'
,
'l'
,
0
};
...
...
@@ -539,6 +553,38 @@ todo_wine
IXMLDOMNodeList_Release
(
list
);
if
(
element
)
IXMLDOMElement_Release
(
element
);
b
=
FALSE
;
str
=
SysAllocString
(
szComplete5
);
r
=
IXMLDOMDocument_loadXML
(
doc
,
str
,
&
b
);
ok
(
r
==
S_OK
,
"loadXML failed
\n
"
);
ok
(
b
==
VARIANT_TRUE
,
"failed to load XML string
\n
"
);
SysFreeString
(
str
);
b
=
1
;
r
=
IXMLDOMNode_hasChildNodes
(
doc
,
&
b
);
ok
(
r
==
S_OK
,
"hasChildNoes bad return
\n
"
);
ok
(
b
==
VARIANT_TRUE
,
"hasChildNoes wrong result
\n
"
);
r
=
IXMLDOMDocument_get_documentElement
(
doc
,
&
element
);
ok
(
r
==
S_OK
,
"should be a document element
\n
"
);
ok
(
element
!=
NULL
,
"should be an element
\n
"
);
if
(
element
)
{
static
const
WCHAR
szSSearch
[]
=
{
'S'
,
':'
,
's'
,
'e'
,
'a'
,
'r'
,
'c'
,
'h'
,
0
};
BSTR
tag
=
NULL
;
/* check if the tag is correct */
r
=
IXMLDOMElement_get_tagName
(
element
,
&
tag
);
ok
(
r
==
S_OK
,
"couldn't get tag name
\n
"
);
ok
(
tag
!=
NULL
,
"tag was null
\n
"
);
ok
(
!
lstrcmpW
(
tag
,
szSSearch
),
"incorrect tag name
\n
"
);
SysFreeString
(
tag
);
}
if
(
element
)
IXMLDOMElement_Release
(
element
);
if
(
doc
)
IXMLDOMDocument_Release
(
doc
);
}
...
...
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