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
d9215263
Commit
d9215263
authored
Jul 08, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Jul 08, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Inherit the prefix only if parent and child namespaces match.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
df4046a3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
7 deletions
+29
-7
writer.c
dlls/webservices/tests/writer.c
+24
-5
writer.c
dlls/webservices/writer.c
+5
-2
No files found.
dlls/webservices/tests/writer.c
View file @
d9215263
...
...
@@ -364,7 +364,7 @@ static void test_WsWriteStartElement(void)
{
HRESULT
hr
;
WS_XML_WRITER
*
writer
;
WS_XML_STRING
prefix
=
{
1
,
(
BYTE
*
)
"p"
},
ns
=
{
2
,
(
BYTE
*
)
"ns"
};
WS_XML_STRING
prefix
=
{
1
,
(
BYTE
*
)
"p"
},
ns
=
{
2
,
(
BYTE
*
)
"ns"
}
,
ns2
=
{
3
,
(
BYTE
*
)
"ns2"
}
;
WS_XML_STRING
localname
=
{
1
,
(
BYTE
*
)
"a"
},
localname2
=
{
1
,
(
BYTE
*
)
"b"
};
hr
=
WsCreateWriter
(
NULL
,
0
,
&
writer
,
NULL
)
;
...
...
@@ -404,21 +404,40 @@ static void test_WsWriteStartElement(void)
hr
=
set_output
(
writer
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsWriteStartElement
(
writer
,
NULL
,
&
localname
,
&
ns
,
NULL
);
hr
=
WsWriteStartElement
(
writer
,
&
prefix
,
&
localname
,
&
ns
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
check_output
(
writer
,
""
,
__LINE__
);
hr
=
WsWriteStartElement
(
writer
,
NULL
,
&
localname2
,
&
ns
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
check_output
(
writer
,
"<a xmlns=
\"
ns
\"
>"
,
__LINE__
);
check_output
(
writer
,
"<p:a xmlns:p=
\"
ns
\"
>"
,
__LINE__
);
hr
=
WsWriteEndElement
(
writer
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
check_output
(
writer
,
"<p:a xmlns:p=
\"
ns
\"
><p:b/>"
,
__LINE__
);
hr
=
WsWriteEndElement
(
writer
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
check_output
(
writer
,
"<p:a xmlns:p=
\"
ns
\"
><p:b/></p:a>"
,
__LINE__
);
hr
=
set_output
(
writer
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsWriteStartElement
(
writer
,
&
prefix
,
&
localname
,
&
ns
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
check_output
(
writer
,
""
,
__LINE__
);
hr
=
WsWriteStartElement
(
writer
,
NULL
,
&
localname2
,
&
ns2
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
check_output
(
writer
,
"<p:a xmlns:p=
\"
ns
\"
>"
,
__LINE__
);
hr
=
WsWriteEndElement
(
writer
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
check_output
(
writer
,
"<
a xmlns=
\"
ns
\"
><b
/>"
,
__LINE__
);
check_output
(
writer
,
"<
p:a xmlns:p=
\"
ns
\"
><b xmlns=
\"
ns2
\"
/>"
,
__LINE__
);
hr
=
WsWriteEndElement
(
writer
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
check_output
(
writer
,
"<
a xmlns=
\"
ns
\"
><b/></
a>"
,
__LINE__
);
check_output
(
writer
,
"<
p:a xmlns:p=
\"
ns
\"
><b xmlns=
\"
ns2
\"
/></p:
a>"
,
__LINE__
);
WsFreeWriter
(
writer
);
}
...
...
dlls/webservices/writer.c
View file @
d9215263
...
...
@@ -929,8 +929,11 @@ static HRESULT write_add_element_node( struct writer *writer, const WS_XML_STRIN
if
(
!
(
parent
=
find_parent
(
writer
->
current
)))
return
WS_E_INVALID_FORMAT
;
if
(
!
prefix
&&
node_type
(
writer
->
current
)
==
WS_XML_NODE_TYPE_ELEMENT
)
prefix
=
writer
->
current
->
hdr
.
prefix
;
if
(
!
prefix
&&
node_type
(
parent
)
==
WS_XML_NODE_TYPE_ELEMENT
)
{
elem
=
&
parent
->
hdr
;
if
(
WsXmlStringEquals
(
ns
,
elem
->
ns
,
NULL
)
==
S_OK
)
prefix
=
elem
->
prefix
;
}
if
(
!
(
node
=
alloc_node
(
WS_XML_NODE_TYPE_ELEMENT
)))
return
E_OUTOFMEMORY
;
elem
=
&
node
->
hdr
;
...
...
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