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
d3319f60
Commit
d3319f60
authored
Mar 09, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmllite/reader: Return prefixes from namespace stack.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
348fcb18
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
4 deletions
+43
-4
reader.c
dlls/xmllite/reader.c
+42
-4
reader.c
dlls/xmllite/tests/reader.c
+1
-0
No files found.
dlls/xmllite/reader.c
View file @
d3319f60
...
...
@@ -3087,13 +3087,51 @@ static HRESULT WINAPI xmlreader_GetLocalName(IXmlReader* iface, LPCWSTR *name, U
return
S_OK
;
}
static
HRESULT
WINAPI
xmlreader_GetPrefix
(
IXmlReader
*
iface
,
LPCWSTR
*
prefix
,
UINT
*
len
)
static
HRESULT
WINAPI
xmlreader_GetPrefix
(
IXmlReader
*
iface
,
const
WCHAR
**
ret
,
UINT
*
len
)
{
xmlreader
*
This
=
impl_from_IXmlReader
(
iface
);
XmlNodeType
nodetype
;
UINT
length
;
TRACE
(
"(%p)->(%p %p)
\n
"
,
This
,
ret
,
len
);
if
(
!
len
)
len
=
&
length
;
*
ret
=
emptyW
;
*
len
=
0
;
switch
((
nodetype
=
reader_get_nodetype
(
This
)))
{
case
XmlNodeType_Element
:
case
XmlNodeType_EndElement
:
case
XmlNodeType_Attribute
:
{
const
strval
*
prefix
=
&
This
->
strvalues
[
StringValue_Prefix
];
struct
ns
*
ns
;
if
(
strval_eq
(
This
,
prefix
,
&
strval_xml
))
{
*
ret
=
xmlW
;
*
len
=
3
;
}
else
if
(
strval_eq
(
This
,
prefix
,
&
strval_xmlns
))
{
*
ret
=
xmlnsW
;
*
len
=
5
;
}
else
if
((
ns
=
reader_lookup_ns
(
This
,
prefix
)))
{
*
ret
=
ns
->
prefix
.
str
;
*
len
=
ns
->
prefix
.
len
;
}
break
;
}
default:
;
}
TRACE
(
"(%p)->(%p %p)
\n
"
,
This
,
prefix
,
len
);
*
prefix
=
This
->
strvalues
[
StringValue_Prefix
].
str
;
if
(
len
)
*
len
=
This
->
strvalues
[
StringValue_Prefix
].
len
;
return
S_OK
;
}
...
...
dlls/xmllite/tests/reader.c
View file @
d3319f60
...
...
@@ -2024,6 +2024,7 @@ static void test_prefix(void)
}
prefix_tests
[]
=
{
{
"<b xmlns=
\"
defns
\"
xml:a=
\"
a ns
\"
/>"
,
""
,
""
,
"xml"
},
{
"<c:b xmlns:c=
\"
c ns
\"
xml:a=
\"
a ns
\"
/>"
,
"c"
,
"xmlns"
,
"xml"
},
};
IXmlReader
*
reader
;
unsigned
int
i
;
...
...
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