msxml3: Implemented xmlnode_get_nodeTypedValue 'number' data type handling.
This commit is contained in:
parent
b56031c3a6
commit
0a6d3a70ca
|
@ -948,7 +948,8 @@ static HRESULT WINAPI xmlnode_get_dataType(IXMLDOMNode*, VARIANT*);
|
|||
|
||||
inline HRESULT VARIANT_from_xmlChar(xmlChar *str, VARIANT *v, BSTR type)
|
||||
{
|
||||
if(!type || !lstrcmpiW(type, szString))
|
||||
if(!type || !lstrcmpiW(type, szString) ||
|
||||
!lstrcmpiW(type, szNumber))
|
||||
{
|
||||
V_VT(v) = VT_BSTR;
|
||||
V_BSTR(v) = bstr_from_xmlChar(str);
|
||||
|
|
|
@ -151,6 +151,8 @@ static const CHAR szTypeValueXML[] =
|
|||
"<root xmlns:dt=\"urn:schemas-microsoft-com:datatypes\">\n"
|
||||
" <string>Wine</string>\n"
|
||||
" <string2 dt:dt=\"string\">String</string2>\n"
|
||||
" <number dt:dt=\"number\">12.44</number>\n"
|
||||
" <number2 dt:dt=\"NUMbEr\">-3.71e3</number2>\n"
|
||||
"</root>";
|
||||
|
||||
static const CHAR szBasicTransformSSXMLPart1[] =
|
||||
|
@ -4009,6 +4011,32 @@ static void test_NodeTypeValue(void)
|
|||
|
||||
IXMLDOMNode_Release(pNode);
|
||||
}
|
||||
|
||||
hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/number"), &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_("12.44") ), "incorrect value\n");
|
||||
VariantClear( &v );
|
||||
|
||||
IXMLDOMNode_Release(pNode);
|
||||
}
|
||||
|
||||
hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_("root/number2"), &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_("-3.71e3") ), "incorrect value\n");
|
||||
VariantClear( &v );
|
||||
|
||||
IXMLDOMNode_Release(pNode);
|
||||
}
|
||||
}
|
||||
|
||||
IXMLDOMDocument2_Release(doc);
|
||||
|
|
Loading…
Reference in New Issue