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
16d83dc7
Commit
16d83dc7
authored
Feb 12, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 12, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Support more node types in IXMLDOMDocument_createNode().
parent
e2b72780
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
17 deletions
+67
-17
domdoc.c
dlls/msxml3/domdoc.c
+35
-17
node.c
dlls/msxml3/node.c
+3
-0
domdoc.c
dlls/msxml3/tests/domdoc.c
+29
-0
No files found.
dlls/msxml3/domdoc.c
View file @
16d83dc7
...
...
@@ -1342,11 +1342,11 @@ static HRESULT WINAPI domdoc_createNode(
{
domdoc
*
This
=
impl_from_IXMLDOMDocument2
(
iface
);
DOMNodeType
node_type
;
xmlNodePtr
xmlnode
=
NULL
;
xmlNodePtr
xmlnode
;
xmlChar
*
xml_name
;
HRESULT
hr
;
TRACE
(
"(%p)->(
type,
%s,%s,%p)
\n
"
,
This
,
debugstr_w
(
name
),
debugstr_w
(
namespaceURI
),
node
);
TRACE
(
"(%p)->(%s,%s,%p)
\n
"
,
This
,
debugstr_w
(
name
),
debugstr_w
(
namespaceURI
),
node
);
if
(
!
node
)
return
E_INVALIDARG
;
...
...
@@ -1354,8 +1354,7 @@ static HRESULT WINAPI domdoc_createNode(
FIXME
(
"nodes with namespaces currently not supported.
\n
"
);
hr
=
get_node_type
(
Type
,
&
node_type
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
FAILED
(
hr
))
return
hr
;
TRACE
(
"node_type %d
\n
"
,
node_type
);
...
...
@@ -1365,30 +1364,49 @@ static HRESULT WINAPI domdoc_createNode(
{
case
NODE_ELEMENT
:
xmlnode
=
xmlNewDocNode
(
get_doc
(
This
),
NULL
,
xml_name
,
NULL
);
*
node
=
create_node
(
xmlnode
);
TRACE
(
"created %p
\n
"
,
xmlnode
);
break
;
case
NODE_ATTRIBUTE
:
xmlnode
=
(
xmlNode
*
)
xmlNewProp
(
NULL
,
xml_name
,
NULL
);
if
(
xmlnode
)
{
xmlnode
->
doc
=
get_doc
(
This
);
*
node
=
(
IXMLDOMNode
*
)
create_attribute
(
xmlnode
);
}
TRACE
(
"created %p
\n
"
,
xmlnode
);
xmlnode
=
(
xmlNodePtr
)
xmlNewDocProp
(
get_doc
(
This
),
xml_name
,
NULL
);
break
;
case
NODE_TEXT
:
xmlnode
=
(
xmlNodePtr
)
xmlNewDocText
(
get_doc
(
This
),
NULL
);
break
;
case
NODE_CDATA_SECTION
:
xmlnode
=
xmlNewCDataBlock
(
get_doc
(
This
),
NULL
,
0
);
break
;
case
NODE_PROCESSING_INSTRUCTION
:
#ifdef HAVE_XMLNEWDOCPI
xmlnode
=
xmlNewDocPI
(
get_doc
(
This
),
xml_name
,
NULL
);
#else
FIXME
(
"xmlNewDocPI() not supported, use libxml2 2.6.15 or greater
\n
"
);
xmlnode
=
NULL
;
#endif
break
;
case
NODE_COMMENT
:
xmlnode
=
xmlNewDocComment
(
get_doc
(
This
),
NULL
);
break
;
case
NODE_DOCUMENT_FRAGMENT
:
xmlnode
=
xmlNewDocFragment
(
get_doc
(
This
));
break
;
/* unsupported types */
case
NODE_DOCUMENT
:
case
NODE_DOCUMENT_TYPE
:
case
NODE_ENTITY
:
case
NODE_NOTATION
:
heap_free
(
xml_name
);
return
E_INVALIDARG
;
default:
FIXME
(
"unhandled node type %d
\n
"
,
node_type
);
xmlnode
=
NULL
;
break
;
}
*
node
=
create_node
(
xmlnode
);
heap_free
(
xml_name
);
if
(
xmlnode
&&
*
node
)
if
(
*
node
)
{
TRACE
(
"created node (%d, %p, %p)
\n
"
,
node_type
,
*
node
,
xmlnode
);
xmldoc_add_orphan
(
xmlnode
->
doc
,
xmlnode
);
return
S_OK
;
}
...
...
dlls/msxml3/node.c
View file @
16d83dc7
...
...
@@ -1752,6 +1752,9 @@ IXMLDOMNode *create_node( xmlNodePtr node )
case
XML_DOCUMENT_NODE
:
pUnk
=
create_domdoc
(
node
);
break
;
case
XML_DOCUMENT_FRAG_NODE
:
pUnk
=
create_doc_fragment
(
node
);
break
;
default:
{
xmlnode
*
new_node
;
...
...
dlls/msxml3/tests/domdoc.c
View file @
16d83dc7
...
...
@@ -1657,6 +1657,35 @@ static void test_create(void)
if
(
r
!=
S_OK
)
return
;
/* types not supported for creation */
V_VT
(
&
var
)
=
VT_I1
;
V_I1
(
&
var
)
=
NODE_DOCUMENT
;
node
=
(
IXMLDOMNode
*
)
0x1
;
r
=
IXMLDOMDocument_createNode
(
doc
,
var
,
NULL
,
NULL
,
&
node
);
ok
(
r
==
E_INVALIDARG
,
"returns %08x
\n
"
,
r
);
ok
(
node
==
(
void
*
)
0x1
,
"expected same ptr, got %p
\n
"
,
node
);
V_VT
(
&
var
)
=
VT_I1
;
V_I1
(
&
var
)
=
NODE_DOCUMENT_TYPE
;
node
=
(
IXMLDOMNode
*
)
0x1
;
r
=
IXMLDOMDocument_createNode
(
doc
,
var
,
NULL
,
NULL
,
&
node
);
ok
(
r
==
E_INVALIDARG
,
"returns %08x
\n
"
,
r
);
ok
(
node
==
(
void
*
)
0x1
,
"expected same ptr, got %p
\n
"
,
node
);
V_VT
(
&
var
)
=
VT_I1
;
V_I1
(
&
var
)
=
NODE_ENTITY
;
node
=
(
IXMLDOMNode
*
)
0x1
;
r
=
IXMLDOMDocument_createNode
(
doc
,
var
,
NULL
,
NULL
,
&
node
);
ok
(
r
==
E_INVALIDARG
,
"returns %08x
\n
"
,
r
);
ok
(
node
==
(
void
*
)
0x1
,
"expected same ptr, got %p
\n
"
,
node
);
V_VT
(
&
var
)
=
VT_I1
;
V_I1
(
&
var
)
=
NODE_NOTATION
;
node
=
(
IXMLDOMNode
*
)
0x1
;
r
=
IXMLDOMDocument_createNode
(
doc
,
var
,
NULL
,
NULL
,
&
node
);
ok
(
r
==
E_INVALIDARG
,
"returns %08x
\n
"
,
r
);
ok
(
node
==
(
void
*
)
0x1
,
"expected same ptr, got %p
\n
"
,
node
);
V_VT
(
&
var
)
=
VT_I1
;
V_I1
(
&
var
)
=
NODE_ELEMENT
;
str
=
SysAllocString
(
szlc
);
...
...
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