Huw Davies : msxml: Fix for get_nodeValue on attributes.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jan 16 14:37:55 CST 2006


Module: wine
Branch: refs/heads/master
Commit: e7187ff31f047f4d64d81edd5f8be84e2c7ab6e5
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=e7187ff31f047f4d64d81edd5f8be84e2c7ab6e5

Author: Huw Davies <huw at codeweavers.com>
Date:   Mon Jan 16 20:43:02 2006 +0100

msxml: Fix for get_nodeValue on attributes.

---

 dlls/msxml3/node.c         |    6 +++++-
 dlls/msxml3/tests/domdoc.c |    6 ++++++
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c
index 44d4b8f..4001ad4 100644
--- a/dlls/msxml3/node.c
+++ b/dlls/msxml3/node.c
@@ -225,10 +225,14 @@ static HRESULT WINAPI xmlnode_get_nodeVa
     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 );
diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c
index 6bf26cb..5d745ce 100644
--- a/dlls/msxml3/tests/domdoc.c
+++ b/dlls/msxml3/tests/domdoc.c
@@ -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");
 




More information about the wine-cvs mailing list