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
02af7440
Commit
02af7440
authored
Mar 13, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 13, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Respect stylesheet output mode when dumping resulting document.
parent
28cc0b8b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
22 deletions
+50
-22
main.c
dlls/msxml3/main.c
+2
-0
node.c
dlls/msxml3/node.c
+9
-22
domdoc.c
dlls/msxml3/tests/domdoc.c
+39
-0
No files found.
dlls/msxml3/main.c
View file @
02af7440
...
...
@@ -173,6 +173,7 @@ DECL_FUNCPTR(xsltFreeTransformContext);
DECL_FUNCPTR
(
xsltNewTransformContext
);
DECL_FUNCPTR
(
xsltParseStylesheetDoc
);
DECL_FUNCPTR
(
xsltQuoteUserParams
);
DECL_FUNCPTR
(
xsltSaveResultTo
);
# undef DECL_FUNCPTR
#endif
...
...
@@ -197,6 +198,7 @@ static void init_libxslt(void)
LOAD_FUNCPTR
(
xsltNewTransformContext
,
1
);
LOAD_FUNCPTR
(
xsltParseStylesheetDoc
,
1
);
LOAD_FUNCPTR
(
xsltQuoteUserParams
,
1
);
LOAD_FUNCPTR
(
xsltSaveResultTo
,
1
);
#undef LOAD_FUNCPTR
if
(
pxsltInit
)
...
...
dlls/msxml3/node.c
View file @
02af7440
...
...
@@ -67,6 +67,7 @@ MAKE_FUNCPTR(xsltFreeTransformContext);
MAKE_FUNCPTR
(
xsltNewTransformContext
);
MAKE_FUNCPTR
(
xsltParseStylesheetDoc
);
MAKE_FUNCPTR
(
xsltQuoteUserParams
);
MAKE_FUNCPTR
(
xsltSaveResultTo
);
# undef MAKE_FUNCPTR
#endif
...
...
@@ -1058,30 +1059,16 @@ HRESULT node_transform_node_params(const xmlnode *This, IXMLDOMNode *stylesheet,
{
const
xmlChar
*
content
;
if
(
result
->
type
==
XML_HTML_DOCUMENT_NODE
)
xmlOutputBufferPtr
output
=
xmlAllocOutputBuffer
(
NULL
);
if
(
output
)
{
xmlOutputBufferPtr
output
=
xmlAllocOutputBuffer
(
NULL
);
if
(
output
)
{
if
(
result
->
type
==
XML_HTML_DOCUMENT_NODE
)
htmldoc_dumpcontent
(
output
,
result
->
doc
);
content
=
get_output_buffer_content
(
output
);
*
p
=
bstr_from_xmlChar
(
content
);
xmlOutputBufferClose
(
output
);
}
}
else
{
xmlBufferPtr
buf
=
xmlBufferCreate
();
if
(
buf
)
{
int
size
=
xmlNodeDump
(
buf
,
NULL
,
(
xmlNodePtr
)
result
,
0
,
0
);
if
(
size
>
0
)
{
content
=
xmlBufferContent
(
buf
);
*
p
=
bstr_from_xmlChar
(
content
);
}
xmlBufferFree
(
buf
);
}
else
pxsltSaveResultTo
(
output
,
result
->
doc
,
xsltSS
);
content
=
get_output_buffer_content
(
output
);
*
p
=
bstr_from_xmlChar
(
content
);
xmlOutputBufferClose
(
output
);
}
xmlFreeDoc
(
result
);
}
...
...
dlls/msxml3/tests/domdoc.c
View file @
02af7440
...
...
@@ -11659,6 +11659,32 @@ static const char xsltext_xsl[] =
"</xsl:template>"
"</xsl:stylesheet>"
;
static
const
char
omitxmldecl_xsl
[]
=
"<?xml version=
\"
1.0
\"
?>"
"<xsl:stylesheet version=
\"
1.0
\"
xmlns:xsl=
\"
http://www.w3.org/1999/XSL/Transform
\"
>"
"<xsl:output method=
\"
xml
\"
omit-xml-declaration=
\"
yes
\"
/>"
"<xsl:template match=
\"
/
\"
>"
" <xsl:for-each select=
\"
/a/item
\"
>"
" <xsl:element name=
\"
node
\"
>"
" <xsl:value-of select=
\"
@name
\"
/>"
" </xsl:element>"
" </xsl:for-each>"
"</xsl:template>"
"</xsl:stylesheet>"
;
static
const
char
omitxmldecl_doc
[]
=
"<?xml version=
\"
1.0
\"
?>"
"<a>"
" <item name=
\"
item1
\"
/>"
" <item name=
\"
item2
\"
/>"
"</a>"
;
static
const
char
omitxmldecl_result
[]
=
"<node>item1</node><node>item2</node>"
;
static
const
char
omitxmldecl_result2
[]
=
"<node>item1</node><node>item2</node>
\n
"
;
static
void
test_xsltext
(
void
)
{
IXMLDOMDocument
*
doc
,
*
doc2
;
...
...
@@ -11680,6 +11706,19 @@ static void test_xsltext(void)
ok
(
!
lstrcmpW
(
ret
,
_bstr_
(
"testdata"
)),
"transform result %s
\n
"
,
wine_dbgstr_w
(
ret
));
SysFreeString
(
ret
);
/* omit-xml-declaration */
hr
=
IXMLDOMDocument_loadXML
(
doc
,
_bstr_
(
omitxmldecl_xsl
),
&
b
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXMLDOMDocument_loadXML
(
doc2
,
_bstr_
(
omitxmldecl_doc
),
&
b
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXMLDOMDocument_transformNode
(
doc2
,
(
IXMLDOMNode
*
)
doc
,
&
ret
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
/* Old enough libxslt places extra '\n' at the end of the output. */
ok
(
!
lstrcmpW
(
ret
,
_bstr_
(
omitxmldecl_result
))
||
!
lstrcmpW
(
ret
,
_bstr_
(
omitxmldecl_result2
)),
"transform result %s
\n
"
,
wine_dbgstr_w
(
ret
));
SysFreeString
(
ret
);
IXMLDOMDocument_Release
(
doc2
);
IXMLDOMDocument_Release
(
doc
);
free_bstrs
();
...
...
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