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
ff847e8c
Commit
ff847e8c
authored
Feb 14, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Pass XSL processor parameters to libxml2.
parent
9ca4f9b6
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
79 additions
and
22 deletions
+79
-22
dispex.c
dlls/msxml3/dispex.c
+0
-1
domdoc.c
dlls/msxml3/domdoc.c
+0
-1
httprequest.c
dlls/msxml3/httprequest.c
+0
-1
main.c
dlls/msxml3/main.c
+9
-0
msxml_private.h
dlls/msxml3/msxml_private.h
+16
-0
mxnamespace.c
dlls/msxml3/mxnamespace.c
+0
-1
node.c
dlls/msxml3/node.c
+47
-2
saxreader.c
dlls/msxml3/saxreader.c
+0
-1
stylesheet.c
dlls/msxml3/stylesheet.c
+7
-15
No files found.
dlls/msxml3/dispex.c
View file @
ff847e8c
...
...
@@ -38,7 +38,6 @@
#include "shlwapi.h"
#include "wine/debug.h"
#include "wine/list.h"
#include "wine/unicode.h"
#include "msxml_private.h"
...
...
dlls/msxml3/domdoc.c
View file @
ff847e8c
...
...
@@ -49,7 +49,6 @@
#include "objsafe.h"
#include "wine/debug.h"
#include "wine/list.h"
#include "msxml_private.h"
...
...
dlls/msxml3/httprequest.c
View file @
ff847e8c
...
...
@@ -47,7 +47,6 @@
#include "msxml_private.h"
#include "wine/debug.h"
#include "wine/list.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
msxml
);
...
...
dlls/msxml3/main.c
View file @
ff847e8c
...
...
@@ -36,6 +36,7 @@
# include <libxslt/transform.h>
# endif
# include <libxslt/xsltutils.h>
# include <libxslt/variables.h>
# include <libxslt/xsltInternals.h>
# endif
#endif
...
...
@@ -165,9 +166,13 @@ void* libxslt_handle = NULL;
#ifdef SONAME_LIBXSLT
# define DECL_FUNCPTR(f) typeof(f) * p##f = NULL
DECL_FUNCPTR
(
xsltApplyStylesheet
);
DECL_FUNCPTR
(
xsltApplyStylesheetUser
);
DECL_FUNCPTR
(
xsltCleanupGlobals
);
DECL_FUNCPTR
(
xsltFreeStylesheet
);
DECL_FUNCPTR
(
xsltFreeTransformContext
);
DECL_FUNCPTR
(
xsltNewTransformContext
);
DECL_FUNCPTR
(
xsltParseStylesheetDoc
);
DECL_FUNCPTR
(
xsltQuoteUserParams
);
# undef DECL_FUNCPTR
#endif
...
...
@@ -185,9 +190,13 @@ static void init_libxslt(void)
if (needed) { WARN("Can't find symbol %s\n", #f); goto sym_not_found; }
LOAD_FUNCPTR
(
xsltInit
,
0
);
LOAD_FUNCPTR
(
xsltApplyStylesheet
,
1
);
LOAD_FUNCPTR
(
xsltApplyStylesheetUser
,
1
);
LOAD_FUNCPTR
(
xsltCleanupGlobals
,
1
);
LOAD_FUNCPTR
(
xsltFreeStylesheet
,
1
);
LOAD_FUNCPTR
(
xsltFreeTransformContext
,
1
);
LOAD_FUNCPTR
(
xsltNewTransformContext
,
1
);
LOAD_FUNCPTR
(
xsltParseStylesheetDoc
,
1
);
LOAD_FUNCPTR
(
xsltQuoteUserParams
,
1
);
#undef LOAD_FUNCPTR
if
(
pxsltInit
)
...
...
dlls/msxml3/msxml_private.h
View file @
ff847e8c
...
...
@@ -24,6 +24,7 @@
#include "dispex.h"
#include "wine/unicode.h"
#include "wine/list.h"
#ifndef __WINE_CONFIG_H
# error You must include config.h to use this header
...
...
@@ -217,6 +218,20 @@ static inline LPSTR heap_strdupWtoA(LPCWSTR str)
return
ret
;
}
/* XSLProcessor parameter list */
struct
xslprocessor_par
{
struct
list
entry
;
BSTR
name
;
BSTR
value
;
};
struct
xslprocessor_params
{
struct
list
list
;
unsigned
int
count
;
};
#ifdef HAVE_LIBXML2
extern
void
schemasInit
(
void
)
DECLSPEC_HIDDEN
;
...
...
@@ -354,6 +369,7 @@ extern HRESULT node_get_text(const xmlnode*,BSTR*) DECLSPEC_HIDDEN;
extern
HRESULT
node_select_nodes
(
const
xmlnode
*
,
BSTR
,
IXMLDOMNodeList
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
node_select_singlenode
(
const
xmlnode
*
,
BSTR
,
IXMLDOMNode
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
node_transform_node
(
const
xmlnode
*
,
IXMLDOMNode
*
,
BSTR
*
)
DECLSPEC_HIDDEN
;
extern
HRESULT
node_transform_node_params
(
const
xmlnode
*
,
IXMLDOMNode
*
,
BSTR
*
,
const
struct
xslprocessor_params
*
)
DECLSPEC_HIDDEN
;
extern
HRESULT
node_create_supporterrorinfo
(
const
tid_t
*
,
void
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
get_domdoc_from_xmldoc
(
xmlDocPtr
xmldoc
,
IXMLDOMDocument3
**
document
)
DECLSPEC_HIDDEN
;
...
...
dlls/msxml3/mxnamespace.c
View file @
ff847e8c
...
...
@@ -39,7 +39,6 @@
#include "msxml_private.h"
#include "wine/debug.h"
#include "wine/list.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
msxml
);
...
...
dlls/msxml3/node.c
View file @
ff847e8c
...
...
@@ -35,6 +35,7 @@
# ifdef HAVE_LIBXSLT_TRANSFORM_H
# include <libxslt/transform.h>
# endif
# include <libxslt/variables.h>
# include <libxslt/xsltutils.h>
# include <libxslt/xsltInternals.h>
# endif
...
...
@@ -59,9 +60,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(msxml);
extern
void
*
libxslt_handle
;
# define MAKE_FUNCPTR(f) extern typeof(f) * p##f
MAKE_FUNCPTR
(
xsltApplyStylesheet
);
MAKE_FUNCPTR
(
xsltApplyStylesheetUser
);
MAKE_FUNCPTR
(
xsltCleanupGlobals
);
MAKE_FUNCPTR
(
xsltFreeStylesheet
);
MAKE_FUNCPTR
(
xsltFreeTransformContext
);
MAKE_FUNCPTR
(
xsltNewTransformContext
);
MAKE_FUNCPTR
(
xsltParseStylesheetDoc
);
MAKE_FUNCPTR
(
xsltQuoteUserParams
);
# undef MAKE_FUNCPTR
#endif
...
...
@@ -996,7 +1001,8 @@ static const xmlChar *get_output_buffer_content(xmlOutputBufferPtr output)
#endif
}
HRESULT
node_transform_node
(
const
xmlnode
*
This
,
IXMLDOMNode
*
stylesheet
,
BSTR
*
p
)
HRESULT
node_transform_node_params
(
const
xmlnode
*
This
,
IXMLDOMNode
*
stylesheet
,
BSTR
*
p
,
const
struct
xslprocessor_params
*
params
)
{
#ifdef SONAME_LIBXSLT
xsltStylesheetPtr
xsltSS
;
...
...
@@ -1013,7 +1019,41 @@ HRESULT node_transform_node(const xmlnode *This, IXMLDOMNode *stylesheet, BSTR *
xsltSS
=
pxsltParseStylesheetDoc
(
sheet
->
node
->
doc
);
if
(
xsltSS
)
{
xmlDocPtr
result
=
pxsltApplyStylesheet
(
xsltSS
,
This
->
node
->
doc
,
NULL
);
const
char
**
xslparams
=
NULL
;
xmlDocPtr
result
;
unsigned
int
i
;
/* convert our parameter list to libxml2 format */
if
(
params
&&
params
->
count
)
{
struct
xslprocessor_par
*
par
;
i
=
0
;
xslparams
=
heap_alloc
((
params
->
count
*
2
+
1
)
*
sizeof
(
char
*
));
LIST_FOR_EACH_ENTRY
(
par
,
&
params
->
list
,
struct
xslprocessor_par
,
entry
)
{
xslparams
[
i
++
]
=
(
char
*
)
xmlchar_from_wchar
(
par
->
name
);
xslparams
[
i
++
]
=
(
char
*
)
xmlchar_from_wchar
(
par
->
value
);
}
xslparams
[
i
]
=
NULL
;
}
if
(
xslparams
)
{
xsltTransformContextPtr
ctxt
=
pxsltNewTransformContext
(
xsltSS
,
This
->
node
->
doc
);
/* push parameters to user context */
pxsltQuoteUserParams
(
ctxt
,
xslparams
);
result
=
pxsltApplyStylesheetUser
(
xsltSS
,
This
->
node
->
doc
,
NULL
,
NULL
,
NULL
,
ctxt
);
pxsltFreeTransformContext
(
ctxt
);
for
(
i
=
0
;
i
<
params
->
count
*
2
;
i
++
)
heap_free
((
char
*
)
xslparams
[
i
]);
heap_free
(
xslparams
);
}
else
result
=
pxsltApplyStylesheet
(
xsltSS
,
This
->
node
->
doc
,
NULL
);
if
(
result
)
{
const
xmlChar
*
content
;
...
...
@@ -1060,6 +1100,11 @@ HRESULT node_transform_node(const xmlnode *This, IXMLDOMNode *stylesheet, BSTR *
#endif
}
HRESULT
node_transform_node
(
const
xmlnode
*
node
,
IXMLDOMNode
*
stylesheet
,
BSTR
*
p
)
{
return
node_transform_node_params
(
node
,
stylesheet
,
p
,
NULL
);
}
HRESULT
node_select_nodes
(
const
xmlnode
*
This
,
BSTR
query
,
IXMLDOMNodeList
**
nodes
)
{
xmlChar
*
str
;
...
...
dlls/msxml3/saxreader.c
View file @
ff847e8c
...
...
@@ -42,7 +42,6 @@
#include "shlwapi.h"
#include "wine/debug.h"
#include "wine/list.h"
#include "msxml_private.h"
...
...
dlls/msxml3/stylesheet.c
View file @
ff847e8c
...
...
@@ -37,7 +37,6 @@
#include "msxml_private.h"
#include "wine/debug.h"
#include "wine/list.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
msxml
);
...
...
@@ -50,19 +49,6 @@ typedef struct
IXMLDOMNode
*
node
;
}
xsltemplate
;
struct
xslprocessor_par
{
struct
list
entry
;
BSTR
name
;
BSTR
value
;
};
struct
xslprocessor_params
{
struct
list
list
;
unsigned
int
count
;
};
typedef
struct
{
DispatchEx
dispex
;
...
...
@@ -534,6 +520,7 @@ static HRESULT WINAPI xslprocessor_transform(
IXSLProcessor
*
iface
,
VARIANT_BOOL
*
ret
)
{
#ifdef HAVE_LIBXML2
xslprocessor
*
This
=
impl_from_IXSLProcessor
(
iface
);
HRESULT
hr
;
...
...
@@ -542,7 +529,8 @@ static HRESULT WINAPI xslprocessor_transform(
if
(
!
ret
)
return
E_INVALIDARG
;
SysFreeString
(
This
->
outstr
);
hr
=
IXMLDOMNode_transformNode
(
This
->
input
,
This
->
stylesheet
->
node
,
&
This
->
outstr
);
hr
=
node_transform_node_params
(
get_node_obj
(
This
->
input
),
This
->
stylesheet
->
node
,
&
This
->
outstr
,
&
This
->
params
);
if
(
hr
==
S_OK
)
{
if
(
This
->
output
)
...
...
@@ -558,6 +546,10 @@ static HRESULT WINAPI xslprocessor_transform(
*
ret
=
VARIANT_FALSE
;
return
hr
;
#else
FIXME
(
"libxml2 is required but wasn't present at compile time
\n
"
);
return
E_NOTIMPL
;
#endif
}
static
HRESULT
WINAPI
xslprocessor_reset
(
IXSLProcessor
*
iface
)
...
...
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