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
f3719a88
Commit
f3719a88
authored
Sep 03, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Sep 03, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented IXMLDOMNode::selectNodes.
parent
e4a20a4b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
179 additions
and
9 deletions
+179
-9
configure
configure
+0
-0
configure.ac
configure.ac
+15
-1
Makefile.in
dlls/msxml3/Makefile.in
+2
-2
msxml_private.h
dlls/msxml3/msxml_private.h
+1
-0
node.c
dlls/msxml3/node.c
+13
-2
nodelist.c
dlls/msxml3/nodelist.c
+136
-4
config.h.in
include/config.h.in
+12
-0
No files found.
configure
View file @
f3719a88
This diff is collapsed.
Click to expand it.
configure.ac
View file @
f3719a88
...
...
@@ -442,6 +442,8 @@ dnl **** Check for libxml2 ****
AC_SUBST(XML2LIBS,"")
AC_SUBST(XML2INCL,"")
AC_SUBST(XSLTLIBS,"")
AC_SUBST(XSLTINCL,"")
if test "$PKG_CONFIG" != "false"
then
ac_save_CPPFLAGS="$CPPFLAGS"
...
...
@@ -454,7 +456,19 @@ then
XML2LIBS="$ac_xml_libs"
XML2INCL="$ac_xml_cflags"],,$ac_xml_libs)
AC_CHECK_LIB(xml2, xmlReadMemory,
[AC_DEFINE(HAVE_XMLREADMEMORY,1,[Define if libxml2 has the xmlReadMemory function])])
[AC_DEFINE(HAVE_XMLREADMEMORY,1,[Define if libxml2 has the xmlReadMemory function])],,$ac_xml_libs)
])
CPPFLAGS="$ac_save_CPPFLAGS"
ac_xslt_libs="`$PKG_CONFIG --libs libxslt`"
ac_xslt_cflags="`$PKG_CONFIG --cflags libxslt`"
CPPFLAGS="$CPPFLAGS $ac_xslt_cflags"
AC_CHECK_HEADERS(libxslt/xslt.h \
libxslt/pattern.h \
libxslt/transform.h,
[AC_CHECK_LIB(xslt, xsltCompilePattern,
[AC_DEFINE(HAVE_LIBXSLT, 1, [Define if you have the libxslt library])
XSLTLIBS="$ac_xslt_libs"
XSLTINCL="$ac_xslt_cflags"],,$ac_xslt_libs)
])
CPPFLAGS="$ac_save_CPPFLAGS"
fi
...
...
dlls/msxml3/Makefile.in
View file @
f3719a88
...
...
@@ -5,8 +5,8 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
msxml3.dll
IMPORTS
=
oleaut32 advapi32 kernel32 ntdll
EXTRALIBS
=
-luuid
$(LIBUNICODE)
@XML2LIBS@
EXTRAINCL
=
@XML2INCL@
EXTRALIBS
=
-luuid
$(LIBUNICODE)
@XML2LIBS@
@XSLTLIBS@
EXTRAINCL
=
@XML2INCL@
@XSLTINCL@
C_SRCS
=
\
domdoc.c
\
...
...
dlls/msxml3/msxml_private.h
View file @
f3719a88
...
...
@@ -36,6 +36,7 @@ extern IXMLDOMNode *create_node( xmlNodePtr node );
extern
IXMLDOMElement
*
create_element
(
xmlNodePtr
element
);
extern
IXMLDOMNodeList
*
create_nodelist
(
xmlNodePtr
node
);
extern
IXMLDOMNamedNodeMap
*
create_nodemap
(
IXMLDOMNode
*
node
);
extern
IXMLDOMNodeList
*
create_filtered_nodelist
(
xmlNodePtr
,
const
xmlChar
*
);
/* data accessors */
xmlNodePtr
xmlNodePtr_from_domnode
(
IXMLDOMNode
*
iface
,
xmlElementType
type
);
...
...
dlls/msxml3/node.c
View file @
f3719a88
...
...
@@ -524,8 +524,19 @@ static HRESULT WINAPI xmlnode_selectNodes(
BSTR
queryString
,
IXMLDOMNodeList
**
resultList
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
xmlnode
*
This
=
impl_from_IXMLDOMNode
(
iface
);
xmlChar
*
str
=
NULL
;
HRESULT
r
=
E_FAIL
;
TRACE
(
"%p %s %p
\n
"
,
This
,
debugstr_w
(
queryString
),
resultList
);
str
=
xmlChar_from_wchar
(
queryString
);
if
(
!
str
)
return
r
;
*
resultList
=
create_filtered_nodelist
(
This
->
node
->
children
,
str
);
HeapFree
(
GetProcessHeap
(),
0
,
str
);
return
S_OK
;
}
static
HRESULT
WINAPI
xmlnode_selectSingleNode
(
...
...
dlls/msxml3/nodelist.c
View file @
f3719a88
...
...
@@ -37,9 +37,111 @@
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
msxml
);
#ifdef HAVE_LIBXML2
WINE_DEFAULT_DEBUG_CHANNEL
(
msxml
);
#ifdef HAVE_LIBXSLT
#ifdef HAVE_LIBXSLT_PATTERN_H
#include <libxslt/pattern.h>
#endif
#ifdef HAVE_LIBXSLT_TRANSFORM_H
#include <libxslt/transform.h>
#endif
struct
xslt_info
{
xsltTransformContextPtr
ctxt
;
xsltCompMatchPtr
pattern
;
xsltStylesheetPtr
sheet
;
};
static
void
xlst_info_init
(
struct
xslt_info
*
info
)
{
info
->
ctxt
=
NULL
;
info
->
pattern
=
NULL
;
info
->
sheet
=
NULL
;
}
static
int
create_xslt_parser
(
struct
xslt_info
*
info
,
xmlNodePtr
node
,
const
xmlChar
*
str
)
{
info
->
sheet
=
xsltNewStylesheet
();
if
(
!
info
->
sheet
)
return
0
;
info
->
ctxt
=
xsltNewTransformContext
(
info
->
sheet
,
node
->
doc
);
if
(
!
info
->
ctxt
)
return
0
;
info
->
pattern
=
xsltCompilePattern
(
str
,
node
->
doc
,
node
,
info
->
sheet
,
info
->
ctxt
);
if
(
!
info
->
pattern
)
return
0
;
return
1
;
}
void
free_xslt_info
(
struct
xslt_info
*
info
)
{
if
(
info
->
pattern
)
xsltFreeCompMatchList
(
info
->
pattern
);
if
(
info
->
sheet
)
xsltFreeStylesheet
(
info
->
sheet
);
if
(
info
->
ctxt
)
xsltFreeTransformContext
(
info
->
ctxt
);
}
static
HRESULT
xslt_next_match
(
struct
xslt_info
*
info
,
xmlNodePtr
*
node
)
{
if
(
!
info
->
ctxt
)
return
S_FALSE
;
/* make sure that the current element matches the pattern */
while
(
*
node
)
{
int
r
;
r
=
xsltTestCompMatchList
(
info
->
ctxt
,
*
node
,
info
->
pattern
);
if
(
1
==
r
)
{
TRACE
(
"Matched %p (%s)
\n
"
,
*
node
,
(
*
node
)
->
name
);
return
S_OK
;
}
if
(
r
!=
0
)
{
ERR
(
"Pattern match failed
\n
"
);
return
E_FAIL
;
}
*
node
=
(
*
node
)
->
next
;
}
return
S_OK
;
}
#else
struct
xslt_info
{
/* empty */
};
static
void
xlst_info_init
(
struct
xslt_info
*
info
)
{
}
void
free_xslt_info
(
struct
xslt_info
*
info
)
{
}
static
int
create_xslt_parser
(
struct
xslt_info
*
info
,
xmlNodePtr
node
,
const
xmlChar
*
str
)
{
MESSAGE
(
"libxslt was missing at compile time
\n
"
);
return
0
;
}
static
HRESULT
xslt_next_match
(
struct
xslt_info
*
info
,
xmlNodePtr
*
node
)
{
return
S_FALSE
;
}
#endif
typedef
struct
_xmlnodelist
{
...
...
@@ -47,6 +149,7 @@ typedef struct _xmlnodelist
LONG
ref
;
xmlNodePtr
node
;
xmlNodePtr
current
;
struct
xslt_info
xinfo
;
}
xmlnodelist
;
static
inline
xmlnodelist
*
impl_from_IXMLDOMNodeList
(
IXMLDOMNodeList
*
iface
)
...
...
@@ -91,6 +194,7 @@ static ULONG WINAPI xmlnodelist_Release(
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
{
free_xslt_info
(
&
This
->
xinfo
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -164,9 +268,14 @@ static HRESULT WINAPI xmlnodelist_nextNode(
IXMLDOMNode
**
nextItem
)
{
xmlnodelist
*
This
=
impl_from_IXMLDOMNodeList
(
iface
);
HRESULT
r
;
TRACE
(
"%p %p
\n
"
,
This
,
nextItem
);
r
=
xslt_next_match
(
&
This
->
xinfo
,
&
This
->
current
);
if
(
FAILED
(
r
)
)
return
r
;
if
(
!
This
->
current
)
return
S_FALSE
;
...
...
@@ -178,8 +287,11 @@ static HRESULT WINAPI xmlnodelist_nextNode(
static
HRESULT
WINAPI
xmlnodelist_reset
(
IXMLDOMNodeList
*
iface
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
xmlnodelist
*
This
=
impl_from_IXMLDOMNodeList
(
iface
);
TRACE
(
"%p
\n
"
,
This
);
This
->
current
=
This
->
node
;
return
S_OK
;
}
static
HRESULT
WINAPI
xmlnodelist__newEnum
(
...
...
@@ -207,7 +319,7 @@ static const struct IXMLDOMNodeListVtbl xmlnodelist_vtbl =
xmlnodelist__newEnum
,
};
IXMLDOMNodeList
*
create
_nodelist
(
xmlNodePtr
node
)
static
xmlnodelist
*
new
_nodelist
(
xmlNodePtr
node
)
{
xmlnodelist
*
nodelist
;
...
...
@@ -219,8 +331,28 @@ IXMLDOMNodeList* create_nodelist( xmlNodePtr node )
nodelist
->
ref
=
1
;
nodelist
->
node
=
node
;
nodelist
->
current
=
node
;
xlst_info_init
(
&
nodelist
->
xinfo
);
return
nodelist
;
}
IXMLDOMNodeList
*
create_nodelist
(
xmlNodePtr
node
)
{
xmlnodelist
*
nodelist
=
new_nodelist
(
node
);
if
(
!
node
)
return
NULL
;
return
(
IXMLDOMNodeList
*
)
&
nodelist
->
lpVtbl
;
}
IXMLDOMNodeList
*
create_filtered_nodelist
(
xmlNodePtr
node
,
const
xmlChar
*
str
)
{
xmlnodelist
*
This
=
new_nodelist
(
node
);
if
(
create_xslt_parser
(
&
This
->
xinfo
,
node
,
str
))
return
(
IXMLDOMNodeList
*
)
&
This
->
lpVtbl
;
IXMLDOMNodeList_Release
(
(
IXMLDOMNodeList
*
)
&
This
->
lpVtbl
);
return
NULL
;
}
#endif
include/config.h.in
View file @
f3719a88
...
...
@@ -284,6 +284,18 @@
/* Define if you have the X Shape extension */
#undef HAVE_LIBXSHAPE
/* Define if you have the libxslt library */
#undef HAVE_LIBXSLT
/* Define to 1 if you have the <libxslt/pattern.h> header file. */
#undef HAVE_LIBXSLT_PATTERN_H
/* Define to 1 if you have the <libxslt/transform.h> header file. */
#undef HAVE_LIBXSLT_TRANSFORM_H
/* Define to 1 if you have the <libxslt/xslt.h> header file. */
#undef HAVE_LIBXSLT_XSLT_H
/* Define if you have the Xxf86dga library version 2 */
#undef HAVE_LIBXXF86DGA2
...
...
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