Alistair Leslie-Hughes : msxml3: Added support to create an Attribute in createNode.
Alexandre Julliard
julliard at winehq.org
Thu Jul 3 06:35:00 CDT 2008
Module: wine
Branch: master
Commit: d659e63d73d7f3dffb263bb0132709533f642cf8
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d659e63d73d7f3dffb263bb0132709533f642cf8
Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Wed Jul 2 22:49:50 2008 +1000
msxml3: Added support to create an Attribute in createNode.
---
dlls/msxml3/domdoc.c | 11 +++++++++++
dlls/msxml3/tests/domdoc.c | 18 ++++++++++++++++++
2 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c
index c860d90..07166ca 100644
--- a/dlls/msxml3/domdoc.c
+++ b/dlls/msxml3/domdoc.c
@@ -1224,6 +1224,17 @@ static HRESULT WINAPI domdoc_createNode(
*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);
+ break;
default:
FIXME("unhandled node type %d\n", node_type);
diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c
index d5c463d..6f3e8e0 100644
--- a/dlls/msxml3/tests/domdoc.c
+++ b/dlls/msxml3/tests/domdoc.c
@@ -1491,6 +1491,24 @@ static void test_create(void)
VariantClear(&var);
SysFreeString(name);
+ /* Create an Attribute */
+ V_VT(&var) = VT_I4;
+ V_I4(&var) = NODE_ATTRIBUTE;
+ str = SysAllocString( szAttribute );
+ r = IXMLDOMDocument_createNode( doc, var, str, NULL, &node );
+ ok( r == S_OK, "returns %08x\n", r );
+ ok( node != NULL, "node was null\n");
+ SysFreeString(str);
+
+ if(r == S_OK)
+ {
+ r = IXMLDOMNode_get_nodeTypeString(node, &str);
+ ok( r == S_OK, "returns %08x\n", r );
+ ok( !lstrcmpW( str, _bstr_("attribute") ), "incorrect nodeTypeString string\n");
+ SysFreeString(str);
+ IXMLDOMNode_Release( node );
+ }
+
IXMLDOMElement_Release( element );
IXMLDOMNode_Release( root );
IXMLDOMDocument_Release( doc );
More information about the wine-cvs
mailing list