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
42db8b43
Commit
42db8b43
authored
Apr 24, 2008
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Apr 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Corrected transformNode.
parent
9c8c3300
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
16 deletions
+50
-16
node.c
dlls/msxml3/node.c
+33
-11
domdoc.c
dlls/msxml3/tests/domdoc.c
+17
-5
No files found.
dlls/msxml3/node.c
View file @
42db8b43
...
...
@@ -44,6 +44,10 @@
# include <libxslt/xsltInternals.h>
#endif
#ifdef HAVE_LIBXML2
# include <libxml/HTMLtree.h>
#endif
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
msxml
);
...
...
@@ -1065,21 +1069,39 @@ static HRESULT WINAPI xmlnode_transformNode(
result
=
xsltApplyStylesheet
(
xsltSS
,
This
->
node
->
doc
,
NULL
);
if
(
result
)
{
xmlBufferPtr
pXmlBuf
;
int
nSize
;
const
xmlChar
*
pContent
;
pXmlBuf
=
xmlBufferCreate
();
if
(
pXmlBuf
)
if
(
result
->
type
==
XML_HTML_DOCUMENT_NODE
)
{
nSize
=
xmlNodeDump
(
pXmlBuf
,
NULL
,
(
xmlNodePtr
)
result
,
0
,
0
);
if
(
nSize
>
0
)
xmlOutputBufferPtr
pOutput
=
xmlAllocOutputBuffer
(
NULL
);
if
(
pOutput
)
{
const
xmlChar
*
pContent
;
pContent
=
xmlBufferContent
(
pXmlBuf
);
*
xmlString
=
bstr_from_xmlChar
(
pContent
);
htmlDocContentDumpOutput
(
pOutput
,
result
->
doc
,
NULL
);
if
(
pOutput
)
{
pContent
=
xmlBufferContent
(
pOutput
->
buffer
);
*
xmlString
=
bstr_from_xmlChar
(
pContent
);
}
xmlOutputBufferClose
(
pOutput
);
}
}
else
{
xmlBufferPtr
pXmlBuf
;
int
nSize
;
xmlBufferFree
(
pXmlBuf
);
pXmlBuf
=
xmlBufferCreate
();
if
(
pXmlBuf
)
{
nSize
=
xmlNodeDump
(
pXmlBuf
,
NULL
,
(
xmlNodePtr
)
result
,
0
,
0
);
if
(
nSize
>
0
)
{
pContent
=
xmlBufferContent
(
pXmlBuf
);
*
xmlString
=
bstr_from_xmlChar
(
pContent
);
xmlBufferFree
(
pXmlBuf
);
}
}
}
}
...
...
dlls/msxml3/tests/domdoc.c
View file @
42db8b43
...
...
@@ -143,10 +143,9 @@ static const CHAR szTransformSSXML[] =
"</xsl:stylesheet>"
;
static
const
CHAR
szTransformOutput
[]
=
"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
standalone=
\"
yes
\"
?>
\n
"
"<html><body><h1>
\n
"
"Hello World
\n
"
"</h1></body></html>
\n
"
;
"<html><body><h1>"
"Hello World"
"</h1></body></html>"
;
static
const
WCHAR
szNonExistentFile
[]
=
{
'c'
,
':'
,
'\\'
,
'N'
,
'o'
,
'n'
,
'e'
,
'x'
,
'i'
,
's'
,
't'
,
'e'
,
'n'
,
't'
,
'.'
,
'x'
,
'm'
,
'l'
,
0
...
...
@@ -242,6 +241,19 @@ static VARIANT _variantbstr_(const char *str)
return
v
;
}
static
BOOL
compareIgnoreReturns
(
BSTR
sLeft
,
BSTR
sRight
)
{
for
(;;)
{
while
(
*
sLeft
==
'\r'
||
*
sLeft
==
'\n'
)
sLeft
++
;
while
(
*
sRight
==
'\r'
||
*
sRight
==
'\n'
)
sRight
++
;
if
(
*
sLeft
!=
*
sRight
)
return
FALSE
;
if
(
!*
sLeft
)
return
TRUE
;
sLeft
++
;
sRight
++
;
}
}
static
void
get_str_for_type
(
DOMNodeType
type
,
char
*
buf
)
{
switch
(
type
)
...
...
@@ -3193,7 +3205,7 @@ static void test_testTransforms(void)
hr
=
IXMLDOMDocument_transformNode
(
doc
,
pNode
,
&
bOut
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
bOut
,
_bstr_
(
szTransformOutput
)
),
"Stylesheet output not correct
\n
"
);
ok
(
compareIgnoreReturns
(
bOut
,
_bstr_
(
szTransformOutput
)
),
"Stylesheet output not correct
\n
"
);
IXMLDOMNode_Release
(
pNode
);
}
...
...
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