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
f9ab8dab
Commit
f9ab8dab
authored
Nov 09, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Fix a redundant newline in transformation result in html mode.
parent
9860e85a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
3 deletions
+91
-3
node.c
dlls/msxml3/node.c
+48
-1
domdoc.c
dlls/msxml3/tests/domdoc.c
+43
-2
No files found.
dlls/msxml3/node.c
View file @
f9ab8dab
...
...
@@ -833,6 +833,53 @@ HRESULT node_get_xml(xmlnode *This, BOOL ensure_eol, BSTR *ret)
return
*
ret
?
S_OK
:
E_OUTOFMEMORY
;
}
static
void
htmldtd_dumpcontent
(
xmlOutputBufferPtr
buf
,
xmlDocPtr
doc
)
{
xmlDtdPtr
cur
=
doc
->
intSubset
;
xmlOutputBufferWriteString
(
buf
,
"<!DOCTYPE "
);
xmlOutputBufferWriteString
(
buf
,
(
const
char
*
)
cur
->
name
);
if
(
cur
->
ExternalID
)
{
xmlOutputBufferWriteString
(
buf
,
" PUBLIC "
);
xmlBufferWriteQuotedString
(
buf
->
buffer
,
cur
->
ExternalID
);
if
(
cur
->
SystemID
)
{
xmlOutputBufferWriteString
(
buf
,
" "
);
xmlBufferWriteQuotedString
(
buf
->
buffer
,
cur
->
SystemID
);
}
}
else
if
(
cur
->
SystemID
)
{
xmlOutputBufferWriteString
(
buf
,
" SYSTEM "
);
xmlBufferWriteQuotedString
(
buf
->
buffer
,
cur
->
SystemID
);
}
xmlOutputBufferWriteString
(
buf
,
">
\n
"
);
}
static
void
htmldoc_dumpcontent
(
xmlOutputBufferPtr
buf
,
xmlDocPtr
doc
)
{
xmlElementType
type
;
/* force HTML output */
type
=
doc
->
type
;
doc
->
type
=
XML_HTML_DOCUMENT_NODE
;
if
(
doc
->
intSubset
)
htmldtd_dumpcontent
(
buf
,
doc
);
if
(
doc
->
children
)
{
xmlNodePtr
cur
=
doc
->
children
;
while
(
cur
)
{
htmlNodeDumpFormatOutput
(
buf
,
doc
,
cur
,
NULL
,
1
);
cur
=
cur
->
next
;
}
}
doc
->
type
=
type
;
}
HRESULT
node_transform_node
(
const
xmlnode
*
This
,
IXMLDOMNode
*
stylesheet
,
BSTR
*
p
)
{
#ifdef SONAME_LIBXSLT
...
...
@@ -860,7 +907,7 @@ HRESULT node_transform_node(const xmlnode *This, IXMLDOMNode *stylesheet, BSTR *
xmlOutputBufferPtr
output
=
xmlAllocOutputBuffer
(
NULL
);
if
(
output
)
{
html
DocContentDumpOutput
(
output
,
result
->
doc
,
NULL
);
html
doc_dumpcontent
(
output
,
result
->
doc
);
content
=
xmlBufferContent
(
output
->
buffer
);
*
p
=
bstr_from_xmlChar
(
content
);
xmlOutputBufferClose
(
output
);
...
...
dlls/msxml3/tests/domdoc.c
View file @
f9ab8dab
...
...
@@ -9732,8 +9732,7 @@ todo_wine {
hr
=
IXSLProcessor_get_output
(
processor
,
&
v
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
V_VT
(
&
v
)
==
VT_BSTR
,
"got type %d
\n
"
,
V_VT
(
&
v
));
/* we currently output one '\n' instead of empty string */
todo_wine
ok
(
lstrcmpW
(
V_BSTR
(
&
v
),
_bstr_
(
""
))
==
0
,
"got %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
v
)));
ok
(
lstrcmpW
(
V_BSTR
(
&
v
),
_bstr_
(
""
))
==
0
,
"got %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
v
)));
IXMLDOMDocument_Release
(
doc2
);
VariantClear
(
&
v
);
...
...
@@ -12469,6 +12468,47 @@ static void test_namedmap_newenum(void)
IXMLDOMDocument_Release
(
doc
);
}
static
const
char
xsltext_xsl
[]
=
"<?xml version=
\"
1.0
\"
?>"
"<xsl:stylesheet version=
\"
1.0
\"
xmlns:xsl=
\"
http://www.w3.org/1999/XSL/Transform
\"
>"
"<xsl:output method=
\"
html
\"
encoding=
\"
us-ascii
\"
/>"
"<xsl:template match=
\"
/
\"
>"
" <xsl:choose>"
" <xsl:when test=
\"
testkey
\"
>"
" <xsl:text>testdata</xsl:text>"
" </xsl:when>"
" </xsl:choose>"
"</xsl:template>"
"</xsl:stylesheet>"
;
static
void
test_xsltext
(
void
)
{
IXMLDOMDocument
*
doc
,
*
doc2
;
VARIANT_BOOL
b
;
HRESULT
hr
;
BSTR
ret
;
doc
=
create_document
(
&
IID_IXMLDOMDocument
);
if
(
!
doc
)
return
;
doc2
=
create_document
(
&
IID_IXMLDOMDocument
);
hr
=
IXMLDOMDocument_loadXML
(
doc
,
_bstr_
(
xsltext_xsl
),
&
b
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
IXMLDOMDocument_loadXML
(
doc2
,
_bstr_
(
"<testkey/>"
),
&
b
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
IXMLDOMDocument_transformNode
(
doc2
,
(
IXMLDOMNode
*
)
doc
,
&
ret
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
!
lstrcmpW
(
ret
,
_bstr_
(
"testdata"
)),
"transform result %s
\n
"
,
wine_dbgstr_w
(
ret
));
SysFreeString
(
ret
);
IXMLDOMDocument_Release
(
doc2
);
IXMLDOMDocument_Release
(
doc
);
free_bstrs
();
}
START_TEST
(
domdoc
)
{
IXMLDOMDocument
*
doc
;
...
...
@@ -12552,6 +12592,7 @@ START_TEST(domdoc)
test_namedmap_newenum
();
test_xsltemplate
();
test_xsltext
();
hr
=
CoCreateInstance
(
&
CLSID_MXNamespaceManager40
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IMXNamespaceManager
,
(
void
**
)
&
unk
);
...
...
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