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
4eb389bb
Commit
4eb389bb
authored
Feb 23, 2006
by
Huw Davies
Committed by
Alexandre Julliard
Feb 24, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Fix for empty node lists.
parent
69a23a60
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
7 deletions
+60
-7
nodelist.c
dlls/msxml3/nodelist.c
+4
-5
domdoc.c
dlls/msxml3/tests/domdoc.c
+56
-2
No files found.
dlls/msxml3/nodelist.c
View file @
4eb389bb
...
...
@@ -61,6 +61,8 @@ static void xslt_info_init( struct xslt_info *info )
static
int
create_xslt_parser
(
struct
xslt_info
*
info
,
xmlNodePtr
node
,
const
xmlChar
*
str
)
{
if
(
!
node
)
return
1
;
info
->
sheet
=
xsltNewStylesheet
();
if
(
!
info
->
sheet
)
return
0
;
...
...
@@ -220,7 +222,7 @@ static ULONG WINAPI xmlnodelist_Release(
if
(
ref
==
0
)
{
free_xslt_info
(
&
This
->
xinfo
);
xmldoc_release
(
This
->
node
->
doc
);
if
(
This
->
node
)
xmldoc_release
(
This
->
node
->
doc
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -424,7 +426,7 @@ static xmlnodelist *new_nodelist( xmlNodePtr node )
nodelist
->
enum_children
=
FALSE
;
xslt_info_init
(
&
nodelist
->
xinfo
);
xmldoc_add_ref
(
node
->
doc
);
if
(
node
)
xmldoc_add_ref
(
node
->
doc
);
return
nodelist
;
}
...
...
@@ -432,15 +434,12 @@ static xmlnodelist *new_nodelist( xmlNodePtr node )
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
,
BOOL
enum_children
)
{
xmlnodelist
*
This
=
new_nodelist
(
node
);
if
(
create_xslt_parser
(
&
This
->
xinfo
,
node
,
str
))
{
This
->
enum_children
=
enum_children
;
...
...
dlls/msxml3/tests/domdoc.c
View file @
4eb389bb
...
...
@@ -58,6 +58,7 @@ static const WCHAR szComplete4[] = {
'p'
,
'n'
,
'='
,
'\''
,
'w'
,
'i'
,
'n'
,
'e'
,
' '
,
'2'
,
'0'
,
'0'
,
'5'
,
'0'
,
'8'
,
'0'
,
'4'
,
'\''
,
'>'
,
'\n'
,
'f'
,
'n'
,
'2'
,
'.'
,
't'
,
'x'
,
't'
,
'\n'
,
'<'
,
'/'
,
'p'
,
'r'
,
'>'
,
'\n'
,
'<'
,
'e'
,
'm'
,
'p'
,
't'
,
'y'
,
'>'
,
'<'
,
'/'
,
'e'
,
'm'
,
'p'
,
't'
,
'y'
,
'>'
,
'\n'
,
'<'
,
'/'
,
'l'
,
'c'
,
'>'
,
'\n'
,
0
};
static
const
WCHAR
szNonExistentFile
[]
=
{
...
...
@@ -494,7 +495,7 @@ todo_wine
{
r
=
IXMLDOMNodeList_get_length
(
list
,
&
count
);
ok
(
r
==
S_OK
,
"get_length returns %08lx
\n
"
,
r
);
ok
(
count
==
2
,
"get_length got %ld
\n
"
,
count
);
ok
(
count
==
3
,
"get_length got %ld
\n
"
,
count
);
r
=
IXMLDOMNodeList_nextNode
(
list
,
&
node
);
ok
(
r
==
S_OK
,
"nextNode returned wrong code
\n
"
);
...
...
@@ -803,7 +804,7 @@ static void test_getElementsByTagName(void)
ok
(
r
==
S_OK
,
"ret %08lx
\n
"
,
r
);
r
=
IXMLDOMNodeList_get_length
(
node_list
,
&
len
);
ok
(
r
==
S_OK
,
"ret %08lx
\n
"
,
r
);
ok
(
len
==
3
,
"len %ld
\n
"
,
len
);
ok
(
len
==
4
,
"len %ld
\n
"
,
len
);
IXMLDOMNodeList_Release
(
node_list
);
SysFreeString
(
str
);
...
...
@@ -904,6 +905,58 @@ todo_wine {
IXMLDOMDocument_Release
(
doc
);
}
static
void
test_get_childNodes
(
void
)
{
HRESULT
r
;
BSTR
str
;
VARIANT_BOOL
b
;
IXMLDOMDocument
*
doc
;
IXMLDOMElement
*
element
;
IXMLDOMNode
*
node
,
*
node2
;
IXMLDOMNodeList
*
node_list
,
*
node_list2
;
long
len
;
r
=
CoCreateInstance
(
&
CLSID_DOMDocument
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IXMLDOMDocument
,
(
LPVOID
*
)
&
doc
);
if
(
r
!=
S_OK
)
return
;
str
=
SysAllocString
(
szComplete4
);
r
=
IXMLDOMDocument_loadXML
(
doc
,
str
,
&
b
);
ok
(
r
==
S_OK
,
"loadXML failed
\n
"
);
ok
(
b
==
VARIANT_TRUE
,
"failed to load XML string
\n
"
);
SysFreeString
(
str
);
r
=
IXMLDOMDocument_get_documentElement
(
doc
,
&
element
);
ok
(
r
==
S_OK
,
"ret %08lx
\n
"
,
r
);
r
=
IXMLDOMElement_get_childNodes
(
element
,
&
node_list
);
ok
(
r
==
S_OK
,
"ret %08lx
\n
"
,
r
);
r
=
IXMLDOMNodeList_get_length
(
node_list
,
&
len
);
ok
(
r
==
S_OK
,
"ret %08lx
\n
"
,
r
);
ok
(
len
==
3
,
"len %ld
\n
"
,
len
);
r
=
IXMLDOMNodeList_get_item
(
node_list
,
2
,
&
node
);
ok
(
r
==
S_OK
,
"ret %08lx
\n
"
,
r
);
r
=
IXMLDOMNode_get_childNodes
(
node
,
&
node_list2
);
ok
(
r
==
S_OK
,
"ret %08lx
\n
"
,
r
);
r
=
IXMLDOMNodeList_get_length
(
node_list2
,
&
len
);
ok
(
r
==
S_OK
,
"ret %08lx
\n
"
,
r
);
ok
(
len
==
0
,
"len %ld
\n
"
,
len
);
r
=
IXMLDOMNodeList_get_item
(
node_list2
,
0
,
&
node2
);
ok
(
r
==
S_FALSE
,
"ret %08lx
\n
"
,
r
);
IXMLDOMNodeList_Release
(
node_list2
);
IXMLDOMNode_Release
(
node
);
IXMLDOMNodeList_Release
(
node_list
);
IXMLDOMElement_Release
(
element
);
IXMLDOMDocument_Release
(
doc
);
}
START_TEST
(
domdoc
)
{
HRESULT
r
;
...
...
@@ -917,6 +970,7 @@ START_TEST(domdoc)
test_create
();
test_getElementsByTagName
();
test_get_text
();
test_get_childNodes
();
CoUninitialize
();
}
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