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
b56031c3
Commit
b56031c3
authored
Nov 18, 2009
by
Piotr Caban
Committed by
Alexandre Julliard
Nov 18, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Implemented xmlnode_get_nodeTypedValue 'string' data type handling.
parent
41f061ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
20 deletions
+63
-20
node.c
dlls/msxml3/node.c
+43
-17
domdoc.c
dlls/msxml3/tests/domdoc.c
+20
-3
No files found.
dlls/msxml3/node.c
View file @
b56031c3
...
...
@@ -944,36 +944,62 @@ static HRESULT WINAPI xmlnode_get_definition(
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
xmlnode_get_dataType
(
IXMLDOMNode
*
,
VARIANT
*
);
inline
HRESULT
VARIANT_from_xmlChar
(
xmlChar
*
str
,
VARIANT
*
v
,
BSTR
type
)
{
if
(
!
type
||
!
lstrcmpiW
(
type
,
szString
))
{
V_VT
(
v
)
=
VT_BSTR
;
V_BSTR
(
v
)
=
bstr_from_xmlChar
(
str
);
if
(
!
V_BSTR
(
v
))
return
E_OUTOFMEMORY
;
}
else
{
FIXME
(
"Type handling not yet implemented
\n
"
);
V_VT
(
v
)
=
VT_BSTR
;
V_BSTR
(
v
)
=
bstr_from_xmlChar
(
str
);
if
(
!
V_BSTR
(
v
))
return
E_OUTOFMEMORY
;
}
return
S_OK
;
}
static
HRESULT
WINAPI
xmlnode_get_nodeTypedValue
(
IXMLDOMNode
*
iface
,
VARIANT
*
typedValue
)
{
xmlnode
*
This
=
impl_from_IXMLDOMNode
(
iface
);
HRESULT
r
=
S_FALSE
;
VARIANT
type
;
xmlChar
*
content
;
HRESULT
hres
=
S_FALSE
;
FIXME
(
"ignoring data type %p %p
\n
"
,
This
,
typedValu
e
);
TRACE
(
"iface %p
\n
"
,
ifac
e
);
if
(
!
typedValue
)
return
E_INVALIDARG
;
V_VT
(
typedValue
)
=
VT_NULL
;
switch
(
This
->
node
->
type
)
{
case
XML_ELEMENT_NODE
:
{
xmlChar
*
content
=
xmlNodeGetContent
(
This
->
node
);
V_VT
(
typedValue
)
=
VT_BSTR
;
V_BSTR
(
typedValue
)
=
bstr_from_xmlChar
(
content
);
xmlFree
(
content
);
r
=
S_OK
;
break
;
}
default:
r
=
xmlnode_get_nodeValue
(
iface
,
typedValue
);
}
if
(
This
->
node
->
type
==
XML_ELEMENT_NODE
||
This
->
node
->
type
==
XML_TEXT_NODE
||
This
->
node
->
type
==
XML_ENTITY_REF_NODE
)
hres
=
xmlnode_get_dataType
(
iface
,
&
type
);
return
r
;
if
(
hres
!=
S_OK
&&
This
->
node
->
type
!=
XML_ELEMENT_NODE
)
return
xmlnode_get_nodeValue
(
iface
,
typedValue
);
content
=
xmlNodeGetContent
(
This
->
node
);
hres
=
VARIANT_from_xmlChar
(
content
,
typedValue
,
hres
==
S_OK
?
V_BSTR
(
&
type
)
:
NULL
);
xmlFree
(
content
);
VariantClear
(
&
type
);
return
hres
;
}
static
HRESULT
WINAPI
xmlnode_put_nodeTypedValue
(
...
...
dlls/msxml3/tests/domdoc.c
View file @
b56031c3
...
...
@@ -147,8 +147,11 @@ static const CHAR szTransformOutput[] =
"</h1></body></html>"
;
static
const
CHAR
szTypeValueXML
[]
=
"<?xml version=
\"
1.0
\"
encoding=
\"
utf-8
\"
?>"
"<string>Wine</string>"
;
"<?xml version=
\"
1.0
\"
encoding=
\"
utf-8
\"
?>
\n
"
"<root xmlns:dt=
\"
urn:schemas-microsoft-com:datatypes
\"
>
\n
"
" <string>Wine</string>
\n
"
" <string2 dt:dt=
\"
string
\"
>String</string2>
\n
"
"</root>"
;
static
const
CHAR
szBasicTransformSSXMLPart1
[]
=
"<?xml version=
\"
1.0
\"
?>"
...
...
@@ -3972,7 +3975,7 @@ static void test_NodeTypeValue(void)
hr
=
IXMLDOMDocument2_get_nodeTypedValue
(
doc
,
&
v
);
ok
(
hr
==
S_FALSE
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMDocument2_selectSingleNode
(
doc
,
_bstr_
(
"string"
),
&
pNode
);
hr
=
IXMLDOMDocument2_selectSingleNode
(
doc
,
_bstr_
(
"
root/
string"
),
&
pNode
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
...
...
@@ -3987,11 +3990,25 @@ static void test_NodeTypeValue(void)
hr
=
IXMLDOMNode_get_nodeTypedValue
(
pNode
,
&
v
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
V_VT
(
&
v
)
==
VT_BSTR
,
"incorrect type
\n
"
);
ok
(
!
lstrcmpW
(
V_BSTR
(
&
v
),
_bstr_
(
"Wine"
)
),
"incorrect value
\n
"
);
VariantClear
(
&
v
);
IXMLDOMNode_Release
(
pNode
);
}
hr
=
IXMLDOMDocument2_selectSingleNode
(
doc
,
_bstr_
(
"root/string2"
),
&
pNode
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
hr
=
IXMLDOMNode_get_nodeTypedValue
(
pNode
,
&
v
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
V_VT
(
&
v
)
==
VT_BSTR
,
"incorrect type
\n
"
);
ok
(
!
lstrcmpW
(
V_BSTR
(
&
v
),
_bstr_
(
"String"
)
),
"incorrect value
\n
"
);
VariantClear
(
&
v
);
IXMLDOMNode_Release
(
pNode
);
}
}
IXMLDOMDocument2_Release
(
doc
);
...
...
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