msxml: Fix for get_nodeValue on attributes.

This commit is contained in:
Huw Davies 2006-01-16 20:43:02 +01:00 committed by Alexandre Julliard
parent 65707fb940
commit e7187ff31f
2 changed files with 11 additions and 1 deletions

View file

@ -225,10 +225,14 @@ static HRESULT WINAPI xmlnode_get_nodeValue(
switch ( This->node->type )
{
case XML_ATTRIBUTE_NODE:
{
xmlChar *content = xmlNodeGetContent(This->node);
V_VT(value) = VT_BSTR;
V_BSTR(value) = bstr_from_xmlChar( This->node->name );
V_BSTR(value) = bstr_from_xmlChar( content );
xmlFree(content);
r = S_OK;
break;
}
case XML_TEXT_NODE:
V_VT(value) = VT_BSTR;
V_BSTR(value) = bstr_from_xmlChar( This->node->content );

View file

@ -404,6 +404,12 @@ void test_domnode( void )
ok( r == S_OK, "get_baseName returned wrong code\n");
ok( lstrcmpW(str,szdl) == 0, "basename was wrong\n");
r = IXMLDOMNode_get_nodeValue( node, &var );
ok( r == S_OK, "returns %08lx\n", r );
ok( V_VT(&var) == VT_BSTR, "vt %x\n", V_VT(&var));
ok( !lstrcmpW(V_BSTR(&var), szstr1), "nodeValue incorrect\n");
VariantClear(&var);
r = IXMLDOMNode_get_childNodes( node, NULL );
ok( r == E_INVALIDARG, "get_childNodes returned wrong code\n");