Skip to content
Snippets Groups Projects
Commit 48c0e684 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard
Browse files

msxml3: Implement setNamedItem.

parent f427951d
No related branches found
No related tags found
No related merge requests found
......@@ -71,4 +71,19 @@ extern HRESULT DOMDocument_create( IUnknown *pUnkOuter, LPVOID *ppObj );
extern HRESULT SchemaCache_create( IUnknown *pUnkOuter, LPVOID *ppObj );
extern HRESULT XMLDocument_create( IUnknown *pUnkOuter, LPVOID *ppObj );
/* IXMLDOMNode Internal Structure */
typedef struct _xmlnode
{
const struct IXMLDOMNodeVtbl *lpVtbl;
const struct IUnknownVtbl *lpInternalUnkVtbl;
IUnknown *pUnkOuter;
LONG ref;
xmlNodePtr node;
} xmlnode;
static inline xmlnode *impl_from_IXMLDOMNode( IXMLDOMNode *iface )
{
return (xmlnode *)((char*)iface - FIELD_OFFSET(xmlnode, lpVtbl));
}
#endif /* __MSXML_PRIVATE__ */
......@@ -39,20 +39,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(msxml);
#ifdef HAVE_LIBXML2
typedef struct _xmlnode
{
const struct IXMLDOMNodeVtbl *lpVtbl;
const struct IUnknownVtbl *lpInternalUnkVtbl;
IUnknown *pUnkOuter;
LONG ref;
xmlNodePtr node;
} xmlnode;
static inline xmlnode *impl_from_IXMLDOMNode( IXMLDOMNode *iface )
{
return (xmlnode *)((char*)iface - FIELD_OFFSET(xmlnode, lpVtbl));
}
static inline xmlnode *impl_from_InternalUnknown( IUnknown *iface )
{
return (xmlnode *)((char*)iface - FIELD_OFFSET(xmlnode, lpInternalUnkVtbl));
......
......@@ -195,8 +195,46 @@ static HRESULT WINAPI xmlnodemap_setNamedItem(
IXMLDOMNode* newItem,
IXMLDOMNode** namedItem)
{
FIXME("\n");
return E_NOTIMPL;
xmlnodemap *This = impl_from_IXMLDOMNamedNodeMap( iface );
xmlnode *ThisNew = NULL;
xmlNodePtr nodeNew;
IXMLDOMNode *pAttr = NULL;
xmlNodePtr node;
TRACE("%p %p %p\n", This, newItem, namedItem );
if(!newItem)
return E_INVALIDARG;
if(namedItem) *namedItem = NULL;
node = xmlNodePtr_from_domnode( This->node, 0 );
if ( !node )
return E_FAIL;
/* Must be an Attribute */
IUnknown_QueryInterface(newItem, &IID_IXMLDOMNode, (LPVOID*)&pAttr);
if(pAttr)
{
ThisNew = impl_from_IXMLDOMNode( pAttr );
if(ThisNew->node->type != XML_ATTRIBUTE_NODE)
{
IUnknown_Release(pAttr);
return E_FAIL;
}
nodeNew = xmlAddChild(node, ThisNew->node);
if(namedItem)
*namedItem = create_node( (xmlNodePtr) nodeNew );
IUnknown_Release(pAttr);
return S_OK;
}
return E_INVALIDARG;
}
static HRESULT WINAPI xmlnodemap_removeNamedItem(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment