Commit d659e63d authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

msxml3: Added support to create an Attribute in createNode.

parent 0435574a
......@@ -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);
......
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment