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
58347402
Commit
58347402
authored
Nov 03, 2005
by
Stefan Huehner
Committed by
Alexandre Julliard
Nov 03, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add indexed access to attributes (nodemap) and childNodes
(nodelist), with some testcases.
parent
92032e6e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
130 additions
and
8 deletions
+130
-8
nodelist.c
dlls/msxml3/nodelist.c
+44
-4
nodemap.c
dlls/msxml3/nodemap.c
+53
-4
domdoc.c
dlls/msxml3/tests/domdoc.c
+33
-0
No files found.
dlls/msxml3/nodelist.c
View file @
58347402
...
...
@@ -251,16 +251,56 @@ static HRESULT WINAPI xmlnodelist_get_item(
long
index
,
IXMLDOMNode
**
listItem
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
xmlnodelist
*
This
=
impl_from_IXMLDOMNodeList
(
iface
);
xmlNodePtr
curr
;
long
nodeIndex
=
0
;
TRACE
(
"%p %ld
\n
"
,
This
,
index
);
*
listItem
=
NULL
;
if
(
index
<
0
)
return
S_FALSE
;
curr
=
This
->
node
;
for
(
nodeIndex
=
0
;
nodeIndex
<
index
;
nodeIndex
++
)
{
if
(
curr
->
next
==
NULL
)
return
S_FALSE
;
else
curr
=
curr
->
next
;
}
*
listItem
=
create_node
(
curr
);
return
S_OK
;
}
static
HRESULT
WINAPI
xmlnodelist_get_length
(
IXMLDOMNodeList
*
iface
,
long
*
listLength
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
xmlNodePtr
curr
;
long
nodeCount
=
0
;
xmlnodelist
*
This
=
impl_from_IXMLDOMNodeList
(
iface
);
TRACE
(
"%p
\n
"
,
This
);
if
(
This
->
node
==
NULL
)
{
*
listLength
=
0
;
return
S_OK
;
}
curr
=
This
->
node
;
nodeCount
=
1
;
while
(
curr
->
next
!=
NULL
)
{
nodeCount
++
;
curr
=
curr
->
next
;
}
*
listLength
=
nodeCount
;
return
S_OK
;
}
static
HRESULT
WINAPI
xmlnodelist_nextNode
(
...
...
dlls/msxml3/nodemap.c
View file @
58347402
...
...
@@ -196,16 +196,65 @@ static HRESULT WINAPI xmlnodemap_get_item(
long
index
,
IXMLDOMNode
**
listItem
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
xmlnodemap
*
This
=
impl_from_IXMLDOMNamedNodeMap
(
iface
);
xmlNodePtr
node
;
xmlAttrPtr
curr
;
long
attrIndex
;
TRACE
(
"%p %ld
\n
"
,
This
,
index
);
*
listItem
=
NULL
;
if
(
index
<
0
)
return
S_FALSE
;
node
=
xmlNodePtr_from_domnode
(
This
->
node
,
0
);
curr
=
node
->
properties
;
for
(
attrIndex
=
0
;
attrIndex
<
index
;
attrIndex
++
)
{
if
(
curr
->
next
==
NULL
)
return
S_FALSE
;
else
curr
=
curr
->
next
;
}
*
listItem
=
create_node
(
(
xmlNodePtr
)
curr
);
return
S_OK
;
}
static
HRESULT
WINAPI
xmlnodemap_get_length
(
IXMLDOMNamedNodeMap
*
iface
,
long
*
listLength
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
xmlNodePtr
node
;
xmlAttrPtr
first
;
xmlAttrPtr
curr
;
long
attrCount
;
xmlnodemap
*
This
=
impl_from_IXMLDOMNamedNodeMap
(
iface
);
TRACE
(
"%p
\n
"
,
This
);
node
=
xmlNodePtr_from_domnode
(
This
->
node
,
0
);
if
(
!
node
)
return
E_FAIL
;
first
=
node
->
properties
;
if
(
first
==
NULL
)
{
*
listLength
=
0
;
return
S_OK
;
}
curr
=
first
;
attrCount
=
1
;
while
(
curr
->
next
!=
NULL
)
{
attrCount
++
;
curr
=
curr
->
next
;
}
*
listLength
=
attrCount
;
return
S_OK
;
}
static
HRESULT
WINAPI
xmlnodemap_getQualifiedItem
(
...
...
dlls/msxml3/tests/domdoc.c
View file @
58347402
...
...
@@ -242,6 +242,7 @@ void test_domnode( void )
VARIANT_BOOL
b
;
BSTR
str
;
VARIANT
var
;
long
count
;
r
=
CoCreateInstance
(
&
CLSID_DOMDocument
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IXMLDOMDocument
,
(
LPVOID
*
)
&
doc
);
...
...
@@ -325,6 +326,38 @@ void test_domnode( void )
r
=
IXMLDOMNamedNodeMap_getNamedItem
(
map
,
str
,
&
node
);
ok
(
r
==
S_OK
,
"getNamedItem returned wrong code
\n
"
);
ok
(
node
!=
NULL
,
"should be attributes
\n
"
);
SysFreeString
(
str
);
/* test indexed access of attributes */
r
=
IXMLDOMNamedNodeMap_get_length
(
map
,
&
count
);
ok
(
r
==
S_OK
,
"get_length wrong code
\n
"
);
ok
(
count
==
1
,
"get_length != 1
\n
"
);
node
=
NULL
;
r
=
IXMLDOMNamedNodeMap_get_item
(
map
,
-
1
,
&
node
);
ok
(
r
==
S_FALSE
,
"get_item (-1) wrong code
\n
"
);
ok
(
node
==
NULL
,
"there is no node
\n
"
);
node
=
NULL
;
r
=
IXMLDOMNamedNodeMap_get_item
(
map
,
1
,
&
node
);
ok
(
r
==
S_FALSE
,
"get_item (1) wrong code
\n
"
);
ok
(
node
==
NULL
,
"there is no attribute
\n
"
);
node
=
NULL
;
r
=
IXMLDOMNamedNodeMap_get_item
(
map
,
0
,
&
node
);
ok
(
r
==
S_OK
,
"get_item (0) wrong code
\n
"
);
ok
(
node
!=
NULL
,
"should be attribute
\n
"
);
r
=
IXMLDOMNode_get_nodeName
(
node
,
NULL
);
ok
(
r
==
E_INVALIDARG
,
"get_nodeName (NULL) wrong code"
);
/* content doesn't matter here */
str
=
SysAllocString
(
szNonExistentFile
);
r
=
IXMLDOMNode_get_nodeName
(
node
,
&
str
);
ok
(
r
==
S_OK
,
"get_nodeName wrong code
\n
"
);
ok
(
str
!=
NULL
,
"str is null
\n
"
);
ok
(
!
lstrcmpW
(
str
,
szdl
),
"incorrect node name
\n
"
);
SysFreeString
(
str
);
}
else
ok
(
FALSE
,
"no map
\n
"
);
...
...
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