Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
3bc1bdae
Commit
3bc1bdae
authored
Apr 26, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 26, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Support disabled escaping mode when writing attribute values.
parent
622c94ac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
21 deletions
+34
-21
mxwriter.c
dlls/msxml3/mxwriter.c
+13
-7
saxreader.c
dlls/msxml3/tests/saxreader.c
+21
-14
No files found.
dlls/msxml3/mxwriter.c
View file @
3bc1bdae
...
...
@@ -1019,19 +1019,20 @@ static HRESULT WINAPI SAXContentHandler_startElement(
if
(
attr
)
{
int
length
,
i
,
escape
;
HRESULT
hr
;
INT
length
;
INT
i
;
hr
=
ISAXAttributes_getLength
(
attr
,
&
length
);
if
(
FAILED
(
hr
))
return
hr
;
escape
=
This
->
props
[
MXWriter_DisableEscaping
]
==
VARIANT_FALSE
||
(
This
->
class_version
==
MSXML4
||
This
->
class_version
==
MSXML6
);
for
(
i
=
0
;
i
<
length
;
i
++
)
{
static
const
WCHAR
eqW
[]
=
{
'='
};
const
WCHAR
*
str
;
WCHAR
*
escaped
;
INT
len
=
0
;
int
len
=
0
;
hr
=
ISAXAttributes_getQName
(
attr
,
i
,
&
str
,
&
len
);
if
(
FAILED
(
hr
))
return
hr
;
...
...
@@ -1046,9 +1047,14 @@ static HRESULT WINAPI SAXContentHandler_startElement(
hr
=
ISAXAttributes_getValue
(
attr
,
i
,
&
str
,
&
len
);
if
(
FAILED
(
hr
))
return
hr
;
escaped
=
get_escaped_string
(
str
,
EscapeValue
,
&
len
);
write_output_buffer_quoted
(
This
->
buffer
,
escaped
,
len
);
heap_free
(
escaped
);
if
(
escape
)
{
WCHAR
*
escaped
=
get_escaped_string
(
str
,
EscapeValue
,
&
len
);
write_output_buffer_quoted
(
This
->
buffer
,
escaped
,
len
);
heap_free
(
escaped
);
}
else
write_output_buffer_quoted
(
This
->
buffer
,
str
,
len
);
}
}
...
...
dlls/msxml3/tests/saxreader.c
View file @
3bc1bdae
...
...
@@ -2832,9 +2832,10 @@ static void test_mxwriter_startenddocument(void)
enum
startendtype
{
StartElement
,
EndElement
,
StartEndElement
StartElement
=
0x001
,
EndElement
=
0x010
,
StartEndElement
=
0x011
,
DisableEscaping
=
0x100
};
struct
writer_startendelement_t
{
...
...
@@ -2850,6 +2851,7 @@ struct writer_startendelement_t {
static
const
char
startelement_xml
[]
=
"<uri:local a:attr1=
\"
a1
\"
attr2=
\"
a2
\"
attr3=
\"
<&">
\"
>"
;
static
const
char
startendelement_xml
[]
=
"<uri:local a:attr1=
\"
a1
\"
attr2=
\"
a2
\"
attr3=
\"
<&">
\"
/>"
;
static
const
char
startendelement_noescape_xml
[]
=
"<uri:local a:attr1=
\"
a1
\"
attr2=
\"
a2
\"
attr3=
\"
<&
\"
>
\"
/>"
;
static
const
struct
writer_startendelement_t
writer_startendelement
[]
=
{
/* 0 */
...
...
@@ -2948,6 +2950,13 @@ static const struct writer_startendelement_t writer_startendelement[] = {
{
&
CLSID_MXXMLWriter40
,
StartEndElement
,
""
,
""
,
""
,
"</>"
,
S_OK
},
/* 75 */
{
&
CLSID_MXXMLWriter60
,
StartEndElement
,
""
,
""
,
""
,
"</>"
,
S_OK
},
/* with disabled output escaping */
{
&
CLSID_MXXMLWriter
,
StartEndElement
|
DisableEscaping
,
"uri"
,
"local"
,
"uri:local"
,
startendelement_noescape_xml
,
S_OK
,
&
saxattributes
},
{
&
CLSID_MXXMLWriter30
,
StartEndElement
|
DisableEscaping
,
"uri"
,
"local"
,
"uri:local"
,
startendelement_noescape_xml
,
S_OK
,
&
saxattributes
},
{
&
CLSID_MXXMLWriter40
,
StartEndElement
|
DisableEscaping
,
"uri"
,
"local"
,
"uri:local"
,
startendelement_xml
,
S_OK
,
&
saxattributes
},
{
&
CLSID_MXXMLWriter60
,
StartEndElement
|
DisableEscaping
,
"uri"
,
"local"
,
"uri:local"
,
startendelement_xml
,
S_OK
,
&
saxattributes
},
{
NULL
}
};
...
...
@@ -2998,23 +3007,21 @@ static void test_mxwriter_startendelement_batch(const struct writer_startendelem
hr
=
ISAXContentHandler_startDocument
(
content
);
EXPECT_HR
(
hr
,
S_OK
);
if
(
table
->
type
==
StartElement
)
{
hr
=
ISAXContentHandler_startElement
(
content
,
_bstr_
(
table
->
uri
),
lstrlen
(
table
->
uri
),
_bstr_
(
table
->
local_name
),
lstrlen
(
table
->
local_name
),
_bstr_
(
table
->
qname
),
lstrlen
(
table
->
qname
),
table
->
attr
);
ok
(
hr
==
table
->
hr
,
"test %d: got 0x%08x, expected 0x%08x
\n
"
,
i
,
hr
,
table
->
hr
);
}
else
if
(
table
->
type
==
EndElement
)
if
(
table
->
type
&
DisableEscaping
)
{
hr
=
ISAXContentHandler_endElement
(
content
,
_bstr_
(
table
->
uri
),
lstrlen
(
table
->
uri
),
_bstr_
(
table
->
local_name
),
lstrlen
(
table
->
local_name
),
_bstr_
(
table
->
qname
),
lstrlen
(
table
->
qname
));
ok
(
hr
==
table
->
hr
,
"test %d: got 0x%08x, expected 0x%08x
\n
"
,
i
,
hr
,
table
->
hr
);
hr
=
IMXWriter_put_disableOutputEscaping
(
writer
,
VARIANT_TRUE
);
EXPECT_HR
(
hr
,
S_OK
);
}
else
if
(
table
->
type
&
StartElement
)
{
hr
=
ISAXContentHandler_startElement
(
content
,
_bstr_
(
table
->
uri
),
lstrlen
(
table
->
uri
),
_bstr_
(
table
->
local_name
),
lstrlen
(
table
->
local_name
),
_bstr_
(
table
->
qname
),
lstrlen
(
table
->
qname
),
table
->
attr
);
ok
(
hr
==
table
->
hr
,
"test %d: got 0x%08x, expected 0x%08x
\n
"
,
i
,
hr
,
table
->
hr
);
}
if
(
table
->
type
&
EndElement
)
{
hr
=
ISAXContentHandler_endElement
(
content
,
_bstr_
(
table
->
uri
),
lstrlen
(
table
->
uri
),
_bstr_
(
table
->
local_name
),
lstrlen
(
table
->
local_name
),
_bstr_
(
table
->
qname
),
lstrlen
(
table
->
qname
));
ok
(
hr
==
table
->
hr
,
"test %d: got 0x%08x, expected 0x%08x
\n
"
,
i
,
hr
,
table
->
hr
);
...
...
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