ReactOS 0.4.16-dev-2208-g6350669
domdoc.c File Reference
#include <stdarg.h>
#include <assert.h>
#include <libxml/parser.h>
#include <libxml/xmlerror.h>
#include <libxml/xpathInternals.h>
#include <libxml/xmlsave.h>
#include <libxml/SAX2.h>
#include <libxml/parserInternals.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winnls.h"
#include "ole2.h"
#include "olectl.h"
#include "msxml6.h"
#include "wininet.h"
#include "winreg.h"
#include "shlwapi.h"
#include "ocidl.h"
#include "objsafe.h"
#include "wine/debug.h"
#include "msxml_private.h"
Include dependency graph for domdoc.c:

Go to the source code of this file.

Classes

struct  domdoc_properties
 
struct  ConnectionPoint< T >
 
struct  domdoc
 
struct  _xmldoc_priv
 
struct  _orphan_entry
 
struct  _select_ns_entry
 

Macros

#define COBJMACROS
 
#define SAFETY_SUPPORTED_OPTIONS   (INTERFACESAFE_FOR_UNTRUSTED_CALLER|INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_SECURITY_MANAGER)
 

Typedefs

typedef struct ConnectionPoint ConnectionPoint
 
typedef struct domdoc domdoc
 
typedef struct _xmldoc_priv xmldoc_priv
 
typedef struct _orphan_entry orphan_entry
 
typedef struct _select_ns_entry select_ns_entry
 

Enumerations

enum  eventid_t {
  EVENTID_ABORT , EVENTID_BEFOREUNLOAD , EVENTID_BLUR , EVENTID_CHANGE ,
  EVENTID_CLICK , EVENTID_CONTEXTMENU , EVENTID_DATAAVAILABLE , EVENTID_DBLCLICK ,
  EVENTID_DRAG , EVENTID_DRAGSTART , EVENTID_ERROR , EVENTID_FOCUS ,
  EVENTID_FOCUSIN , EVENTID_HELP , EVENTID_KEYDOWN , EVENTID_KEYPRESS ,
  EVENTID_KEYUP , EVENTID_LOAD , EVENTID_MOUSEDOWN , EVENTID_MOUSEMOVE ,
  EVENTID_MOUSEOUT , EVENTID_MOUSEOVER , EVENTID_MOUSEUP , EVENTID_MOUSEWHEEL ,
  EVENTID_PASTE , EVENTID_READYSTATECHANGE , EVENTID_RESIZE , EVENTID_SCROLL ,
  EVENTID_SELECTSTART , EVENTID_SUBMIT , EVENTID_LAST , EVENTID_READYSTATECHANGE = 0 ,
  EVENTID_DATAAVAILABLE , EVENTID_TRANSFORMNODE , EVENTID_LAST
}
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msxml)
 
static HRESULT set_doc_event (domdoc *doc, eventid_t eid, const VARIANT *v)
 
static ConnectionPointimpl_from_IConnectionPoint (IConnectionPoint *iface)
 
static xmldoc_privpriv_from_xmlDocPtr (const xmlDocPtr doc)
 
static domdoc_propertiesproperties_from_xmlDocPtr (xmlDocPtr doc)
 
BOOL is_xpathmode (const xmlDocPtr doc)
 
void set_xpathmode (xmlDocPtr doc, BOOL xpath)
 
int registerNamespaces (xmlXPathContextPtr ctxt)
 
static void clear_selectNsList (struct list *pNsList)
 
static xmldoc_privcreate_priv (void)
 
static domdoc_propertiescreate_properties (MSXML_VERSION version)
 
static domdoc_propertiescopy_properties (domdoc_properties const *properties)
 
static domdoc_propertiesproperties_add_ref (domdoc_properties *properties)
 
static void properties_release (domdoc_properties *properties)
 
static void release_namespaces (domdoc *This)
 
void xmldoc_link_xmldecl (xmlDocPtr doc, xmlNodePtr node)
 
xmlNodePtr xmldoc_unlink_xmldecl (xmlDocPtr doc)
 
MSXML_VERSION xmldoc_version (xmlDocPtr doc)
 
BOOL is_preserving_whitespace (xmlNodePtr node)
 
static BOOL strn_isspace (xmlChar const *str, int len)
 
static void sax_characters (void *ctx, const xmlChar *ch, int len)
 
static void LIBXML2_LOG_CALLBACK sax_error (void *ctx, char const *msg,...)
 
static void LIBXML2_LOG_CALLBACK sax_warning (void *ctx, char const *msg,...)
 
static void sax_serror (void *ctx, const xmlError *err)
 
static xmlDocPtr doparse (domdoc *This, char const *ptr, int len, xmlCharEncoding encoding)
 
void xmldoc_init (xmlDocPtr doc, MSXML_VERSION version)
 
LONG xmldoc_add_refs (xmlDocPtr doc, LONG refs)
 
LONG xmldoc_add_ref (xmlDocPtr doc)
 
LONG xmldoc_release_refs (xmlDocPtr doc, LONG refs)
 
LONG xmldoc_release (xmlDocPtr doc)
 
HRESULT xmldoc_add_orphan (xmlDocPtr doc, xmlNodePtr node)
 
HRESULT xmldoc_remove_orphan (xmlDocPtr doc, xmlNodePtr node)
 
static xmlDocPtr get_doc (domdoc *This)
 
static HRESULT attach_xmldoc (domdoc *This, xmlDocPtr xml)
 
static domdocimpl_from_IXMLDOMDocument3 (IXMLDOMDocument3 *iface)
 
static domdocimpl_from_IPersistStreamInit (IPersistStreamInit *iface)
 
static domdocimpl_from_IObjectWithSite (IObjectWithSite *iface)
 
static domdocimpl_from_IObjectSafety (IObjectSafety *iface)
 
static domdocimpl_from_IConnectionPointContainer (IConnectionPointContainer *iface)
 
static HRESULT WINAPI PersistStreamInit_QueryInterface (IPersistStreamInit *iface, REFIID riid, void **ppvObj)
 
static ULONG WINAPI PersistStreamInit_AddRef (IPersistStreamInit *iface)
 
static ULONG WINAPI PersistStreamInit_Release (IPersistStreamInit *iface)
 
static HRESULT WINAPI PersistStreamInit_GetClassID (IPersistStreamInit *iface, CLSID *classid)
 
static HRESULT WINAPI PersistStreamInit_IsDirty (IPersistStreamInit *iface)
 
static HRESULT domdoc_load_from_stream (domdoc *doc, ISequentialStream *stream)
 
static HRESULT WINAPI PersistStreamInit_Load (IPersistStreamInit *iface, IStream *stream)
 
static HRESULT WINAPI PersistStreamInit_Save (IPersistStreamInit *iface, IStream *stream, BOOL clr_dirty)
 
static HRESULT WINAPI PersistStreamInit_GetSizeMax (IPersistStreamInit *iface, ULARGE_INTEGER *pcbSize)
 
static HRESULT WINAPI PersistStreamInit_InitNew (IPersistStreamInit *iface)
 
static HRESULT WINAPI domdoc_QueryInterface (IXMLDOMDocument3 *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI domdoc_AddRef (IXMLDOMDocument3 *iface)
 
static ULONG WINAPI domdoc_Release (IXMLDOMDocument3 *iface)
 
static HRESULT WINAPI domdoc_GetTypeInfoCount (IXMLDOMDocument3 *iface, UINT *pctinfo)
 
static HRESULT WINAPI domdoc_GetTypeInfo (IXMLDOMDocument3 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI domdoc_GetIDsOfNames (IXMLDOMDocument3 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI domdoc_Invoke (IXMLDOMDocument3 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI domdoc_get_nodeName (IXMLDOMDocument3 *iface, BSTR *name)
 
static HRESULT WINAPI domdoc_get_nodeValue (IXMLDOMDocument3 *iface, VARIANT *value)
 
static HRESULT WINAPI domdoc_put_nodeValue (IXMLDOMDocument3 *iface, VARIANT value)
 
static HRESULT WINAPI domdoc_get_nodeType (IXMLDOMDocument3 *iface, DOMNodeType *type)
 
static HRESULT WINAPI domdoc_get_parentNode (IXMLDOMDocument3 *iface, IXMLDOMNode **parent)
 
static HRESULT WINAPI domdoc_get_childNodes (IXMLDOMDocument3 *iface, IXMLDOMNodeList **childList)
 
static HRESULT WINAPI domdoc_get_firstChild (IXMLDOMDocument3 *iface, IXMLDOMNode **firstChild)
 
static HRESULT WINAPI domdoc_get_lastChild (IXMLDOMDocument3 *iface, IXMLDOMNode **lastChild)
 
static HRESULT WINAPI domdoc_get_previousSibling (IXMLDOMDocument3 *iface, IXMLDOMNode **previousSibling)
 
static HRESULT WINAPI domdoc_get_nextSibling (IXMLDOMDocument3 *iface, IXMLDOMNode **nextSibling)
 
static HRESULT WINAPI domdoc_get_attributes (IXMLDOMDocument3 *iface, IXMLDOMNamedNodeMap **attributeMap)
 
static HRESULT WINAPI domdoc_insertBefore (IXMLDOMDocument3 *iface, IXMLDOMNode *newChild, VARIANT refChild, IXMLDOMNode **outNewChild)
 
static HRESULT WINAPI domdoc_replaceChild (IXMLDOMDocument3 *iface, IXMLDOMNode *newChild, IXMLDOMNode *oldChild, IXMLDOMNode **outOldChild)
 
static HRESULT WINAPI domdoc_removeChild (IXMLDOMDocument3 *iface, IXMLDOMNode *child, IXMLDOMNode **oldChild)
 
static HRESULT WINAPI domdoc_appendChild (IXMLDOMDocument3 *iface, IXMLDOMNode *child, IXMLDOMNode **outChild)
 
static HRESULT WINAPI domdoc_hasChildNodes (IXMLDOMDocument3 *iface, VARIANT_BOOL *ret)
 
static HRESULT WINAPI domdoc_get_ownerDocument (IXMLDOMDocument3 *iface, IXMLDOMDocument **doc)
 
static HRESULT WINAPI domdoc_cloneNode (IXMLDOMDocument3 *iface, VARIANT_BOOL deep, IXMLDOMNode **outNode)
 
static HRESULT WINAPI domdoc_get_nodeTypeString (IXMLDOMDocument3 *iface, BSTR *p)
 
static HRESULT WINAPI domdoc_get_text (IXMLDOMDocument3 *iface, BSTR *p)
 
static HRESULT WINAPI domdoc_put_text (IXMLDOMDocument3 *iface, BSTR text)
 
static HRESULT WINAPI domdoc_get_specified (IXMLDOMDocument3 *iface, VARIANT_BOOL *isSpecified)
 
static HRESULT WINAPI domdoc_get_definition (IXMLDOMDocument3 *iface, IXMLDOMNode **definitionNode)
 
static HRESULT WINAPI domdoc_get_nodeTypedValue (IXMLDOMDocument3 *iface, VARIANT *v)
 
static HRESULT WINAPI domdoc_put_nodeTypedValue (IXMLDOMDocument3 *iface, VARIANT typedValue)
 
static HRESULT WINAPI domdoc_get_dataType (IXMLDOMDocument3 *iface, VARIANT *typename)
 
static HRESULT WINAPI domdoc_put_dataType (IXMLDOMDocument3 *iface, BSTR dataTypeName)
 
static int XMLCALL domdoc_get_xml_writecallback (void *ctx, const char *data, int len)
 
static HRESULT WINAPI domdoc_get_xml (IXMLDOMDocument3 *iface, BSTR *p)
 
static HRESULT WINAPI domdoc_transformNode (IXMLDOMDocument3 *iface, IXMLDOMNode *node, BSTR *p)
 
static HRESULT WINAPI domdoc_selectNodes (IXMLDOMDocument3 *iface, BSTR p, IXMLDOMNodeList **outList)
 
static HRESULT WINAPI domdoc_selectSingleNode (IXMLDOMDocument3 *iface, BSTR p, IXMLDOMNode **outNode)
 
static HRESULT WINAPI domdoc_get_parsed (IXMLDOMDocument3 *iface, VARIANT_BOOL *isParsed)
 
static HRESULT WINAPI domdoc_get_namespaceURI (IXMLDOMDocument3 *iface, BSTR *namespaceURI)
 
static HRESULT WINAPI domdoc_get_prefix (IXMLDOMDocument3 *iface, BSTR *prefix)
 
static HRESULT WINAPI domdoc_get_baseName (IXMLDOMDocument3 *iface, BSTR *name)
 
static HRESULT WINAPI domdoc_transformNodeToObject (IXMLDOMDocument3 *iface, IXMLDOMNode *stylesheet, VARIANT output)
 
static HRESULT WINAPI domdoc_get_doctype (IXMLDOMDocument3 *iface, IXMLDOMDocumentType **doctype)
 
static HRESULT WINAPI domdoc_get_implementation (IXMLDOMDocument3 *iface, IXMLDOMImplementation **impl)
 
static HRESULT WINAPI domdoc_get_documentElement (IXMLDOMDocument3 *iface, IXMLDOMElement **DOMElement)
 
static HRESULT WINAPI domdoc_put_documentElement (IXMLDOMDocument3 *iface, IXMLDOMElement *DOMElement)
 
static HRESULT WINAPI domdoc_createElement (IXMLDOMDocument3 *iface, BSTR tagname, IXMLDOMElement **element)
 
static HRESULT WINAPI domdoc_createDocumentFragment (IXMLDOMDocument3 *iface, IXMLDOMDocumentFragment **frag)
 
static HRESULT WINAPI domdoc_createTextNode (IXMLDOMDocument3 *iface, BSTR data, IXMLDOMText **text)
 
static HRESULT WINAPI domdoc_createComment (IXMLDOMDocument3 *iface, BSTR data, IXMLDOMComment **comment)
 
static HRESULT WINAPI domdoc_createCDATASection (IXMLDOMDocument3 *iface, BSTR data, IXMLDOMCDATASection **cdata)
 
static HRESULT WINAPI domdoc_createProcessingInstruction (IXMLDOMDocument3 *iface, BSTR target, BSTR data, IXMLDOMProcessingInstruction **pi)
 
static HRESULT WINAPI domdoc_createAttribute (IXMLDOMDocument3 *iface, BSTR name, IXMLDOMAttribute **attribute)
 
static HRESULT WINAPI domdoc_createEntityReference (IXMLDOMDocument3 *iface, BSTR name, IXMLDOMEntityReference **entityref)
 
xmlChartagName_to_XPath (const BSTR tagName)
 
static HRESULT WINAPI domdoc_getElementsByTagName (IXMLDOMDocument3 *iface, BSTR tagName, IXMLDOMNodeList **resultList)
 
static HRESULT get_node_type (VARIANT Type, DOMNodeType *type)
 
static HRESULT WINAPI domdoc_createNode (IXMLDOMDocument3 *iface, VARIANT Type, BSTR name, BSTR namespaceURI, IXMLDOMNode **node)
 
static HRESULT WINAPI domdoc_nodeFromID (IXMLDOMDocument3 *iface, BSTR idString, IXMLDOMNode **node)
 
static HRESULT domdoc_onDataAvailable (void *obj, char *ptr, DWORD len)
 
static HRESULT domdoc_load_moniker (domdoc *This, IMoniker *mon)
 
static HRESULT WINAPI domdoc_load (IXMLDOMDocument3 *iface, VARIANT source, VARIANT_BOOL *isSuccessful)
 
static HRESULT WINAPI domdoc_get_readyState (IXMLDOMDocument3 *iface, LONG *value)
 
static HRESULT WINAPI domdoc_get_parseError (IXMLDOMDocument3 *iface, IXMLDOMParseError **errorObj)
 
static HRESULT WINAPI domdoc_get_url (IXMLDOMDocument3 *iface, BSTR *url)
 
static HRESULT WINAPI domdoc_get_async (IXMLDOMDocument3 *iface, VARIANT_BOOL *isAsync)
 
static HRESULT WINAPI domdoc_put_async (IXMLDOMDocument3 *iface, VARIANT_BOOL isAsync)
 
static HRESULT WINAPI domdoc_abort (IXMLDOMDocument3 *iface)
 
static HRESULT WINAPI domdoc_loadXML (IXMLDOMDocument3 *iface, BSTR data, VARIANT_BOOL *isSuccessful)
 
static int XMLCALL domdoc_save_writecallback (void *ctx, const char *buffer, int len)
 
static int XMLCALL domdoc_save_closecallback (void *ctx)
 
static int XMLCALL domdoc_stream_save_writecallback (void *ctx, const char *buffer, int len)
 
static int XMLCALL domdoc_stream_save_closecallback (void *ctx)
 
static charxmldoc_encoding (IXMLDOMDocument3 *doc)
 
static HRESULT WINAPI domdoc_save (IXMLDOMDocument3 *iface, VARIANT destination)
 
static HRESULT WINAPI domdoc_get_validateOnParse (IXMLDOMDocument3 *iface, VARIANT_BOOL *isValidating)
 
static HRESULT WINAPI domdoc_put_validateOnParse (IXMLDOMDocument3 *iface, VARIANT_BOOL isValidating)
 
static HRESULT WINAPI domdoc_get_resolveExternals (IXMLDOMDocument3 *iface, VARIANT_BOOL *isResolving)
 
static HRESULT WINAPI domdoc_put_resolveExternals (IXMLDOMDocument3 *iface, VARIANT_BOOL isResolving)
 
static HRESULT WINAPI domdoc_get_preserveWhiteSpace (IXMLDOMDocument3 *iface, VARIANT_BOOL *isPreserving)
 
static HRESULT WINAPI domdoc_put_preserveWhiteSpace (IXMLDOMDocument3 *iface, VARIANT_BOOL isPreserving)
 
static HRESULT WINAPI domdoc_put_onreadystatechange (IXMLDOMDocument3 *iface, VARIANT event)
 
static HRESULT WINAPI domdoc_put_onDataAvailable (IXMLDOMDocument3 *iface, VARIANT sink)
 
static HRESULT WINAPI domdoc_put_onTransformNode (IXMLDOMDocument3 *iface, VARIANT sink)
 
static HRESULT WINAPI domdoc_get_namespaces (IXMLDOMDocument3 *iface, IXMLDOMSchemaCollection **collection)
 
static HRESULT WINAPI domdoc_get_schemas (IXMLDOMDocument3 *iface, VARIANT *schema)
 
static HRESULT WINAPI domdoc_putref_schemas (IXMLDOMDocument3 *iface, VARIANT schema)
 
static BOOL is_wellformed (xmlDocPtr doc)
 
static void LIBXML2_LOG_CALLBACK validate_error (void *ctx, char const *msg,...)
 
static void LIBXML2_LOG_CALLBACK validate_warning (void *ctx, char const *msg,...)
 
static HRESULT WINAPI domdoc_validateNode (IXMLDOMDocument3 *iface, IXMLDOMNode *node, IXMLDOMParseError **err)
 
static HRESULT WINAPI domdoc_validate (IXMLDOMDocument3 *iface, IXMLDOMParseError **err)
 
static HRESULT WINAPI domdoc_setProperty (IXMLDOMDocument3 *iface, BSTR p, VARIANT value)
 
static HRESULT WINAPI domdoc_getProperty (IXMLDOMDocument3 *iface, BSTR p, VARIANT *var)
 
static HRESULT WINAPI domdoc_importNode (IXMLDOMDocument3 *iface, IXMLDOMNode *node, VARIANT_BOOL deep, IXMLDOMNode **clone)
 
static HRESULT WINAPI ConnectionPointContainer_QueryInterface (IConnectionPointContainer *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ConnectionPointContainer_AddRef (IConnectionPointContainer *iface)
 
static ULONG WINAPI ConnectionPointContainer_Release (IConnectionPointContainer *iface)
 
static HRESULT WINAPI ConnectionPointContainer_EnumConnectionPoints (IConnectionPointContainer *iface, IEnumConnectionPoints **ppEnum)
 
static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint (IConnectionPointContainer *iface, REFIID riid, IConnectionPoint **cp)
 
static HRESULT WINAPI ConnectionPoint_QueryInterface (IConnectionPoint *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ConnectionPoint_AddRef (IConnectionPoint *iface)
 
static ULONG WINAPI ConnectionPoint_Release (IConnectionPoint *iface)
 
static HRESULT WINAPI ConnectionPoint_GetConnectionInterface (IConnectionPoint *iface, IID *iid)
 
static HRESULT WINAPI ConnectionPoint_GetConnectionPointContainer (IConnectionPoint *iface, IConnectionPointContainer **container)
 
static HRESULT WINAPI ConnectionPoint_Advise (IConnectionPoint *iface, IUnknown *unk_sink, DWORD *cookie)
 
static HRESULT WINAPI ConnectionPoint_Unadvise (IConnectionPoint *iface, DWORD cookie)
 
static HRESULT WINAPI ConnectionPoint_EnumConnections (IConnectionPoint *iface, IEnumConnections **ppEnum)
 
static void ConnectionPoint_Init (ConnectionPoint *cp, struct domdoc *doc, REFIID riid)
 
static HRESULT WINAPI domdoc_ObjectWithSite_QueryInterface (IObjectWithSite *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI domdoc_ObjectWithSite_AddRef (IObjectWithSite *iface)
 
static ULONG WINAPI domdoc_ObjectWithSite_Release (IObjectWithSite *iface)
 
static HRESULT WINAPI domdoc_ObjectWithSite_GetSite (IObjectWithSite *iface, REFIID iid, void **ppvSite)
 
static HRESULT WINAPI domdoc_ObjectWithSite_SetSite (IObjectWithSite *iface, IUnknown *punk)
 
static HRESULT WINAPI domdoc_Safety_QueryInterface (IObjectSafety *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI domdoc_Safety_AddRef (IObjectSafety *iface)
 
static ULONG WINAPI domdoc_Safety_Release (IObjectSafety *iface)
 
static HRESULT WINAPI domdoc_Safety_GetInterfaceSafetyOptions (IObjectSafety *iface, REFIID riid, DWORD *supported, DWORD *enabled)
 
static HRESULT WINAPI domdoc_Safety_SetInterfaceSafetyOptions (IObjectSafety *iface, REFIID riid, DWORD mask, DWORD enabled)
 
HRESULT get_domdoc_from_xmldoc (xmlDocPtr xmldoc, IXMLDOMDocument3 **document)
 
HRESULT dom_document_create (MSXML_VERSION version, void **ppObj)
 
IUnknowncreate_domdoc (xmlNodePtr document)
 

Variables

static const WCHAR PropertySelectionLanguageW [] = {'S','e','l','e','c','t','i','o','n','L','a','n','g','u','a','g','e',0}
 
static const WCHAR PropertySelectionNamespacesW [] = {'S','e','l','e','c','t','i','o','n','N','a','m','e','s','p','a','c','e','s',0}
 
static const WCHAR PropertyProhibitDTDW [] = {'P','r','o','h','i','b','i','t','D','T','D',0}
 
static const WCHAR PropertyNewParserW [] = {'N','e','w','P','a','r','s','e','r',0}
 
static const WCHAR PropValueXPathW [] = {'X','P','a','t','h',0}
 
static const WCHAR PropValueXSLPatternW [] = {'X','S','L','P','a','t','t','e','r','n',0}
 
static const WCHAR PropertyResolveExternalsW [] = {'R','e','s','o','l','v','e','E','x','t','e','r','n','a','l','s',0}
 
static const WCHAR PropertyAllowXsltScriptW [] = {'A','l','l','o','w','X','s','l','t','S','c','r','i','p','t',0}
 
static const WCHAR PropertyAllowDocumentFunctionW [] = {'A','l','l','o','w','D','o','c','u','m','e','n','t','F','u','n','c','t','i','o','n',0}
 
static const WCHAR PropertyNormalizeAttributeValuesW [] = {'N','o','r','m','a','l','i','z','e','A','t','t','r','i','b','u','t','e','V','a','l','u','e','s',0}
 
static const WCHAR PropertyValidateOnParse [] = L"ValidateOnParse"
 
static const WCHAR PropertyMaxElementDepth [] = L"MaxElementDepth"
 
static const IPersistStreamInitVtbl xmldoc_IPersistStreamInit_VTable
 
static const tid_t domdoc_se_tids []
 
static const struct IXMLDOMDocument3Vtbl XMLDOMDocument3Vtbl
 
static const struct IConnectionPointContainerVtbl ConnectionPointContainerVtbl
 
static const IConnectionPointVtbl ConnectionPointVtbl
 
static const IObjectWithSiteVtbl domdocObjectSite
 
static const IObjectSafetyVtbl domdocObjectSafetyVtbl
 
static const tid_t domdoc_iface_tids []
 
static dispex_static_data_t domdoc_dispex
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 22 of file domdoc.c.

◆ SAFETY_SUPPORTED_OPTIONS

#define SAFETY_SUPPORTED_OPTIONS   (INTERFACESAFE_FOR_UNTRUSTED_CALLER|INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_SECURITY_MANAGER)

Definition at line 3695 of file domdoc.c.

Typedef Documentation

◆ ConnectionPoint

Definition at line 82 of file domdoc.c.

◆ domdoc

typedef struct domdoc domdoc

Definition at line 83 of file domdoc.c.

◆ orphan_entry

◆ select_ns_entry

◆ xmldoc_priv

Enumeration Type Documentation

◆ eventid_t

Enumerator
EVENTID_ABORT 
EVENTID_BEFOREUNLOAD 
EVENTID_BLUR 
EVENTID_CHANGE 
EVENTID_CLICK 
EVENTID_CONTEXTMENU 
EVENTID_DATAAVAILABLE 
EVENTID_DBLCLICK 
EVENTID_DRAG 
EVENTID_DRAGSTART 
EVENTID_ERROR 
EVENTID_FOCUS 
EVENTID_FOCUSIN 
EVENTID_HELP 
EVENTID_KEYDOWN 
EVENTID_KEYPRESS 
EVENTID_KEYUP 
EVENTID_LOAD 
EVENTID_MOUSEDOWN 
EVENTID_MOUSEMOVE 
EVENTID_MOUSEOUT 
EVENTID_MOUSEOVER 
EVENTID_MOUSEUP 
EVENTID_MOUSEWHEEL 
EVENTID_PASTE 
EVENTID_READYSTATECHANGE 
EVENTID_RESIZE 
EVENTID_SCROLL 
EVENTID_SELECTSTART 
EVENTID_SUBMIT 
EVENTID_LAST 
EVENTID_READYSTATECHANGE 
EVENTID_DATAAVAILABLE 
EVENTID_TRANSFORMNODE 
EVENTID_LAST 

Definition at line 103 of file domdoc.c.

103 {
108} eventid_t;
eventid_t
Definition: domdoc.c:103
@ EVENTID_TRANSFORMNODE
Definition: domdoc.c:106
@ EVENTID_DATAAVAILABLE
Definition: domdoc.c:105
@ EVENTID_LAST
Definition: domdoc.c:107
@ EVENTID_READYSTATECHANGE
Definition: domdoc.c:104

Function Documentation

◆ attach_xmldoc()

static HRESULT attach_xmldoc ( domdoc This,
xmlDocPtr  xml 
)
static

Definition at line 695 of file domdoc.c.

696{
698
699 if(This->node.node)
700 {
703 if (xmldoc_release(get_doc(This)) != 0)
704 {
705 /* The xmlDocPtr object can no longer use the properties of this
706 * domdoc object. So give it its own copy.
707 */
709 copy_properties(This->properties);
710 }
711 }
712
713 This->node.node = (xmlNodePtr) xml;
714
715 if(This->node.node)
716 {
718 /* Only attach new xmlDocPtr objects, i.e. ones for which properties
719 * is still NULL.
720 */
722 }
723
724 return S_OK;
725}
#define NULL
Definition: types.h:112
static domdoc_properties * properties_from_xmlDocPtr(xmlDocPtr doc)
Definition: domdoc.c:220
static xmlDocPtr get_doc(domdoc *This)
Definition: domdoc.c:690
static void properties_release(domdoc_properties *properties)
Definition: domdoc.c:351
LONG xmldoc_release(xmlDocPtr doc)
Definition: domdoc.c:653
static domdoc_properties * copy_properties(domdoc_properties const *properties)
Definition: domdoc.c:299
LONG xmldoc_add_ref(xmlDocPtr doc)
Definition: domdoc.c:619
static void release_namespaces(domdoc *This)
Definition: domdoc.c:376
static xmldoc_priv * priv_from_xmlDocPtr(const xmlDocPtr doc)
Definition: domdoc.c:215
static domdoc_properties * properties_add_ref(domdoc_properties *properties)
Definition: domdoc.c:340
#define S_OK
Definition: intsafe.h:52
domdoc_properties * properties
Definition: domdoc.c:199

Referenced by domdoc_load(), domdoc_load_from_stream(), domdoc_loadXML(), and domdoc_onDataAvailable().

◆ clear_selectNsList()

static void clear_selectNsList ( struct list pNsList)
inlinestatic

Definition at line 252 of file domdoc.c.

253{
254 select_ns_entry *ns, *ns2;
256 {
257 free(ns);
258 }
259 list_init(pNsList);
260}
static void list_init(struct list_entry *head)
Definition: list.h:51
#define free
Definition: debug_ros.c:5
uint32_t entry
Definition: isohybrid.c:63
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
Definition: domdoc.c:207
Definition: mxnamespace.c:38

Referenced by domdoc_setProperty(), and properties_release().

◆ ConnectionPoint_AddRef()

static ULONG WINAPI ConnectionPoint_AddRef ( IConnectionPoint iface)
static

Definition at line 3476 of file domdoc.c.

3477{
3479 return IConnectionPointContainer_AddRef(This->container);
3480}
static ConnectionPoint * impl_from_IConnectionPoint(IConnectionPoint *iface)
Definition: domdoc.c:169

◆ ConnectionPoint_Advise()

static HRESULT WINAPI ConnectionPoint_Advise ( IConnectionPoint iface,
IUnknown unk_sink,
DWORD cookie 
)
static

Definition at line 3514 of file domdoc.c.

3516{
3518 IUnknown *sink;
3519 HRESULT hr;
3520 DWORD i;
3521
3522 TRACE("(%p)->(%p %p)\n", This, unk_sink, cookie);
3523
3524 hr = IUnknown_QueryInterface(unk_sink, This->iid, (void**)&sink);
3526 hr = IUnknown_QueryInterface(unk_sink, &IID_IDispatch, (void**)&sink);
3527 if(FAILED(hr))
3529
3530 if(This->sinks)
3531 {
3532 for (i = 0; i < This->sinks_size; i++)
3533 if (!This->sinks[i].unk)
3534 break;
3535
3536 if (i == This->sinks_size)
3537 This->sinks = realloc(This->sinks, (++This->sinks_size) * sizeof(*This->sinks));
3538 }
3539 else
3540 {
3541 This->sinks = malloc(sizeof(*This->sinks));
3542 This->sinks_size = 1;
3543 i = 0;
3544 }
3545
3546 This->sinks[i].unk = sink;
3547 if (cookie)
3548 *cookie = i+1;
3549
3550 return S_OK;
3551}
#define realloc
Definition: debug_ros.c:6
#define malloc
Definition: debug_ros.c:4
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizei GLenum GLboolean sink
Definition: glext.h:5672
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FAILED(hr)
Definition: intsafe.h:51
#define CONNECT_E_CANNOTCONNECT
Definition: olectl.h:253
const GUID IID_IPropertyNotifySink
const GUID IID_IDispatch
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
Definition: cookie.c:34

◆ ConnectionPoint_EnumConnections()

static HRESULT WINAPI ConnectionPoint_EnumConnections ( IConnectionPoint iface,
IEnumConnections **  ppEnum 
)
static

Definition at line 3568 of file domdoc.c.

3570{
3572 FIXME("(%p)->(%p): stub\n", This, ppEnum);
3573 return E_NOTIMPL;
3574}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ConnectionPoint_GetConnectionInterface()

static HRESULT WINAPI ConnectionPoint_GetConnectionInterface ( IConnectionPoint iface,
IID iid 
)
static

Definition at line 3488 of file domdoc.c.

3489{
3491
3492 TRACE("(%p)->(%p)\n", This, iid);
3493
3494 if (!iid) return E_POINTER;
3495
3496 *iid = *This->iid;
3497 return S_OK;
3498}
#define E_POINTER
Definition: winerror.h:3480

◆ ConnectionPoint_GetConnectionPointContainer()

static HRESULT WINAPI ConnectionPoint_GetConnectionPointContainer ( IConnectionPoint iface,
IConnectionPointContainer **  container 
)
static

Definition at line 3500 of file domdoc.c.

3502{
3504
3505 TRACE("(%p)->(%p)\n", This, container);
3506
3507 if (!container) return E_POINTER;
3508
3509 *container = This->container;
3510 IConnectionPointContainer_AddRef(*container);
3511 return S_OK;
3512}

◆ ConnectionPoint_Init()

static void ConnectionPoint_Init ( ConnectionPoint cp,
struct domdoc doc,
REFIID  riid 
)
static

Definition at line 3588 of file domdoc.c.

3589{
3590 cp->IConnectionPoint_iface.lpVtbl = &ConnectionPointVtbl;
3591 cp->doc = doc;
3592 cp->iid = riid;
3593 cp->sinks = NULL;
3594 cp->sinks_size = 0;
3595
3596 cp->next = doc->cp_list;
3597 doc->cp_list = cp;
3598
3599 cp->container = &doc->IConnectionPointContainer_iface;
3600}
static const IConnectionPointVtbl ConnectionPointVtbl
Definition: domdoc.c:3576
REFIID riid
Definition: atlbase.h:39
POINT cp
Definition: magnifier.c:59
ConnectionPoint * cp_list
Definition: domdoc.c:132
IConnectionPointContainer IConnectionPointContainer_iface
Definition: domdoc.c:117

Referenced by get_domdoc_from_xmldoc().

◆ ConnectionPoint_QueryInterface()

static HRESULT WINAPI ConnectionPoint_QueryInterface ( IConnectionPoint iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 3451 of file domdoc.c.

3453{
3455
3456 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv );
3457
3458 *ppv = NULL;
3459
3460 if (IsEqualGUID(&IID_IUnknown, riid) ||
3462 {
3463 *ppv = iface;
3464 }
3465
3466 if (*ppv)
3467 {
3468 IConnectionPoint_AddRef(iface);
3469 return S_OK;
3470 }
3471
3472 WARN("Unsupported interface %s\n", debugstr_guid(riid));
3473 return E_NOINTERFACE;
3474}
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
const GUID IID_IConnectionPoint
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ ConnectionPoint_Release()

static ULONG WINAPI ConnectionPoint_Release ( IConnectionPoint iface)
static

Definition at line 3482 of file domdoc.c.

3483{
3485 return IConnectionPointContainer_Release(This->container);
3486}

◆ ConnectionPoint_Unadvise()

static HRESULT WINAPI ConnectionPoint_Unadvise ( IConnectionPoint iface,
DWORD  cookie 
)
static

Definition at line 3553 of file domdoc.c.

3554{
3556
3557 TRACE("%p, %ld.\n", iface, cookie);
3558
3559 if (cookie == 0 || cookie > This->sinks_size || !This->sinks[cookie-1].unk)
3561
3562 IUnknown_Release(This->sinks[cookie-1].unk);
3563 This->sinks[cookie-1].unk = NULL;
3564
3565 return S_OK;
3566}
#define CONNECT_E_NOCONNECTION
Definition: olectl.h:251

◆ ConnectionPointContainer_AddRef()

static ULONG WINAPI ConnectionPointContainer_AddRef ( IConnectionPointContainer iface)
static

Definition at line 3394 of file domdoc.c.

3395{
3397 return IXMLDOMDocument3_AddRef(&This->IXMLDOMDocument3_iface);
3398}
static domdoc * impl_from_IConnectionPointContainer(IConnectionPointContainer *iface)
Definition: domdoc.c:747
Definition: domdoc.c:111

◆ ConnectionPointContainer_EnumConnectionPoints()

static HRESULT WINAPI ConnectionPointContainer_EnumConnectionPoints ( IConnectionPointContainer iface,
IEnumConnectionPoints **  ppEnum 
)
static

Definition at line 3406 of file domdoc.c.

3408{
3410 FIXME("(%p)->(%p): stub\n", This, ppEnum);
3411 return E_NOTIMPL;
3412}

◆ ConnectionPointContainer_FindConnectionPoint()

static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint ( IConnectionPointContainer iface,
REFIID  riid,
IConnectionPoint **  cp 
)
static

Definition at line 3414 of file domdoc.c.

3416{
3418 ConnectionPoint *iter;
3419
3420 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), cp);
3421
3422 *cp = NULL;
3423
3424 for(iter = This->cp_list; iter; iter = iter->next)
3425 {
3426 if (IsEqualGUID(iter->iid, riid))
3427 *cp = &iter->IConnectionPoint_iface;
3428 }
3429
3430 if (*cp)
3431 {
3432 IConnectionPoint_AddRef(*cp);
3433 return S_OK;
3434 }
3435
3436 FIXME("unsupported riid %s\n", debugstr_guid(riid));
3438
3439}
IConnectionPoint IConnectionPoint_iface
Definition: events.c:34
ConnectionPoint * next
Definition: domdoc.c:90

◆ ConnectionPointContainer_QueryInterface()

static HRESULT WINAPI ConnectionPointContainer_QueryInterface ( IConnectionPointContainer iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 3387 of file domdoc.c.

3389{
3391 return IXMLDOMDocument3_QueryInterface(&This->IXMLDOMDocument3_iface, riid, ppv);
3392}

◆ ConnectionPointContainer_Release()

static ULONG WINAPI ConnectionPointContainer_Release ( IConnectionPointContainer iface)
static

Definition at line 3400 of file domdoc.c.

3401{
3403 return IXMLDOMDocument3_Release(&This->IXMLDOMDocument3_iface);
3404}

◆ copy_properties()

static domdoc_properties * copy_properties ( domdoc_properties const properties)
static

Definition at line 299 of file domdoc.c.

300{
302 select_ns_entry const* ns = NULL;
303 select_ns_entry* new_ns = NULL;
304 int len = (properties->selectNsStr_len+1)*sizeof(xmlChar);
306
307 if (pcopy)
308 {
309 pcopy->refs = 1;
310 pcopy->version = properties->version;
311 pcopy->preserving = properties->preserving;
312 pcopy->validating = properties->validating;
313 pcopy->schemaCache = properties->schemaCache;
314 if (pcopy->schemaCache)
315 IXMLDOMSchemaCollection2_AddRef(pcopy->schemaCache);
316 pcopy->XPath = properties->XPath;
317 pcopy->selectNsStr_len = properties->selectNsStr_len;
318 list_init( &pcopy->selectNsList );
319 pcopy->selectNsStr = malloc(len);
320 memcpy((xmlChar*)pcopy->selectNsStr, properties->selectNsStr, len);
321 offset = pcopy->selectNsStr - properties->selectNsStr;
322
323 LIST_FOR_EACH_ENTRY( ns, (&properties->selectNsList), select_ns_entry, entry )
324 {
325 new_ns = malloc(sizeof(select_ns_entry));
326 memcpy(new_ns, ns, sizeof(select_ns_entry));
327 new_ns->href += offset;
328 new_ns->prefix += offset;
329 list_add_tail(&pcopy->selectNsList, &new_ns->entry);
330 }
331
332 pcopy->uri = properties->uri;
333 if (pcopy->uri)
334 IUri_AddRef(pcopy->uri);
335 }
336
337 return pcopy;
338}
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
int ptrdiff_t
Definition: corecrt.h:194
GLintptr offset
Definition: glext.h:5920
GLenum GLsizei len
Definition: glext.h:6722
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
xmlChar const * href
Definition: domdoc.c:211
struct list entry
Definition: domdoc.c:208
xmlChar const * prefix
Definition: domdoc.c:209
IXMLDOMSchemaCollection2 * schemaCache
Definition: domdoc.c:74
VARIANT_BOOL validating
Definition: domdoc.c:73
MSXML_VERSION version
Definition: domdoc.c:71
LONG selectNsStr_len
Definition: domdoc.c:77
VARIANT_BOOL preserving
Definition: domdoc.c:72
xmlChar const * selectNsStr
Definition: domdoc.c:76
IUri * uri
Definition: domdoc.c:79
struct list selectNsList
Definition: domdoc.c:75
unsigned char xmlChar
Definition: xmlstring.h:28

Referenced by attach_xmldoc(), and domdoc_cloneNode().

◆ create_domdoc()

IUnknown * create_domdoc ( xmlNodePtr  document)

Definition at line 3813 of file domdoc.c.

3814{
3815 IUnknown *obj = NULL;
3816 HRESULT hr;
3817
3818 TRACE("(%p)\n", document);
3819
3820 hr = get_domdoc_from_xmldoc((xmlDocPtr)document, (IXMLDOMDocument3**)&obj);
3821 if (FAILED(hr))
3822 return NULL;
3823
3824 return obj;
3825}
HRESULT get_domdoc_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument3 **document)
Definition: domdoc.c:3749

Referenced by create_node(), domdoc_cloneNode(), and element_get_dt().

◆ create_priv()

static xmldoc_priv * create_priv ( void  )
static

Definition at line 262 of file domdoc.c.

263{
264 xmldoc_priv *priv;
265 priv = malloc(sizeof(*priv));
266
267 if (priv)
268 {
269 priv->refs = 0;
270 list_init( &priv->orphans );
271 priv->properties = NULL;
272 }
273
274 return priv;
275}
LONG refs
Definition: domdoc.c:197
struct list orphans
Definition: domdoc.c:198

Referenced by domdoc_cloneNode(), domdoc_load(), domdoc_load_from_stream(), domdoc_loadXML(), domdoc_onDataAvailable(), and xmldoc_init().

◆ create_properties()

static domdoc_properties * create_properties ( MSXML_VERSION  version)
static

Definition at line 277 of file domdoc.c.

278{
279 domdoc_properties *properties = malloc(sizeof(domdoc_properties));
280
281 properties->refs = 1;
282 list_init(&properties->selectNsList);
283 properties->preserving = VARIANT_FALSE;
284 properties->validating = VARIANT_TRUE;
285 properties->schemaCache = NULL;
286 properties->selectNsStr = calloc(1, sizeof(xmlChar));
287 properties->selectNsStr_len = 0;
288
289 /* properties that are dependent on object versions */
290 properties->version = version;
291 properties->XPath = (version == MSXML4 || version == MSXML6);
292
293 /* document uri */
294 properties->uri = NULL;
295
296 return properties;
297}
static const WCHAR version[]
Definition: asmname.c:66
@ MSXML4
Definition: msxml_dispex.h:32
@ MSXML6
Definition: msxml_dispex.h:33
#define calloc
Definition: rosglue.h:14

Referenced by xmldoc_init().

◆ dom_document_create()

HRESULT dom_document_create ( MSXML_VERSION  version,
void **  ppObj 
)

Definition at line 3788 of file domdoc.c.

3789{
3790 xmlDocPtr xmldoc;
3791 HRESULT hr;
3792
3793 TRACE("(%d, %p)\n", version, ppObj);
3794
3795 xmldoc = xmlNewDoc(NULL);
3796 if(!xmldoc)
3797 return E_OUTOFMEMORY;
3798
3800
3802 if(FAILED(hr))
3803 {
3805 free(xmldoc->_private);
3806 xmlFreeDoc(xmldoc);
3807 return hr;
3808 }
3809
3810 return hr;
3811}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
void xmldoc_init(xmlDocPtr doc, MSXML_VERSION version)
Definition: domdoc.c:606
struct _xmldoc xmldoc
Definition: xmldoc.c:49

Referenced by cache_entry_from_url(), DllGetClassObject(), handle_xml_load(), httprequest_get_responseXML(), schema_cache_add(), and xslprocessor_put_input().

◆ domdoc_abort()

static HRESULT WINAPI domdoc_abort ( IXMLDOMDocument3 iface)
static

Definition at line 2453 of file domdoc.c.

2455{
2457 FIXME("%p\n", This);
2458 return E_NOTIMPL;
2459}
static domdoc * impl_from_IXMLDOMDocument3(IXMLDOMDocument3 *iface)
Definition: domdoc.c:727

◆ domdoc_AddRef()

static ULONG WINAPI domdoc_AddRef ( IXMLDOMDocument3 iface)
static

Definition at line 978 of file domdoc.c.

979{
982 TRACE("%p, refcount %ld.\n", iface, ref);
983 return ref;
984}
#define InterlockedIncrement
Definition: armddk.h:53
LONG ref
Definition: domdoc.c:118
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

◆ domdoc_appendChild()

static HRESULT WINAPI domdoc_appendChild ( IXMLDOMDocument3 iface,
IXMLDOMNode child,
IXMLDOMNode **  outChild 
)
static

Definition at line 1250 of file domdoc.c.

1254{
1256 TRACE("(%p)->(%p %p)\n", This, child, outChild);
1257 return node_append_child(&This->node, child, outChild);
1258}
static HWND child
Definition: cursoricon.c:298
HRESULT node_append_child(xmlnode *, IXMLDOMNode *, IXMLDOMNode **)
Definition: node.c:639

◆ domdoc_cloneNode()

static HRESULT WINAPI domdoc_cloneNode ( IXMLDOMDocument3 iface,
VARIANT_BOOL  deep,
IXMLDOMNode **  outNode 
)
static

Definition at line 1281 of file domdoc.c.

1285{
1287 xmlNodePtr clone;
1288
1289 TRACE("(%p)->(%d %p)\n", This, deep, outNode);
1290
1291 if (!outNode)
1292 return E_INVALIDARG;
1293
1294 *outNode = NULL;
1295
1296 clone = xmlCopyNode((xmlNodePtr)get_doc(This), deep ? 1 : 2);
1297 if (!clone)
1298 return E_FAIL;
1299
1300 clone->doc->_private = create_priv();
1301 xmldoc_add_orphan(clone->doc, clone);
1302 xmldoc_add_ref(clone->doc);
1303
1304 priv_from_xmlDocPtr(clone->doc)->properties = copy_properties(This->properties);
1305 if (!(*outNode = (IXMLDOMNode*)create_domdoc(clone)))
1306 {
1307 xmldoc_release(clone->doc);
1308 return E_FAIL;
1309 }
1310
1311 return S_OK;
1312}
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_FAIL
Definition: ddrawi.h:102
IUnknown * create_domdoc(xmlNodePtr document)
Definition: domdoc.c:3813
static xmldoc_priv * create_priv(void)
Definition: domdoc.c:262
HRESULT xmldoc_add_orphan(xmlDocPtr doc, xmlNodePtr node)
Definition: domdoc.c:658

◆ domdoc_createAttribute()

static HRESULT WINAPI domdoc_createAttribute ( IXMLDOMDocument3 iface,
BSTR  name,
IXMLDOMAttribute **  attribute 
)
static

Definition at line 1898 of file domdoc.c.

1902{
1905 VARIANT type;
1906 HRESULT hr;
1907
1908 TRACE("(%p)->(%s %p)\n", This, debugstr_w(name), attribute);
1909
1910 if (!attribute || !name) return E_INVALIDARG;
1911
1912 V_VT(&type) = VT_I1;
1914
1915 hr = IXMLDOMDocument3_createNode(iface, type, name, NULL, &node);
1916 if (hr == S_OK)
1917 {
1918 IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMAttribute, (void**)attribute);
1919 IXMLDOMNode_Release(node);
1920 }
1921
1922 return hr;
1923}
@ VT_I1
Definition: compat.h:2310
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define debugstr_w
Definition: kernel32.h:32
@ NODE_ATTRIBUTE
Definition: msxml6.idl:114
#define V_I1(A)
Definition: oleauto.h:243
#define V_VT(A)
Definition: oleauto.h:211
Definition: name.c:39
Definition: dlist.c:348

◆ domdoc_createCDATASection()

static HRESULT WINAPI domdoc_createCDATASection ( IXMLDOMDocument3 iface,
BSTR  data,
IXMLDOMCDATASection **  cdata 
)
static

Definition at line 1833 of file domdoc.c.

1837{
1840 VARIANT type;
1841 HRESULT hr;
1842
1843 TRACE("(%p)->(%s %p)\n", This, debugstr_w(data), cdata);
1844
1845 if (!cdata) return E_INVALIDARG;
1846
1847 *cdata = NULL;
1848
1849 V_VT(&type) = VT_I1;
1851
1852 hr = IXMLDOMDocument3_createNode(iface, type, NULL, NULL, &node);
1853 if (hr == S_OK)
1854 {
1855 IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMCDATASection, (void**)cdata);
1856 IXMLDOMNode_Release(node);
1857 hr = IXMLDOMCDATASection_put_data(*cdata, data);
1858 }
1859
1860 return hr;
1861}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
@ NODE_CDATA_SECTION
Definition: msxml6.idl:116

◆ domdoc_createComment()

static HRESULT WINAPI domdoc_createComment ( IXMLDOMDocument3 iface,
BSTR  data,
IXMLDOMComment **  comment 
)
static

Definition at line 1802 of file domdoc.c.

1806{
1808 VARIANT type;
1809 HRESULT hr;
1811
1812 TRACE("(%p)->(%s %p)\n", This, debugstr_w(data), comment);
1813
1814 if (!comment) return E_INVALIDARG;
1815
1816 *comment = NULL;
1817
1818 V_VT(&type) = VT_I1;
1820
1821 hr = IXMLDOMDocument3_createNode(iface, type, NULL, NULL, &node);
1822 if (hr == S_OK)
1823 {
1824 IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMComment, (void**)comment);
1825 IXMLDOMNode_Release(node);
1826 hr = IXMLDOMComment_put_data(*comment, data);
1827 }
1828
1829 return hr;
1830}
#define comment(fmt, arg1)
Definition: rebar.c:847
@ NODE_COMMENT
Definition: msxml6.idl:120

◆ domdoc_createDocumentFragment()

static HRESULT WINAPI domdoc_createDocumentFragment ( IXMLDOMDocument3 iface,
IXMLDOMDocumentFragment **  frag 
)
static

Definition at line 1742 of file domdoc.c.

1745{
1748 VARIANT type;
1749 HRESULT hr;
1750
1751 TRACE("(%p)->(%p)\n", This, frag);
1752
1753 if (!frag) return E_INVALIDARG;
1754
1755 *frag = NULL;
1756
1757 V_VT(&type) = VT_I1;
1759
1760 hr = IXMLDOMDocument3_createNode(iface, type, NULL, NULL, &node);
1761 if (hr == S_OK)
1762 {
1763 IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMDocumentFragment, (void**)frag);
1764 IXMLDOMNode_Release(node);
1765 }
1766
1767 return hr;
1768}
@ NODE_DOCUMENT_FRAGMENT
Definition: msxml6.idl:123

◆ domdoc_createElement()

static HRESULT WINAPI domdoc_createElement ( IXMLDOMDocument3 iface,
BSTR  tagname,
IXMLDOMElement **  element 
)
static

Definition at line 1714 of file domdoc.c.

1718{
1721 VARIANT type;
1722 HRESULT hr;
1723
1724 TRACE("(%p)->(%s %p)\n", This, debugstr_w(tagname), element);
1725
1726 if (!element || !tagname) return E_INVALIDARG;
1727
1728 V_VT(&type) = VT_I1;
1730
1731 hr = IXMLDOMDocument3_createNode(iface, type, tagname, NULL, &node);
1732 if (hr == S_OK)
1733 {
1734 IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMElement, (void**)element);
1735 IXMLDOMNode_Release(node);
1736 }
1737
1738 return hr;
1739}
@ NODE_ELEMENT
Definition: msxml6.idl:113
static char tagname[200]
Definition: rgenstat.c:63

◆ domdoc_createEntityReference()

static HRESULT WINAPI domdoc_createEntityReference ( IXMLDOMDocument3 iface,
BSTR  name,
IXMLDOMEntityReference **  entityref 
)
static

Definition at line 1926 of file domdoc.c.

1930{
1933 VARIANT type;
1934 HRESULT hr;
1935
1936 TRACE("(%p)->(%s %p)\n", This, debugstr_w(name), entityref);
1937
1938 if (!entityref) return E_INVALIDARG;
1939
1940 *entityref = NULL;
1941
1942 V_VT(&type) = VT_I1;
1944
1945 hr = IXMLDOMDocument3_createNode(iface, type, name, NULL, &node);
1946 if (hr == S_OK)
1947 {
1948 IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMEntityReference, (void**)entityref);
1949 IXMLDOMNode_Release(node);
1950 }
1951
1952 return hr;
1953}
@ NODE_ENTITY_REFERENCE
Definition: msxml6.idl:117

◆ domdoc_createNode()

static HRESULT WINAPI domdoc_createNode ( IXMLDOMDocument3 iface,
VARIANT  Type,
BSTR  name,
BSTR  namespaceURI,
IXMLDOMNode **  node 
)
static

Definition at line 2042 of file domdoc.c.

2048{
2050 DOMNodeType node_type;
2051 xmlNodePtr xmlnode;
2052 xmlChar *xml_name, *href;
2053 HRESULT hr;
2054
2055 TRACE("(%p)->(%s %s %s %p)\n", This, debugstr_variant(&Type), debugstr_w(name), debugstr_w(namespaceURI), node);
2056
2057 if(!node) return E_INVALIDARG;
2058
2059 hr = get_node_type(Type, &node_type);
2060 if(FAILED(hr)) return hr;
2061
2062 TRACE("node_type %d\n", node_type);
2063
2064 /* exit earlier for types that need name */
2065 switch(node_type)
2066 {
2067 case NODE_ELEMENT:
2068 case NODE_ATTRIBUTE:
2071 if (!name || *name == 0) return E_FAIL;
2072 break;
2073 default:
2074 break;
2075 }
2076
2077 xml_name = xmlchar_from_wchar(name);
2078 /* prevent empty href from being allocated */
2079 href = namespaceURI ? xmlchar_from_wchar(namespaceURI) : NULL;
2080
2081 switch(node_type)
2082 {
2083 case NODE_ELEMENT:
2084 {
2085 xmlChar *local, *prefix;
2086
2087 local = xmlSplitQName2(xml_name, &prefix);
2088
2089 xmlnode = xmlNewDocNode(get_doc(This), NULL, local ? local : xml_name, NULL);
2090
2091 /* allow creating the default namespace xmlns= */
2092 if (local || (href && *href))
2093 {
2094 xmlNsPtr ns = xmlNewNs(xmlnode, href, prefix);
2095 xmlSetNs(xmlnode, ns);
2096 }
2097
2098 xmlFree(local);
2099 xmlFree(prefix);
2100
2101 break;
2102 }
2103 case NODE_ATTRIBUTE:
2104 {
2105 xmlChar *local, *prefix;
2106
2107 local = xmlSplitQName2(xml_name, &prefix);
2108
2109 xmlnode = (xmlNodePtr)xmlNewDocProp(get_doc(This), local ? local : xml_name, NULL);
2110
2111 if (local || (href && *href))
2112 {
2113 /* we need a floating namespace here, it can't be created linked to attribute from
2114 a start */
2115 xmlNsPtr ns = xmlNewNs(NULL, href, prefix);
2116 xmlSetNs(xmlnode, ns);
2117 }
2118
2119 xmlFree(local);
2120 xmlFree(prefix);
2121
2122 break;
2123 }
2124 case NODE_TEXT:
2125 xmlnode = (xmlNodePtr)xmlNewDocText(get_doc(This), NULL);
2126 break;
2127 case NODE_CDATA_SECTION:
2128 xmlnode = xmlNewCDataBlock(get_doc(This), NULL, 0);
2129 break;
2131 xmlnode = xmlNewReference(get_doc(This), xml_name);
2132 break;
2134 xmlnode = xmlNewDocPI(get_doc(This), xml_name, NULL);
2135 break;
2136 case NODE_COMMENT:
2137 xmlnode = xmlNewDocComment(get_doc(This), NULL);
2138 break;
2140 xmlnode = xmlNewDocFragment(get_doc(This));
2141 break;
2142 /* unsupported types */
2143 case NODE_DOCUMENT:
2144 case NODE_DOCUMENT_TYPE:
2145 case NODE_ENTITY:
2146 case NODE_NOTATION:
2147 free(xml_name);
2148 return E_INVALIDARG;
2149 default:
2150 FIXME("unhandled node type %d\n", node_type);
2151 xmlnode = NULL;
2152 break;
2153 }
2154
2156 free(xml_name);
2157 free(href);
2158
2159 if(*node)
2160 {
2161 TRACE("created node (%d, %p, %p)\n", node_type, *node, xmlnode);
2163 return S_OK;
2164 }
2165
2166 return E_FAIL;
2167}
Type
Definition: Type.h:7
#define get_node_type(n)
Definition: dom.c:1111
#define local
Definition: zutil.h:30
static HRESULT create_node(HTMLDocumentNode *, nsIDOMNode *, HTMLDOMNode **)
Definition: htmlnode.c:1216
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
enum tagDOMNodeType DOMNodeType
@ NODE_TEXT
Definition: msxml6.idl:115
@ NODE_PROCESSING_INSTRUCTION
Definition: msxml6.idl:119
@ NODE_DOCUMENT_TYPE
Definition: msxml6.idl:122
@ NODE_ENTITY
Definition: msxml6.idl:118
@ NODE_DOCUMENT
Definition: msxml6.idl:121
@ NODE_NOTATION
Definition: msxml6.idl:124
static xmlChar * xmlchar_from_wchar(const WCHAR *str)
struct _xmlnode xmlnode
xmlFreeFunc xmlFree
Definition: globals.c:184
Character const *const prefix
Definition: tempnam.cpp:195

◆ domdoc_createProcessingInstruction()

static HRESULT WINAPI domdoc_createProcessingInstruction ( IXMLDOMDocument3 iface,
BSTR  target,
BSTR  data,
IXMLDOMProcessingInstruction **  pi 
)
static

Definition at line 1864 of file domdoc.c.

1869{
1872 VARIANT type;
1873 HRESULT hr;
1874
1875 TRACE("(%p)->(%s %s %p)\n", This, debugstr_w(target), debugstr_w(data), pi);
1876
1877 if (!pi) return E_INVALIDARG;
1878
1879 *pi = NULL;
1880
1881 V_VT(&type) = VT_I1;
1883
1884 hr = IXMLDOMDocument3_createNode(iface, type, target, NULL, &node);
1885 if (hr == S_OK)
1886 {
1887 /* this is to bypass check in ::put_data() that blocks "<?xml" PIs */
1889 if (SUCCEEDED(hr))
1890 hr = IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMProcessingInstruction, (void**)pi);
1891 IXMLDOMNode_Release(node);
1892 }
1893
1894 return hr;
1895}
#define SUCCEEDED(hr)
Definition: intsafe.h:50
static PROCESS_INFORMATION pi
Definition: debugger.c:2303
HRESULT dom_pi_put_xml_decl(IXMLDOMNode *node, BSTR data)
Definition: pi.c:750
Definition: tools.h:99

◆ domdoc_createTextNode()

static HRESULT WINAPI domdoc_createTextNode ( IXMLDOMDocument3 iface,
BSTR  data,
IXMLDOMText **  text 
)
static

Definition at line 1771 of file domdoc.c.

1775{
1778 VARIANT type;
1779 HRESULT hr;
1780
1781 TRACE("(%p)->(%s %p)\n", This, debugstr_w(data), text);
1782
1783 if (!text) return E_INVALIDARG;
1784
1785 *text = NULL;
1786
1787 V_VT(&type) = VT_I1;
1788 V_I1(&type) = NODE_TEXT;
1789
1790 hr = IXMLDOMDocument3_createNode(iface, type, NULL, NULL, &node);
1791 if (hr == S_OK)
1792 {
1793 IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMText, (void**)text);
1794 IXMLDOMNode_Release(node);
1795 hr = IXMLDOMText_put_data(*text, data);
1796 }
1797
1798 return hr;
1799}
const WCHAR * text
Definition: package.c:1794

◆ domdoc_get_async()

static HRESULT WINAPI domdoc_get_async ( IXMLDOMDocument3 iface,
VARIANT_BOOL isAsync 
)
static

Definition at line 2429 of file domdoc.c.

2432{
2434
2435 TRACE("(%p)->(%p: %d)\n", This, isAsync, This->async);
2436 *isAsync = This->async;
2437 return S_OK;
2438}

◆ domdoc_get_attributes()

static HRESULT WINAPI domdoc_get_attributes ( IXMLDOMDocument3 iface,
IXMLDOMNamedNodeMap **  attributeMap 
)
static

Definition at line 1183 of file domdoc.c.

1186{
1188
1189 TRACE("(%p)->(%p)\n", This, attributeMap);
1190
1191 return return_null_ptr((void**)attributeMap);
1192}
static HRESULT return_null_ptr(void **p)

◆ domdoc_get_baseName()

static HRESULT WINAPI domdoc_get_baseName ( IXMLDOMDocument3 iface,
BSTR name 
)
static

Definition at line 1534 of file domdoc.c.

1537{
1539 TRACE("(%p)->(%p)\n", This, name);
1540 return return_null_bstr( name );
1541}
static HRESULT return_null_bstr(BSTR *p)

◆ domdoc_get_childNodes()

static HRESULT WINAPI domdoc_get_childNodes ( IXMLDOMDocument3 iface,
IXMLDOMNodeList **  childList 
)
static

Definition at line 1123 of file domdoc.c.

1126{
1128
1129 TRACE("(%p)->(%p)\n", This, childList);
1130
1131 return node_get_child_nodes(&This->node, childList);
1132}
HRESULT node_get_child_nodes(xmlnode *, IXMLDOMNodeList **)
Definition: node.c:353

◆ domdoc_get_dataType()

static HRESULT WINAPI domdoc_get_dataType ( IXMLDOMDocument3 iface,
VARIANT typename 
)
static

Definition at line 1388 of file domdoc.c.

1391{
1393 TRACE("(%p)->(%p)\n", This, typename);
1394 return return_null_var( typename );
1395}
static HRESULT return_null_var(VARIANT *p)

◆ domdoc_get_definition()

static HRESULT WINAPI domdoc_get_definition ( IXMLDOMDocument3 iface,
IXMLDOMNode **  definitionNode 
)
static

Definition at line 1359 of file domdoc.c.

1362{
1364 FIXME("(%p)->(%p)\n", This, definitionNode);
1365 return E_NOTIMPL;
1366}

◆ domdoc_get_doctype()

static HRESULT WINAPI domdoc_get_doctype ( IXMLDOMDocument3 iface,
IXMLDOMDocumentType **  doctype 
)
static

Definition at line 1600 of file domdoc.c.

1603{
1606 xmlDtdPtr dtd;
1607 HRESULT hr;
1608
1609 TRACE("(%p)->(%p)\n", This, doctype);
1610
1611 if (!doctype) return E_INVALIDARG;
1612
1613 *doctype = NULL;
1614
1615 dtd = xmlGetIntSubset(get_doc(This));
1616 if (!dtd) return S_FALSE;
1617
1618 node = create_node((xmlNodePtr)dtd);
1619 if (!node) return S_FALSE;
1620
1621 hr = IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMDocumentType, (void**)doctype);
1622 IXMLDOMNode_Release(node);
1623
1624 return hr;
1625}
#define S_FALSE
Definition: winerror.h:3451

◆ domdoc_get_documentElement()

static HRESULT WINAPI domdoc_get_documentElement ( IXMLDOMDocument3 iface,
IXMLDOMElement **  DOMElement 
)
static

Definition at line 1642 of file domdoc.c.

1645{
1647 IXMLDOMNode *element_node;
1648 xmlNodePtr root;
1649 HRESULT hr;
1650
1651 TRACE("(%p)->(%p)\n", This, DOMElement);
1652
1653 if(!DOMElement)
1654 return E_INVALIDARG;
1655
1656 *DOMElement = NULL;
1657
1658 root = xmlDocGetRootElement( get_doc(This) );
1659 if ( !root )
1660 return S_FALSE;
1661
1662 element_node = create_node( root );
1663 if(!element_node) return S_FALSE;
1664
1665 hr = IXMLDOMNode_QueryInterface(element_node, &IID_IXMLDOMElement, (void**)DOMElement);
1666 IXMLDOMNode_Release(element_node);
1667
1668 return hr;
1669}
struct _root root

◆ domdoc_get_firstChild()

static HRESULT WINAPI domdoc_get_firstChild ( IXMLDOMDocument3 iface,
IXMLDOMNode **  firstChild 
)
static

Definition at line 1135 of file domdoc.c.

1138{
1140
1141 TRACE("(%p)->(%p)\n", This, firstChild);
1142
1143 return node_get_first_child(&This->node, firstChild);
1144}
HRESULT node_get_first_child(xmlnode *, IXMLDOMNode **)
Definition: node.c:365

◆ domdoc_get_implementation()

static HRESULT WINAPI domdoc_get_implementation ( IXMLDOMDocument3 iface,
IXMLDOMImplementation **  impl 
)
static

Definition at line 1628 of file domdoc.c.

1631{
1633
1634 TRACE("(%p)->(%p)\n", This, impl);
1635
1636 if(!impl)
1637 return E_INVALIDARG;
1638
1639 return create_dom_implementation(impl);
1640}
HRESULT create_dom_implementation(IHTMLDOMImplementation **) DECLSPEC_HIDDEN
Definition: omnavigator.c:169

◆ domdoc_get_lastChild()

static HRESULT WINAPI domdoc_get_lastChild ( IXMLDOMDocument3 iface,
IXMLDOMNode **  lastChild 
)
static

Definition at line 1147 of file domdoc.c.

1150{
1152
1153 TRACE("(%p)->(%p)\n", This, lastChild);
1154
1155 return node_get_last_child(&This->node, lastChild);
1156}
HRESULT node_get_last_child(xmlnode *, IXMLDOMNode **)
Definition: node.c:370

◆ domdoc_get_namespaces()

static HRESULT WINAPI domdoc_get_namespaces ( IXMLDOMDocument3 iface,
IXMLDOMSchemaCollection **  collection 
)
static

Definition at line 2797 of file domdoc.c.

2800{
2802 HRESULT hr;
2803
2804 FIXME("(%p)->(%p): semi-stub\n", This, collection);
2805
2806 if (!collection) return E_POINTER;
2807
2808 if (!This->namespaces)
2809 {
2810 hr = SchemaCache_create(This->properties->version, (void**)&This->namespaces);
2811 if (hr != S_OK) return hr;
2812
2813 hr = cache_from_doc_ns(This->namespaces, &This->node);
2814 if (hr != S_OK)
2816 }
2817
2818 if (This->namespaces)
2819 return IXMLDOMSchemaCollection2_QueryInterface(This->namespaces,
2820 &IID_IXMLDOMSchemaCollection, (void**)collection);
2821
2822 return hr;
2823}
static ICollection collection
Definition: typelib.c:184
HRESULT SchemaCache_create(MSXML_VERSION, void **)
Definition: schema.c:1601
HRESULT cache_from_doc_ns(IXMLDOMSchemaCollection2 *, xmlnode *)
Definition: schema.c:1028

◆ domdoc_get_namespaceURI()

static HRESULT WINAPI domdoc_get_namespaceURI ( IXMLDOMDocument3 iface,
BSTR namespaceURI 
)
static

Definition at line 1515 of file domdoc.c.

1518{
1520 TRACE("(%p)->(%p)\n", This, namespaceURI);
1521 return return_null_bstr( namespaceURI );
1522}

◆ domdoc_get_nextSibling()

static HRESULT WINAPI domdoc_get_nextSibling ( IXMLDOMDocument3 iface,
IXMLDOMNode **  nextSibling 
)
static

Definition at line 1171 of file domdoc.c.

1174{
1176
1177 TRACE("(%p)->(%p)\n", This, nextSibling);
1178
1179 return return_null_node(nextSibling);
1180}
static HRESULT return_null_node(IXMLDOMNode **p)

◆ domdoc_get_nodeName()

static HRESULT WINAPI domdoc_get_nodeName ( IXMLDOMDocument3 iface,
BSTR name 
)
static

Definition at line 1057 of file domdoc.c.

1060{
1062
1063 static const WCHAR documentW[] = {'#','d','o','c','u','m','e','n','t',0};
1064
1065 TRACE("(%p)->(%p)\n", This, name);
1066
1067 return return_bstr(documentW, name);
1068}
static const WCHAR documentW[]
Definition: script.c:47
static HRESULT return_bstr(const WCHAR *value, BSTR *p)
Definition: msxml_dispex.h:115
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ domdoc_get_nodeType()

static HRESULT WINAPI domdoc_get_nodeType ( IXMLDOMDocument3 iface,
DOMNodeType type 
)
static

Definition at line 1098 of file domdoc.c.

1101{
1103
1104 TRACE("(%p)->(%p)\n", This, type);
1105
1107 return S_OK;
1108}

◆ domdoc_get_nodeTypedValue()

static HRESULT WINAPI domdoc_get_nodeTypedValue ( IXMLDOMDocument3 iface,
VARIANT v 
)
static

Definition at line 1369 of file domdoc.c.

1372{
1374 TRACE("(%p)->(%p)\n", This, v);
1375 return return_null_var(v);
1376}
const GLdouble * v
Definition: gl.h:2040

◆ domdoc_get_nodeTypeString()

static HRESULT WINAPI domdoc_get_nodeTypeString ( IXMLDOMDocument3 iface,
BSTR p 
)
static

Definition at line 1315 of file domdoc.c.

1318{
1320 static const WCHAR documentW[] = {'d','o','c','u','m','e','n','t',0};
1321
1322 TRACE("(%p)->(%p)\n", This, p);
1323
1324 return return_bstr(documentW, p);
1325}
GLfloat GLfloat p
Definition: glext.h:8902

◆ domdoc_get_nodeValue()

static HRESULT WINAPI domdoc_get_nodeValue ( IXMLDOMDocument3 iface,
VARIANT value 
)
static

Definition at line 1071 of file domdoc.c.

1074{
1076
1077 TRACE("(%p)->(%p)\n", This, value);
1078
1079 if(!value)
1080 return E_INVALIDARG;
1081
1082 V_VT(value) = VT_NULL;
1083 V_BSTR(value) = NULL; /* tests show that we should do this */
1084 return S_FALSE;
1085}
@ VT_NULL
Definition: compat.h:2296
#define V_BSTR(A)
Definition: oleauto.h:226
Definition: pdh_main.c:96

◆ domdoc_get_ownerDocument()

static HRESULT WINAPI domdoc_get_ownerDocument ( IXMLDOMDocument3 iface,
IXMLDOMDocument **  doc 
)
static

Definition at line 1271 of file domdoc.c.

1274{
1276 TRACE("(%p)->(%p)\n", This, doc);
1277 return node_get_owner_doc(&This->node, doc);
1278}
HRESULT node_get_owner_doc(const xmlnode *, IXMLDOMDocument **)
Definition: node.c:672

◆ domdoc_get_parentNode()

static HRESULT WINAPI domdoc_get_parentNode ( IXMLDOMDocument3 iface,
IXMLDOMNode **  parent 
)
static

Definition at line 1111 of file domdoc.c.

1114{
1116
1117 TRACE("(%p)->(%p)\n", This, parent);
1118
1119 return node_get_parent(&This->node, parent);
1120}
r parent
Definition: btrfs.c:3010
HRESULT node_get_parent(xmlnode *, IXMLDOMNode **)
Definition: node.c:348

◆ domdoc_get_parsed()

static HRESULT WINAPI domdoc_get_parsed ( IXMLDOMDocument3 iface,
VARIANT_BOOL isParsed 
)
static

Definition at line 1505 of file domdoc.c.

1508{
1510 FIXME("(%p)->(%p) stub!\n", This, isParsed);
1511 *isParsed = VARIANT_TRUE;
1512 return S_OK;
1513}

◆ domdoc_get_parseError()

static HRESULT WINAPI domdoc_get_parseError ( IXMLDOMDocument3 iface,
IXMLDOMParseError **  errorObj 
)
static

Definition at line 2392 of file domdoc.c.

2395{
2397 static const WCHAR err[] = {'e','r','r','o','r',0};
2398 BSTR error_string = NULL;
2399
2400 FIXME("(%p)->(%p): creating a dummy parseError\n", iface, errorObj);
2401
2402 if(This->error)
2403 error_string = SysAllocString(err);
2404
2405 *errorObj = create_parseError(This->error, NULL, error_string, NULL, 0, 0, 0);
2406 if(!*errorObj) return E_OUTOFMEMORY;
2407 return S_OK;
2408}
OLECHAR * BSTR
Definition: compat.h:2293
IXMLDOMParseError * create_parseError(LONG code, BSTR url, BSTR reason, BSTR srcText, LONG line, LONG linepos, LONG filepos)
Definition: parseerror.c:320
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
#define err(...)

◆ domdoc_get_prefix()

static HRESULT WINAPI domdoc_get_prefix ( IXMLDOMDocument3 iface,
BSTR prefix 
)
static

Definition at line 1524 of file domdoc.c.

1527{
1529 TRACE("(%p)->(%p)\n", This, prefix);
1530 return return_null_bstr( prefix );
1531}

◆ domdoc_get_preserveWhiteSpace()

static HRESULT WINAPI domdoc_get_preserveWhiteSpace ( IXMLDOMDocument3 iface,
VARIANT_BOOL isPreserving 
)
static

Definition at line 2750 of file domdoc.c.

2753{
2755 TRACE("(%p)->(%p: %d)\n", This, isPreserving, This->properties->preserving);
2756 *isPreserving = This->properties->preserving;
2757 return S_OK;
2758}

◆ domdoc_get_previousSibling()

static HRESULT WINAPI domdoc_get_previousSibling ( IXMLDOMDocument3 iface,
IXMLDOMNode **  previousSibling 
)
static

Definition at line 1159 of file domdoc.c.

1162{
1164
1165 TRACE("(%p)->(%p)\n", This, previousSibling);
1166
1167 return return_null_node(previousSibling);
1168}

◆ domdoc_get_readyState()

static HRESULT WINAPI domdoc_get_readyState ( IXMLDOMDocument3 iface,
LONG value 
)
static

Definition at line 2377 of file domdoc.c.

2380{
2382 FIXME("stub! (%p)->(%p)\n", This, value);
2383
2384 if (!value)
2385 return E_INVALIDARG;
2386
2387 *value = READYSTATE_COMPLETE;
2388 return S_OK;
2389}

◆ domdoc_get_resolveExternals()

static HRESULT WINAPI domdoc_get_resolveExternals ( IXMLDOMDocument3 iface,
VARIANT_BOOL isResolving 
)
static

Definition at line 2728 of file domdoc.c.

2731{
2733 TRACE("(%p)->(%p: %d)\n", This, isResolving, This->resolving);
2734 *isResolving = This->resolving;
2735 return S_OK;
2736}

◆ domdoc_get_schemas()

static HRESULT WINAPI domdoc_get_schemas ( IXMLDOMDocument3 iface,
VARIANT schema 
)
static

Definition at line 2825 of file domdoc.c.

2828{
2830 IXMLDOMSchemaCollection2* cur_schema = This->properties->schemaCache;
2831 HRESULT hr = S_FALSE;
2832
2833 TRACE("(%p)->(%p)\n", This, schema);
2834
2835 V_VT(schema) = VT_NULL;
2836 /* just to reset pointer part, cause that's what application is expected to use */
2838
2839 if(cur_schema)
2840 {
2841 hr = IXMLDOMSchemaCollection2_QueryInterface(cur_schema, &IID_IDispatch, (void**)&V_DISPATCH(schema));
2842 if(SUCCEEDED(hr))
2844 }
2845 return hr;
2846}
@ VT_DISPATCH
Definition: compat.h:2304
const WCHAR * schema
#define V_DISPATCH(A)
Definition: oleauto.h:239

◆ domdoc_get_specified()

static HRESULT WINAPI domdoc_get_specified ( IXMLDOMDocument3 iface,
VARIANT_BOOL isSpecified 
)
static

Definition at line 1348 of file domdoc.c.

1351{
1353 FIXME("(%p)->(%p) stub!\n", This, isSpecified);
1354 *isSpecified = VARIANT_TRUE;
1355 return S_OK;
1356}

◆ domdoc_get_text()

static HRESULT WINAPI domdoc_get_text ( IXMLDOMDocument3 iface,
BSTR p 
)
static

Definition at line 1328 of file domdoc.c.

1331{
1333 TRACE("(%p)->(%p)\n", This, p);
1334 return node_get_text(&This->node, p);
1335}
HRESULT node_get_text(const xmlnode *, BSTR *)
Definition: node.c:842

◆ domdoc_get_url()

static HRESULT WINAPI domdoc_get_url ( IXMLDOMDocument3 iface,
BSTR url 
)
static

Definition at line 2411 of file domdoc.c.

2414{
2416
2417 TRACE("(%p)->(%p)\n", This, url);
2418
2419 if (!url)
2420 return E_INVALIDARG;
2421
2422 if (!This->properties->uri)
2423 return return_null_bstr(url);
2424
2425 return IUri_GetPropertyBSTR(This->properties->uri, Uri_PROPERTY_DISPLAY_URI, url, 0);
2426}
static const WCHAR url[]
Definition: encode.c:1384

◆ domdoc_get_validateOnParse()

static HRESULT WINAPI domdoc_get_validateOnParse ( IXMLDOMDocument3 iface,
VARIANT_BOOL isValidating 
)
static

Definition at line 2706 of file domdoc.c.

2709{
2711 TRACE("(%p)->(%p: %d)\n", This, isValidating, This->properties->validating);
2712 *isValidating = This->properties->validating;
2713 return S_OK;
2714}

◆ domdoc_get_xml()

static HRESULT WINAPI domdoc_get_xml ( IXMLDOMDocument3 iface,
BSTR p 
)
static

Definition at line 1417 of file domdoc.c.

1420{
1422 xmlSaveCtxtPtr ctxt;
1423 xmlBufferPtr buf;
1424 int options;
1425 long ret;
1426
1427 TRACE("(%p)->(%p)\n", This, p);
1428
1429 if(!p)
1430 return E_INVALIDARG;
1431
1432 *p = NULL;
1433
1434 buf = xmlBufferCreate();
1435 if(!buf)
1436 return E_OUTOFMEMORY;
1437
1438 options = XML_SAVE_FORMAT | XML_SAVE_NO_DECL;
1439 ctxt = xmlSaveToIO(domdoc_get_xml_writecallback, NULL, buf, "UTF-8", options);
1440
1441 if(!ctxt)
1442 {
1443 xmlBufferFree(buf);
1444 return E_OUTOFMEMORY;
1445 }
1446
1447 ret = xmlSaveDoc(ctxt, get_doc(This));
1448 /* flushes on close */
1449 xmlSaveClose(ctxt);
1450
1451 TRACE("%ld, len=%d\n", ret, xmlBufferLength(buf));
1452 if(ret != -1 && xmlBufferLength(buf) > 0)
1453 {
1454 BSTR content;
1455
1456 content = bstr_from_xmlChar(xmlBufferContent(buf));
1458
1459 *p = content;
1460 }
1461 else
1462 {
1463 *p = SysAllocStringLen(NULL, 0);
1464 }
1465
1466 xmlBufferFree(buf);
1467
1468 return *p ? S_OK : E_OUTOFMEMORY;
1469}
content
Definition: atl_ax.c:994
static int XMLCALL domdoc_get_xml_writecallback(void *ctx, const char *data, int len)
Definition: domdoc.c:1412
return ret
Definition: mutex.c:146
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static BSTR bstr_from_xmlChar(const xmlChar *str)
BSTR EnsureCorrectEOL(BSTR)
Definition: node.c:885
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339

◆ domdoc_get_xml_writecallback()

static int XMLCALL domdoc_get_xml_writecallback ( void ctx,
const char data,
int  len 
)
static

Definition at line 1412 of file domdoc.c.

1413{
1414 return xmlBufferAdd((xmlBufferPtr)ctx, (xmlChar*)data, len) == 0 ? len : 0;
1415}

Referenced by domdoc_get_xml().

◆ domdoc_getElementsByTagName()

static HRESULT WINAPI domdoc_getElementsByTagName ( IXMLDOMDocument3 iface,
BSTR  tagName,
IXMLDOMNodeList **  resultList 
)
static

Definition at line 2003 of file domdoc.c.

2007{
2009 xmlChar *query;
2010 HRESULT hr;
2011 BOOL XPath;
2012
2013 TRACE("(%p)->(%s, %p)\n", This, debugstr_w(tagName), resultList);
2014
2015 if (!tagName || !resultList) return E_INVALIDARG;
2016
2017 XPath = This->properties->XPath;
2018 This->properties->XPath = TRUE;
2019 query = tagName_to_XPath(tagName);
2020 hr = create_selection((xmlNodePtr)get_doc(This), query, resultList);
2021 xmlFree(query);
2022 This->properties->XPath = XPath;
2023
2024 return hr;
2025}
#define TRUE
Definition: types.h:120
xmlChar * tagName_to_XPath(const BSTR tagName)
Definition: domdoc.c:1955
unsigned int BOOL
Definition: ntddk_ex.h:94
HRESULT create_selection(xmlNodePtr, xmlChar *, IXMLDOMNodeList **)
Definition: selection.c:764

◆ domdoc_GetIDsOfNames()

static HRESULT WINAPI domdoc_GetIDsOfNames ( IXMLDOMDocument3 iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 1028 of file domdoc.c.

1035{
1037 return IDispatchEx_GetIDsOfNames(&This->node.dispex.IDispatchEx_iface,
1038 riid, rgszNames, cNames, lcid, rgDispId);
1039}
LCID lcid
Definition: locale.c:5656

◆ domdoc_getProperty()

static HRESULT WINAPI domdoc_getProperty ( IXMLDOMDocument3 iface,
BSTR  p,
VARIANT var 
)
static

Definition at line 3216 of file domdoc.c.

3220{
3222
3223 TRACE("(%p)->(%s)\n", This, debugstr_w(p));
3224
3225 if (!var)
3226 return E_INVALIDARG;
3227
3229 {
3230 V_VT(var) = VT_BSTR;
3231 V_BSTR(var) = This->properties->XPath ?
3234 return V_BSTR(var) ? S_OK : E_OUTOFMEMORY;
3235 }
3237 {
3238 int lenA, lenW;
3239 BSTR rebuiltStr, cur;
3240 const xmlChar *nsStr;
3241 struct list *pNsList;
3242 select_ns_entry* pNsEntry;
3243
3244 V_VT(var) = VT_BSTR;
3245 nsStr = This->properties->selectNsStr;
3246 pNsList = &This->properties->selectNsList;
3247 lenA = This->properties->selectNsStr_len;
3248 lenW = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)nsStr, lenA+1, NULL, 0);
3249 rebuiltStr = malloc(lenW * sizeof(WCHAR));
3250 MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)nsStr, lenA+1, rebuiltStr, lenW);
3251 cur = rebuiltStr;
3252 /* this is fine because all of the chars that end tokens are ASCII*/
3253 LIST_FOR_EACH_ENTRY(pNsEntry, pNsList, select_ns_entry, entry)
3254 {
3255 while (*cur != 0) ++cur;
3256 if (pNsEntry->prefix_end)
3257 {
3258 *cur = pNsEntry->prefix_end;
3259 while (*cur != 0) ++cur;
3260 }
3261
3262 if (pNsEntry->href_end)
3263 {
3264 *cur = pNsEntry->href_end;
3265 }
3266 }
3267 V_BSTR(var) = SysAllocString(rebuiltStr);
3268 free(rebuiltStr);
3269 return S_OK;
3270 }
3271 else if (lstrcmpiW(p, PropertyValidateOnParse) == 0)
3272 {
3273 if (This->properties->version < MSXML4)
3274 return E_FAIL;
3275 else
3276 {
3277 V_VT(var) = VT_BOOL;
3278 V_BOOL(var) = This->properties->validating;
3279 return S_OK;
3280 }
3281 }
3282
3283 FIXME("Unknown property %s\n", debugstr_w(p));
3284 return E_FAIL;
3285}
Definition: list.h:37
#define MultiByteToWideChar
Definition: compat.h:110
@ VT_BSTR
Definition: compat.h:2303
@ VT_BOOL
Definition: compat.h:2306
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4265
static const WCHAR PropertySelectionNamespacesW[]
Definition: domdoc.c:53
static const WCHAR PropertySelectionLanguageW[]
Definition: domdoc.c:52
static const WCHAR PropValueXSLPatternW[]
Definition: domdoc.c:57
static const WCHAR PropertyValidateOnParse[]
Definition: domdoc.c:62
static const WCHAR PropValueXPathW[]
Definition: domdoc.c:56
FxCollectionEntry * cur
const char * var
Definition: shader.c:5666
#define V_BOOL(A)
Definition: oleauto.h:224
#define CP_UTF8
Definition: nls.h:20
xmlChar href_end
Definition: domdoc.c:212
xmlChar prefix_end
Definition: domdoc.c:210
const char * LPCSTR
Definition: xmlstorage.h:183

◆ domdoc_GetTypeInfo()

static HRESULT WINAPI domdoc_GetTypeInfo ( IXMLDOMDocument3 iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 1020 of file domdoc.c.

1023{
1025 return IDispatchEx_GetTypeInfo(&This->node.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
1026}

◆ domdoc_GetTypeInfoCount()

static HRESULT WINAPI domdoc_GetTypeInfoCount ( IXMLDOMDocument3 iface,
UINT pctinfo 
)
static

Definition at line 1014 of file domdoc.c.

1015{
1017 return IDispatchEx_GetTypeInfoCount(&This->node.dispex.IDispatchEx_iface, pctinfo);
1018}

◆ domdoc_hasChildNodes()

static HRESULT WINAPI domdoc_hasChildNodes ( IXMLDOMDocument3 iface,
VARIANT_BOOL ret 
)
static

Definition at line 1261 of file domdoc.c.

1264{
1266 TRACE("(%p)->(%p)\n", This, ret);
1267 return node_has_childnodes(&This->node, ret);
1268}
HRESULT node_has_childnodes(const xmlnode *, VARIANT_BOOL *)
Definition: node.c:658

◆ domdoc_importNode()

static HRESULT WINAPI domdoc_importNode ( IXMLDOMDocument3 iface,
IXMLDOMNode node,
VARIANT_BOOL  deep,
IXMLDOMNode **  clone 
)
static

Definition at line 3287 of file domdoc.c.

3292{
3294 FIXME("(%p)->(%p %d %p): stub\n", This, node, deep, clone);
3295 return E_NOTIMPL;
3296}

◆ domdoc_insertBefore()

static HRESULT WINAPI domdoc_insertBefore ( IXMLDOMDocument3 iface,
IXMLDOMNode newChild,
VARIANT  refChild,
IXMLDOMNode **  outNewChild 
)
static

Definition at line 1195 of file domdoc.c.

1200{
1203 HRESULT hr;
1204
1205 TRACE("(%p)->(%p %s %p)\n", This, newChild, debugstr_variant(&refChild), outNewChild);
1206
1207 if (!newChild) return E_INVALIDARG;
1208
1209 hr = IXMLDOMNode_get_nodeType(newChild, &type);
1210 if (hr != S_OK) return hr;
1211
1212 TRACE("new node type %d\n", type);
1213 switch (type)
1214 {
1215 case NODE_ATTRIBUTE:
1216 case NODE_DOCUMENT:
1217 case NODE_CDATA_SECTION:
1218 if (outNewChild) *outNewChild = NULL;
1219 return E_FAIL;
1220 default:
1221 return node_insert_before(&This->node, newChild, &refChild, outNewChild);
1222 }
1223}
HRESULT node_insert_before(xmlnode *, IXMLDOMNode *, const VARIANT *, IXMLDOMNode **)
Definition: node.c:432

◆ domdoc_Invoke()

static HRESULT WINAPI domdoc_Invoke ( IXMLDOMDocument3 iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 1041 of file domdoc.c.

1051{
1053 return IDispatchEx_Invoke(&This->node.dispex.IDispatchEx_iface,
1054 dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1055}
WINBASEAPI _In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon_undoc.h:337

◆ domdoc_load()

static HRESULT WINAPI domdoc_load ( IXMLDOMDocument3 iface,
VARIANT  source,
VARIANT_BOOL isSuccessful 
)
static

Definition at line 2205 of file domdoc.c.

2209{
2212 HRESULT hr = S_FALSE;
2213 xmlDocPtr xmldoc;
2214
2215 TRACE("(%p)->(%s)\n", This, debugstr_variant(&source));
2216
2217 if (!isSuccessful)
2218 return E_POINTER;
2219 *isSuccessful = VARIANT_FALSE;
2220
2221 assert( &This->node );
2222
2223 switch( V_VT(&source) )
2224 {
2225 case VT_BSTR:
2227 break;
2228 case VT_BSTR|VT_BYREF:
2229 if (!V_BSTRREF(&source)) return E_INVALIDARG;
2231 break;
2232 case VT_ARRAY|VT_UI1:
2233 {
2235 char *str;
2236 LONG len;
2237 UINT dim = SafeArrayGetDim(psa);
2238
2239 switch (dim)
2240 {
2241 case 0:
2242 ERR("SAFEARRAY == NULL\n");
2243 hr = This->error = E_INVALIDARG;
2244 break;
2245 case 1:
2246 /* Only takes UTF-8 strings.
2247 * NOT NULL-terminated. */
2248 hr = SafeArrayAccessData(psa, (void**)&str);
2249 if (FAILED(hr))
2250 {
2251 This->error = hr;
2252 WARN("failed to access array data, hr %#lx.\n", hr);
2253 break;
2254 }
2256
2258 {
2259 hr = This->error = S_OK;
2260 *isSuccessful = VARIANT_TRUE;
2261 TRACE("parsed document %p\n", xmldoc);
2262 }
2263 else
2264 {
2265 This->error = E_FAIL;
2266 TRACE("failed to parse document\n");
2267 }
2268
2270
2271 if(xmldoc)
2272 {
2273 xmldoc->_private = create_priv();
2274 return attach_xmldoc(This, xmldoc);
2275 }
2276 break;
2277 default:
2278 FIXME("unhandled SAFEARRAY dim: %d\n", dim);
2279 hr = This->error = E_NOTIMPL;
2280 }
2281 }
2282 break;
2283 case VT_UNKNOWN:
2284 {
2286 IXMLDOMDocument3 *newdoc = NULL;
2287
2288 if (!V_UNKNOWN(&source)) return E_INVALIDARG;
2289
2290 hr = IUnknown_QueryInterface(V_UNKNOWN(&source), &IID_IXMLDOMDocument3, (void**)&newdoc);
2291 if(hr == S_OK)
2292 {
2293 if(newdoc)
2294 {
2295 domdoc *newDoc = impl_from_IXMLDOMDocument3( newdoc );
2296
2297 xmldoc = xmlCopyDoc(get_doc(newDoc), 1);
2298 xmldoc->_private = create_priv();
2300
2301 if(SUCCEEDED(hr))
2302 *isSuccessful = VARIANT_TRUE;
2303
2304 return hr;
2305 }
2306 }
2307
2308 hr = IUnknown_QueryInterface(V_UNKNOWN(&source), &IID_IStream, (void**)&stream);
2309 if (FAILED(hr))
2310 hr = IUnknown_QueryInterface(V_UNKNOWN(&source), &IID_ISequentialStream, (void**)&stream);
2311
2312 if (hr == S_OK)
2313 {
2315 if (hr == S_OK)
2316 *isSuccessful = VARIANT_TRUE;
2317 ISequentialStream_Release(stream);
2318 return hr;
2319 }
2320
2321 FIXME("unsupported IUnknown type (%#lx) (%p)\n", hr, V_UNKNOWN(&source)->lpVtbl);
2322 break;
2323 }
2324 default:
2325 FIXME("VT type not supported (%d)\n", V_VT(&source));
2326 }
2327
2328 if ( filename )
2329 {
2330 IUri *uri = NULL;
2331 IMoniker *mon;
2332
2333 if (This->properties->uri)
2334 {
2335 IUri_Release(This->properties->uri);
2336 This->properties->uri = NULL;
2337 }
2338
2339 hr = create_uri(This->base_uri, filename, &uri);
2340 if (SUCCEEDED(hr))
2341 hr = CreateURLMonikerEx2(NULL, uri, &mon, 0);
2342 if ( SUCCEEDED(hr) )
2343 {
2344 hr = domdoc_load_moniker( This, mon );
2345 IMoniker_Release(mon);
2346 }
2347
2348 if (SUCCEEDED(hr))
2349 {
2350 get_doc(This)->name = (char *)xmlchar_from_wcharn(filename, -1, TRUE);
2351 This->properties->uri = uri;
2352 hr = This->error = S_OK;
2353 *isSuccessful = VARIANT_TRUE;
2354 }
2355 else
2356 {
2357 if (uri)
2358 IUri_Release(uri);
2359 This->error = E_FAIL;
2360 }
2361 }
2362
2363 if(!filename || FAILED(hr)) {
2364 xmldoc = xmlNewDoc(NULL);
2365 xmldoc->_private = create_priv();
2367 if(SUCCEEDED(hr))
2368 hr = S_FALSE;
2369 }
2370
2371 TRACE("hr %#lx.\n", hr);
2372
2373 return hr;
2374}
#define ERR(fmt,...)
Definition: precomp.h:57
HRESULT create_uri(const WCHAR *, DWORD, IUri **) DECLSPEC_HIDDEN
Definition: persist.c:158
@ VT_UNKNOWN
Definition: compat.h:2308
@ VT_BYREF
Definition: compat.h:2342
@ VT_ARRAY
Definition: compat.h:2341
@ VT_UI1
Definition: compat.h:2311
#define assert(_expr)
Definition: assert.h:32
static xmlDocPtr doparse(domdoc *This, char const *ptr, int len, xmlCharEncoding encoding)
Definition: domdoc.c:502
static HRESULT domdoc_load_moniker(domdoc *This, IMoniker *mon)
Definition: domdoc.c:2193
static HRESULT domdoc_load_from_stream(domdoc *doc, ISequentialStream *stream)
Definition: domdoc.c:798
static HRESULT attach_xmldoc(domdoc *This, xmlDocPtr xml)
Definition: domdoc.c:695
HRESULT WINAPI SafeArrayGetUBound(SAFEARRAY *psa, UINT nDim, LONG *plUbound)
Definition: safearray.c:1033
HRESULT WINAPI SafeArrayAccessData(SAFEARRAY *psa, void **ppvData)
Definition: safearray.c:1137
HRESULT WINAPI SafeArrayUnaccessData(SAFEARRAY *psa)
Definition: safearray.c:1168
UINT WINAPI SafeArrayGetDim(SAFEARRAY *psa)
Definition: safearray.c:1094
@ XML_CHAR_ENCODING_UTF8
Definition: encoding.h:68
const char * filename
Definition: ioapi.h:137
const char * uri
Definition: sec_mgr.c:1588
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
static xmlChar * xmlchar_from_wcharn(const WCHAR *str, int nchars, BOOL use_xml_alloc)
unsigned int UINT
Definition: ndis.h:50
#define V_ARRAY(A)
Definition: oleauto.h:222
#define V_BSTRREF(A)
Definition: oleauto.h:227
#define V_UNKNOWN(A)
Definition: oleauto.h:281
long LONG
Definition: pedump.c:60
const WCHAR * str
Definition: parse.h:23
HRESULT WINAPI CreateURLMonikerEx2(IMoniker *pmkContext, IUri *pUri, IMoniker **ppmk, DWORD dwFlags)
Definition: umon.c:668
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ domdoc_load_from_stream()

static HRESULT domdoc_load_from_stream ( domdoc doc,
ISequentialStream stream 
)
static

Definition at line 798 of file domdoc.c.

799{
800 DWORD read, written, len;
801 xmlDocPtr xmldoc = NULL;
802 IStream *hstream;
803 HGLOBAL hglobal;
804 BYTE buf[4096];
805 HRESULT hr;
806 char *ptr;
807
808 hstream = NULL;
809 hr = CreateStreamOnHGlobal(NULL, TRUE, &hstream);
810 if (FAILED(hr))
811 return hr;
812
813 do
814 {
815 ISequentialStream_Read(stream, buf, sizeof(buf), &read);
816 hr = IStream_Write(hstream, buf, read, &written);
817 } while(SUCCEEDED(hr) && written != 0 && read != 0);
818
819 if (FAILED(hr))
820 {
821 ERR("failed to copy stream, hr %#lx.\n", hr);
822 IStream_Release(hstream);
823 return hr;
824 }
825
826 hr = GetHGlobalFromStream(hstream, &hglobal);
827 if (FAILED(hr))
828 {
829 IStream_Release(hstream);
830 return hr;
831 }
832
833 len = GlobalSize(hglobal);
834 ptr = GlobalLock(hglobal);
835 if (len)
837 GlobalUnlock(hglobal);
838 IStream_Release(hstream);
839
840 if (!xmldoc)
841 {
842 ERR("Failed to parse xml\n");
843 return E_FAIL;
844 }
845
846 xmldoc->_private = create_priv();
847
848 return attach_xmldoc(doc, xmldoc);
849}
#define read
Definition: acwin.h:96
HRESULT WINAPI GetHGlobalFromStream(IStream *pstm, HGLOBAL *phglobal)
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
@ XML_CHAR_ENCODING_NONE
Definition: encoding.h:67
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
Definition: heapmem.c:1090
static ERESOURCE GlobalLock
Definition: sys_arch.c:8
static PVOID ptr
Definition: dispmode.c:27
unsigned char BYTE
Definition: xxhash.c:193

Referenced by domdoc_load(), and PersistStreamInit_Load().

◆ domdoc_load_moniker()

static HRESULT domdoc_load_moniker ( domdoc This,
IMoniker mon 
)
static

Definition at line 2193 of file domdoc.c.

2194{
2195 bsc_t *bsc;
2196 HRESULT hr;
2197
2199 if(FAILED(hr))
2200 return hr;
2201
2202 return detach_bsc(bsc);
2203}
HRESULT detach_bsc(bsc_t *bsc)
Definition: bsc.c:342
HRESULT bind_url(IMoniker *mon, HRESULT(*onDataAvailable)(void *, char *, DWORD), void *obj, bsc_t **ret)
Definition: bsc.c:299
static HRESULT domdoc_onDataAvailable(void *obj, char *ptr, DWORD len)
Definition: domdoc.c:2179
Definition: bsc.c:39
Definition: xmldoc.c:231

Referenced by domdoc_load().

◆ domdoc_loadXML()

static HRESULT WINAPI domdoc_loadXML ( IXMLDOMDocument3 iface,
BSTR  data,
VARIANT_BOOL isSuccessful 
)
static

Definition at line 2462 of file domdoc.c.

2466{
2468 xmlDocPtr xmldoc = NULL;
2469 HRESULT hr = S_FALSE, hr2;
2470
2471 TRACE("(%p)->(%s %p)\n", This, debugstr_w(data), isSuccessful );
2472
2473 assert ( &This->node );
2474
2475 if ( isSuccessful )
2476 {
2477 *isSuccessful = VARIANT_FALSE;
2478
2479 if (data)
2480 {
2481 WCHAR *ptr = data;
2482
2483 /* skip leading spaces if needed */
2484 if (This->properties->version == MSXML_DEFAULT || This->properties->version == MSXML26)
2485 while (*ptr && iswspace(*ptr)) ptr++;
2486
2488 if ( !xmldoc )
2489 {
2490 This->error = E_FAIL;
2491 TRACE("failed to parse document\n");
2492 }
2493 else
2494 {
2495 hr = This->error = S_OK;
2496 *isSuccessful = VARIANT_TRUE;
2497 TRACE("parsed document %p\n", xmldoc);
2498 }
2499 }
2500 }
2501
2502 if(!xmldoc)
2503 xmldoc = xmlNewDoc(NULL);
2504 xmldoc->_private = create_priv();
2505 hr2 = attach_xmldoc(This, xmldoc);
2506 if( FAILED(hr2) )
2507 hr = hr2;
2508
2509 return hr;
2510}
#define lstrlenW
Definition: compat.h:750
@ XML_CHAR_ENCODING_UTF16LE
Definition: encoding.h:69
@ MSXML_DEFAULT
Definition: msxml_dispex.h:28
@ MSXML26
Definition: msxml_dispex.h:30
#define iswspace(_c)
Definition: ctype.h:669

◆ domdoc_nodeFromID()

static HRESULT WINAPI domdoc_nodeFromID ( IXMLDOMDocument3 iface,
BSTR  idString,
IXMLDOMNode **  node 
)
static

Definition at line 2169 of file domdoc.c.

2173{
2175 FIXME("(%p)->(%s %p)\n", This, debugstr_w(idString), node);
2176 return E_NOTIMPL;
2177}

◆ domdoc_ObjectWithSite_AddRef()

static ULONG WINAPI domdoc_ObjectWithSite_AddRef ( IObjectWithSite iface)
static

Definition at line 3610 of file domdoc.c.

3611{
3613 return IXMLDOMDocument3_AddRef(&This->IXMLDOMDocument3_iface);
3614}
static domdoc * impl_from_IObjectWithSite(IObjectWithSite *iface)
Definition: domdoc.c:737

◆ domdoc_ObjectWithSite_GetSite()

static HRESULT WINAPI domdoc_ObjectWithSite_GetSite ( IObjectWithSite iface,
REFIID  iid,
void **  ppvSite 
)
static

Definition at line 3622 of file domdoc.c.

3623{
3625
3626 TRACE("(%p)->(%s %p)\n", This, debugstr_guid( iid ), ppvSite );
3627
3628 if ( !This->site )
3629 return E_FAIL;
3630
3631 return IUnknown_QueryInterface( This->site, iid, ppvSite );
3632}

◆ domdoc_ObjectWithSite_QueryInterface()

static HRESULT WINAPI domdoc_ObjectWithSite_QueryInterface ( IObjectWithSite iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 3604 of file domdoc.c.

3605{
3607 return IXMLDOMDocument3_QueryInterface(&This->IXMLDOMDocument3_iface, riid, ppvObject);
3608}

◆ domdoc_ObjectWithSite_Release()

static ULONG WINAPI domdoc_ObjectWithSite_Release ( IObjectWithSite iface)
static

Definition at line 3616 of file domdoc.c.

3617{
3619 return IXMLDOMDocument3_Release(&This->IXMLDOMDocument3_iface);
3620}

◆ domdoc_ObjectWithSite_SetSite()

static HRESULT WINAPI domdoc_ObjectWithSite_SetSite ( IObjectWithSite iface,
IUnknown punk 
)
static

Definition at line 3634 of file domdoc.c.

3635{
3637
3638 TRACE("(%p)->(%p)\n", iface, punk);
3639
3640 if(!punk)
3641 {
3642 if(This->site)
3643 {
3644 IUnknown_Release( This->site );
3645 This->site = NULL;
3646 }
3647
3648 if(This->base_uri)
3649 {
3650 IUri_Release(This->base_uri);
3651 This->base_uri = NULL;
3652 }
3653
3654 return S_OK;
3655 }
3656
3657 IUnknown_AddRef( punk );
3658
3659 if(This->site)
3660 IUnknown_Release( This->site );
3661
3662 This->site = punk;
3663 This->base_uri = get_base_uri(This->site);
3664
3665 return S_OK;
3666}
IUri * get_base_uri(IUnknown *site)
Definition: httprequest.c:1629
_In_opt_ IUnknown * punk
Definition: shlwapi.h:158

◆ domdoc_onDataAvailable()

static HRESULT domdoc_onDataAvailable ( void obj,
char ptr,
DWORD  len 
)
static

Definition at line 2179 of file domdoc.c.

2180{
2181 domdoc *This = obj;
2182 xmlDocPtr xmldoc;
2183
2185 if(xmldoc) {
2186 xmldoc->_private = create_priv();
2187 return attach_xmldoc(This, xmldoc);
2188 }
2189
2190 return E_FAIL;
2191}

Referenced by domdoc_load_moniker().

◆ domdoc_put_async()

static HRESULT WINAPI domdoc_put_async ( IXMLDOMDocument3 iface,
VARIANT_BOOL  isAsync 
)
static

Definition at line 2441 of file domdoc.c.

2444{
2446
2447 TRACE("(%p)->(%d)\n", This, isAsync);
2448 This->async = isAsync;
2449 return S_OK;
2450}

◆ domdoc_put_dataType()

static HRESULT WINAPI domdoc_put_dataType ( IXMLDOMDocument3 iface,
BSTR  dataTypeName 
)
static

Definition at line 1398 of file domdoc.c.

1401{
1403
1404 FIXME("(%p)->(%s)\n", This, debugstr_w(dataTypeName));
1405
1406 if(!dataTypeName)
1407 return E_INVALIDARG;
1408
1409 return E_FAIL;
1410}

◆ domdoc_put_documentElement()

static HRESULT WINAPI domdoc_put_documentElement ( IXMLDOMDocument3 iface,
IXMLDOMElement DOMElement 
)
static

Definition at line 1672 of file domdoc.c.

1675{
1677 IXMLDOMNode *elementNode;
1678 xmlNodePtr oldRoot;
1679 xmlDocPtr old_doc;
1680 xmlnode *xmlNode;
1681 int refcount = 0;
1682 HRESULT hr;
1683
1684 TRACE("(%p)->(%p)\n", This, DOMElement);
1685
1686 hr = IXMLDOMElement_QueryInterface( DOMElement, &IID_IXMLDOMNode, (void**)&elementNode );
1687 if(FAILED(hr))
1688 return hr;
1689
1690 xmlNode = get_node_obj( elementNode );
1691 if(!xmlNode) return E_FAIL;
1692
1693 if(!xmlNode->node->parent)
1694 if(xmldoc_remove_orphan(xmlNode->node->doc, xmlNode->node) != S_OK)
1695 WARN("%p is not an orphan of %p\n", xmlNode->node->doc, xmlNode->node);
1696
1697 old_doc = xmlNode->node->doc;
1698 if (old_doc != get_doc(This))
1699 refcount = xmlnode_get_inst_cnt(xmlNode);
1700
1701 /* old root is still orphaned by its document, update refcount from new root */
1702 if (refcount) xmldoc_add_refs(get_doc(This), refcount);
1703 oldRoot = xmlDocSetRootElement( get_doc(This), xmlNode->node);
1704 if (refcount) xmldoc_release_refs(old_doc, refcount);
1705 IXMLDOMNode_Release( elementNode );
1706
1707 if(oldRoot)
1708 xmldoc_add_orphan(oldRoot->doc, oldRoot);
1709
1710 return S_OK;
1711}
LONG xmldoc_release_refs(xmlDocPtr doc, LONG refs)
Definition: domdoc.c:624
HRESULT xmldoc_remove_orphan(xmlDocPtr doc, xmlNodePtr node)
Definition: domdoc.c:672
LONG xmldoc_add_refs(xmlDocPtr doc, LONG refs)
Definition: domdoc.c:612
static HTMLDOMNode * get_node_obj(IHTMLDOMNode *)
Definition: htmlnode.c:1045
int xmlnode_get_inst_cnt(xmlnode *node)
Definition: node.c:413
xmlNodePtr node

◆ domdoc_put_nodeTypedValue()

static HRESULT WINAPI domdoc_put_nodeTypedValue ( IXMLDOMDocument3 iface,
VARIANT  typedValue 
)
static

Definition at line 1378 of file domdoc.c.

1381{
1383 FIXME("(%p)->(%s)\n", This, debugstr_variant(&typedValue));
1384 return E_NOTIMPL;
1385}

◆ domdoc_put_nodeValue()

static HRESULT WINAPI domdoc_put_nodeValue ( IXMLDOMDocument3 iface,
VARIANT  value 
)
static

Definition at line 1088 of file domdoc.c.

1091{
1093 TRACE("(%p)->(%s)\n", This, debugstr_variant(&value));
1094 return E_FAIL;
1095}

◆ domdoc_put_onDataAvailable()

static HRESULT WINAPI domdoc_put_onDataAvailable ( IXMLDOMDocument3 iface,
VARIANT  sink 
)
static

Definition at line 2783 of file domdoc.c.

2784{
2786 FIXME("(%p)->(%s): stub\n", This, debugstr_variant(&sink));
2787 return E_NOTIMPL;
2788}

◆ domdoc_put_onreadystatechange()

static HRESULT WINAPI domdoc_put_onreadystatechange ( IXMLDOMDocument3 iface,
VARIANT  event 
)
static

Definition at line 2772 of file domdoc.c.

2775{
2777
2778 TRACE("(%p)->(%s)\n", This, debugstr_variant(&event));
2780}
static HRESULT set_doc_event(domdoc *doc, eventid_t eid, const VARIANT *v)
Definition: domdoc.c:143
struct _cl_event * event
Definition: glext.h:7739

◆ domdoc_put_onTransformNode()

static HRESULT WINAPI domdoc_put_onTransformNode ( IXMLDOMDocument3 iface,
VARIANT  sink 
)
static

Definition at line 2790 of file domdoc.c.

2791{
2793 FIXME("(%p)->(%s): stub\n", This, debugstr_variant(&sink));
2794 return E_NOTIMPL;
2795}

◆ domdoc_put_preserveWhiteSpace()

static HRESULT WINAPI domdoc_put_preserveWhiteSpace ( IXMLDOMDocument3 iface,
VARIANT_BOOL  isPreserving 
)
static

Definition at line 2761 of file domdoc.c.

2764{
2766 TRACE("(%p)->(%d)\n", This, isPreserving);
2767 This->properties->preserving = isPreserving;
2768 return S_OK;
2769}

◆ domdoc_put_resolveExternals()

static HRESULT WINAPI domdoc_put_resolveExternals ( IXMLDOMDocument3 iface,
VARIANT_BOOL  isResolving 
)
static

Definition at line 2739 of file domdoc.c.

2742{
2744 TRACE("(%p)->(%d)\n", This, isResolving);
2745 This->resolving = isResolving;
2746 return S_OK;
2747}

◆ domdoc_put_text()

static HRESULT WINAPI domdoc_put_text ( IXMLDOMDocument3 iface,
BSTR  text 
)
static

Definition at line 1338 of file domdoc.c.

1341{
1343 TRACE("(%p)->(%s)\n", This, debugstr_w(text));
1344 return E_FAIL;
1345}

◆ domdoc_put_validateOnParse()

static HRESULT WINAPI domdoc_put_validateOnParse ( IXMLDOMDocument3 iface,
VARIANT_BOOL  isValidating 
)
static

Definition at line 2717 of file domdoc.c.

2720{
2722 TRACE("(%p)->(%d)\n", This, isValidating);
2723 This->properties->validating = isValidating;
2724 return S_OK;
2725}

◆ domdoc_putref_schemas()

static HRESULT WINAPI domdoc_putref_schemas ( IXMLDOMDocument3 iface,
VARIANT  schema 
)
static

Definition at line 2848 of file domdoc.c.

2851{
2853 HRESULT hr = E_FAIL;
2854 IXMLDOMSchemaCollection2* new_schema = NULL;
2855
2856 FIXME("(%p)->(%s): semi-stub\n", This, debugstr_variant(&schema));
2857 switch(V_VT(&schema))
2858 {
2859 case VT_UNKNOWN:
2860 if (V_UNKNOWN(&schema))
2861 {
2862 hr = IUnknown_QueryInterface(V_UNKNOWN(&schema), &IID_IXMLDOMSchemaCollection, (void**)&new_schema);
2863 break;
2864 }
2865 /* fallthrough */
2866 case VT_DISPATCH:
2867 if (V_DISPATCH(&schema))
2868 {
2869 hr = IDispatch_QueryInterface(V_DISPATCH(&schema), &IID_IXMLDOMSchemaCollection, (void**)&new_schema);
2870 break;
2871 }
2872 /* fallthrough */
2873 case VT_NULL:
2874 case VT_EMPTY:
2875 hr = S_OK;
2876 break;
2877
2878 default:
2879 WARN("Can't get schema from vt %x\n", V_VT(&schema));
2880 }
2881
2882 if(SUCCEEDED(hr))
2883 {
2884 IXMLDOMSchemaCollection2* old_schema = InterlockedExchangePointer((void**)&This->properties->schemaCache, new_schema);
2885 if(old_schema) IXMLDOMSchemaCollection2_Release(old_schema);
2886 }
2887
2888 return hr;
2889}
@ VT_EMPTY
Definition: compat.h:2295
#define InterlockedExchangePointer(Target, Value)
Definition: dshow.h:45

◆ domdoc_QueryInterface()

static HRESULT WINAPI domdoc_QueryInterface ( IXMLDOMDocument3 iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 925 of file domdoc.c.

926{
928
929 TRACE("(%p)->(%s %p)\n", This, debugstr_guid( riid ), ppvObject );
930
931 *ppvObject = NULL;
932
933 if ( IsEqualGUID( riid, &IID_IUnknown ) ||
935 IsEqualGUID( riid, &IID_IXMLDOMNode ) ||
936 IsEqualGUID( riid, &IID_IXMLDOMDocument ) ||
937 IsEqualGUID( riid, &IID_IXMLDOMDocument2 )||
938 IsEqualGUID( riid, &IID_IXMLDOMDocument3 ))
939 {
940 *ppvObject = iface;
941 }
942 else if (IsEqualGUID(&IID_IPersistStream, riid) ||
944 {
945 *ppvObject = &This->IPersistStreamInit_iface;
946 }
948 {
949 *ppvObject = &This->IObjectWithSite_iface;
950 }
951 else if (IsEqualGUID(&IID_IObjectSafety, riid))
952 {
953 *ppvObject = &This->IObjectSafety_iface;
954 }
955 else if( IsEqualGUID( riid, &IID_ISupportErrorInfo ))
956 {
958 }
959 else if(node_query_interface(&This->node, riid, ppvObject))
960 {
961 return *ppvObject ? S_OK : E_NOINTERFACE;
962 }
964 {
965 *ppvObject = &This->IConnectionPointContainer_iface;
966 }
967 else
968 {
969 TRACE("interface %s not implemented\n", debugstr_guid(riid));
970 return E_NOINTERFACE;
971 }
972
973 IUnknown_AddRef((IUnknown*)*ppvObject);
974
975 return S_OK;
976}
static const tid_t domdoc_se_tids[]
Definition: domdoc.c:917
const IID IID_IObjectWithSite
BOOL node_query_interface(xmlnode *, REFIID, void **)
Definition: node.c:66
HRESULT node_create_supporterrorinfo(const tid_t *, void **)
const GUID IID_IConnectionPointContainer
const GUID IID_IPersistStreamInit
const GUID IID_IPersistStream
Definition: proxy.cpp:13

◆ domdoc_Release()

static ULONG WINAPI domdoc_Release ( IXMLDOMDocument3 iface)
static

Definition at line 986 of file domdoc.c.

987{
990
991 TRACE("%p, refcount %ld.\n", iface, ref);
992
993 if (!ref)
994 {
995 int eid;
996
997 if (This->site)
998 IUnknown_Release( This->site );
999 if (This->base_uri)
1000 IUri_Release( This->base_uri );
1001 destroy_xmlnode(&This->node);
1002
1003 for (eid = 0; eid < EVENTID_LAST; eid++)
1004 if (This->events[eid]) IDispatch_Release(This->events[eid]);
1005
1006 properties_release(This->properties);
1008 free(This);
1009 }
1010
1011 return ref;
1012}
#define InterlockedDecrement
Definition: armddk.h:52
void destroy_xmlnode(xmlnode *)
Definition: node.c:1638

◆ domdoc_removeChild()

static HRESULT WINAPI domdoc_removeChild ( IXMLDOMDocument3 iface,
IXMLDOMNode child,
IXMLDOMNode **  oldChild 
)
static

Definition at line 1239 of file domdoc.c.

1243{
1245 TRACE("(%p)->(%p %p)\n", This, child, oldChild);
1246 return node_remove_child(&This->node, child, oldChild);
1247}
HRESULT node_remove_child(xmlnode *, IXMLDOMNode *, IXMLDOMNode **)
Definition: node.c:608

◆ domdoc_replaceChild()

static HRESULT WINAPI domdoc_replaceChild ( IXMLDOMDocument3 iface,
IXMLDOMNode newChild,
IXMLDOMNode oldChild,
IXMLDOMNode **  outOldChild 
)
static

Definition at line 1225 of file domdoc.c.

1230{
1232
1233 TRACE("(%p)->(%p %p %p)\n", This, newChild, oldChild, outOldChild);
1234
1235 return node_replace_child(&This->node, newChild, oldChild, outOldChild);
1236}
HRESULT node_replace_child(xmlnode *, IXMLDOMNode *, IXMLDOMNode *, IXMLDOMNode **)
Definition: node.c:543

◆ domdoc_Safety_AddRef()

static ULONG WINAPI domdoc_Safety_AddRef ( IObjectSafety iface)
static

Definition at line 3683 of file domdoc.c.

3684{
3686 return IXMLDOMDocument3_AddRef(&This->IXMLDOMDocument3_iface);
3687}
static domdoc * impl_from_IObjectSafety(IObjectSafety *iface)
Definition: domdoc.c:742

◆ domdoc_Safety_GetInterfaceSafetyOptions()

static HRESULT WINAPI domdoc_Safety_GetInterfaceSafetyOptions ( IObjectSafety iface,
REFIID  riid,
DWORD supported,
DWORD enabled 
)
static

Definition at line 3697 of file domdoc.c.

3699{
3701
3702 TRACE("(%p)->(%s %p %p)\n", This, debugstr_guid(riid), supported, enabled);
3703
3704 if(!supported || !enabled) return E_POINTER;
3705
3706 *supported = SAFETY_SUPPORTED_OPTIONS;
3707 *enabled = This->safeopt;
3708
3709 return S_OK;
3710}
#define SAFETY_SUPPORTED_OPTIONS
Definition: domdoc.c:3695
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glext.h:7750

◆ domdoc_Safety_QueryInterface()

static HRESULT WINAPI domdoc_Safety_QueryInterface ( IObjectSafety iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 3677 of file domdoc.c.

3678{
3680 return IXMLDOMDocument3_QueryInterface(&This->IXMLDOMDocument3_iface, riid, ppv);
3681}

◆ domdoc_Safety_Release()

static ULONG WINAPI domdoc_Safety_Release ( IObjectSafety iface)
static

Definition at line 3689 of file domdoc.c.

3690{
3692 return IXMLDOMDocument3_Release(&This->IXMLDOMDocument3_iface);
3693}

◆ domdoc_Safety_SetInterfaceSafetyOptions()

static HRESULT WINAPI domdoc_Safety_SetInterfaceSafetyOptions ( IObjectSafety iface,
REFIID  riid,
DWORD  mask,
DWORD  enabled 
)
static

Definition at line 3712 of file domdoc.c.

3714{
3715 domdoc *doc = impl_from_IObjectSafety(iface);
3716
3717 TRACE("%p, %s, %lx, %lx.\n", iface, debugstr_guid(riid), mask, enabled);
3718
3719 if ((mask & ~SAFETY_SUPPORTED_OPTIONS) != 0)
3720 return E_FAIL;
3721
3722 doc->safeopt = (doc->safeopt & ~mask) | (mask & enabled);
3723
3724 return S_OK;
3725}
GLenum GLint GLuint mask
Definition: glext.h:6028
DWORD safeopt
Definition: domdoc.c:129

◆ domdoc_save()

static HRESULT WINAPI domdoc_save ( IXMLDOMDocument3 iface,
VARIANT  destination 
)
static

Definition at line 2612 of file domdoc.c.

2615{
2617 xmlSaveCtxtPtr ctx = NULL;
2618 HRESULT ret = S_OK;
2619
2620 TRACE("(%p)->(%s)\n", This, debugstr_variant(&destination));
2621
2622 switch (V_VT(&destination))
2623 {
2624 case VT_UNKNOWN:
2625 {
2626 IUnknown *pUnk = V_UNKNOWN(&destination);
2627 IXMLDOMDocument3 *document;
2628 IStream *stream;
2629
2630 ret = IUnknown_QueryInterface(pUnk, &IID_IXMLDOMDocument3, (void**)&document);
2631 if(ret == S_OK)
2632 {
2634 BSTR xml;
2635
2636 ret = IXMLDOMDocument3_get_xml(iface, &xml);
2637 if(ret == S_OK)
2638 {
2639 ret = IXMLDOMDocument3_loadXML(document, xml, &success);
2640 SysFreeString(xml);
2641 }
2642
2643 IXMLDOMDocument3_Release(document);
2644 return ret;
2645 }
2646
2647 ret = IUnknown_QueryInterface(pUnk, &IID_IStream, (void**)&stream);
2648 if(ret == S_OK)
2649 {
2650 char *encoding = xmldoc_encoding(iface);
2651
2652 TRACE("using encoding %s\n", encoding ? debugstr_a(encoding) : "default");
2654 domdoc_stream_save_closecallback, stream, encoding, XML_SAVE_NO_DECL);
2655 free(encoding);
2656
2657 if(!ctx)
2658 {
2659 IStream_Release(stream);
2660 return E_FAIL;
2661 }
2662 }
2663 }
2664 break;
2665
2666 case VT_BSTR:
2667 case VT_BSTR | VT_BYREF:
2668 {
2669 char *encoding;
2670 /* save with file path */
2671 HANDLE handle = CreateFileW( (V_VT(&destination) & VT_BYREF)? *V_BSTRREF(&destination) : V_BSTR(&destination),
2674 {
2675 WARN("failed to create file\n");
2676 return E_FAIL;
2677 }
2678
2679 encoding = xmldoc_encoding(iface);
2680 TRACE("using encoding %s\n", encoding ? debugstr_a(encoding) : "default");
2682 handle, encoding, XML_SAVE_NO_DECL);
2683 free(encoding);
2684
2685 if (!ctx)
2686 {
2688 return E_FAIL;
2689 }
2690 }
2691 break;
2692
2693 default:
2694 FIXME("Unhandled VARIANT: %s\n", debugstr_variant(&destination));
2695 return S_FALSE;
2696 }
2697
2698 if (xmlSaveDoc(ctx, get_doc(This)) == -1) ret = S_FALSE;
2699
2700 /* will release resources through close callback */
2701 xmlSaveClose(ctx);
2702
2703 return ret;
2704}
#define CloseHandle
Definition: compat.h:739
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileW
Definition: compat.h:741
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
short VARIANT_BOOL
Definition: compat.h:2290
static int XMLCALL domdoc_save_writecallback(void *ctx, const char *buffer, int len)
Definition: domdoc.c:2512
static char * xmldoc_encoding(IXMLDOMDocument3 *doc)
Definition: domdoc.c:2552
static int XMLCALL domdoc_stream_save_closecallback(void *ctx)
Definition: domdoc.c:2546
static int XMLCALL domdoc_save_closecallback(void *ctx)
Definition: domdoc.c:2525
static int XMLCALL domdoc_stream_save_writecallback(void *ctx, const char *buffer, int len)
Definition: domdoc.c:2530
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
#define debugstr_a
Definition: kernel32.h:31
#define CREATE_ALWAYS
Definition: disk.h:72
#define GENERIC_WRITE
Definition: nt_native.h:90
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
#define success(from, fromstr, to, tostr)

◆ domdoc_save_closecallback()

static int XMLCALL domdoc_save_closecallback ( void ctx)
static

Definition at line 2525 of file domdoc.c.

2526{
2527 return CloseHandle(ctx) ? 0 : -1;
2528}

Referenced by domdoc_save().

◆ domdoc_save_writecallback()

static int XMLCALL domdoc_save_writecallback ( void ctx,
const char buffer,
int  len 
)
static

Definition at line 2512 of file domdoc.c.

2513{
2514 DWORD written = -1;
2515
2516 if(!WriteFile(ctx, buffer, len, &written, NULL))
2517 {
2518 WARN("write error\n");
2519 return -1;
2520 }
2521 else
2522 return written;
2523}
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
GLuint buffer
Definition: glext.h:5915

Referenced by domdoc_save().

◆ domdoc_selectNodes()

static HRESULT WINAPI domdoc_selectNodes ( IXMLDOMDocument3 iface,
BSTR  p,
IXMLDOMNodeList **  outList 
)
static

Definition at line 1483 of file domdoc.c.

1487{
1489 TRACE("(%p)->(%s %p)\n", This, debugstr_w(p), outList);
1490 return node_select_nodes(&This->node, p, outList);
1491}
HRESULT node_select_nodes(const xmlnode *, BSTR, IXMLDOMNodeList **)
Definition: node.c:1558

◆ domdoc_selectSingleNode()

static HRESULT WINAPI domdoc_selectSingleNode ( IXMLDOMDocument3 iface,
BSTR  p,
IXMLDOMNode **  outNode 
)
static

Definition at line 1494 of file domdoc.c.

1498{
1500 TRACE("(%p)->(%s %p)\n", This, debugstr_w(p), outNode);
1501 return node_select_singlenode(&This->node, p, outNode);
1502}
HRESULT node_select_singlenode(const xmlnode *, BSTR, IXMLDOMNode **)
Definition: node.c:1572

◆ domdoc_setProperty()

static HRESULT WINAPI domdoc_setProperty ( IXMLDOMDocument3 iface,
BSTR  p,
VARIANT  value 
)
static

Definition at line 3021 of file domdoc.c.

3025{
3027
3028 TRACE("(%p)->(%s %s)\n", This, debugstr_w(p), debugstr_variant(&value));
3029
3031 {
3032 VARIANT varStr;
3033 HRESULT hr;
3034 BSTR bstr;
3035
3036 V_VT(&varStr) = VT_EMPTY;
3037 if (V_VT(&value) != VT_BSTR)
3038 {
3039 if (FAILED(hr = VariantChangeType(&varStr, &value, 0, VT_BSTR)))
3040 return hr;
3041 bstr = V_BSTR(&varStr);
3042 }
3043 else
3044 bstr = V_BSTR(&value);
3045
3046 hr = S_OK;
3047 if (lstrcmpiW(bstr, PropValueXPathW) == 0)
3048 This->properties->XPath = TRUE;
3049 else if (lstrcmpiW(bstr, PropValueXSLPatternW) == 0)
3050 This->properties->XPath = FALSE;
3051 else
3052 hr = E_FAIL;
3053
3054 VariantClear(&varStr);
3055 return hr;
3056 }
3058 {
3059 xmlChar *nsStr = (xmlChar*)This->properties->selectNsStr;
3060 struct list *pNsList;
3061 VARIANT varStr;
3062 HRESULT hr;
3063 BSTR bstr;
3064
3065 V_VT(&varStr) = VT_EMPTY;
3066 if (V_VT(&value) != VT_BSTR)
3067 {
3068 if (FAILED(hr = VariantChangeType(&varStr, &value, 0, VT_BSTR)))
3069 return hr;
3070 bstr = V_BSTR(&varStr);
3071 }
3072 else
3073 bstr = V_BSTR(&value);
3074
3075 hr = S_OK;
3076
3077 pNsList = &(This->properties->selectNsList);
3078 clear_selectNsList(pNsList);
3079 free(nsStr);
3080 nsStr = xmlchar_from_wchar(bstr);
3081
3082 TRACE("property value: \"%s\"\n", debugstr_w(bstr));
3083
3084 This->properties->selectNsStr = nsStr;
3085 This->properties->selectNsStr_len = xmlStrlen(nsStr);
3086 if (bstr && *bstr)
3087 {
3088 xmlChar *pTokBegin, *pTokEnd, *pTokInner;
3089 select_ns_entry* ns_entry = NULL;
3090 xmlXPathContextPtr ctx;
3091
3092 ctx = xmlXPathNewContext(This->node.node->doc);
3093 pTokBegin = nsStr;
3094
3095 /* skip leading spaces */
3096 while (*pTokBegin == ' ' || *pTokBegin == '\n' ||
3097 *pTokBegin == '\t' || *pTokBegin == '\r')
3098 ++pTokBegin;
3099
3100 for (; *pTokBegin; pTokBegin = pTokEnd)
3101 {
3102 if (ns_entry)
3103 memset(ns_entry, 0, sizeof(select_ns_entry));
3104 else
3105 ns_entry = calloc(1, sizeof(select_ns_entry));
3106
3107 while (*pTokBegin == ' ')
3108 ++pTokBegin;
3109 pTokEnd = pTokBegin;
3110 while (*pTokEnd != ' ' && *pTokEnd != 0)
3111 ++pTokEnd;
3112
3113 /* so it failed to advance which means we've got some trailing spaces */
3114 if (pTokEnd == pTokBegin) break;
3115
3116 if (xmlStrncmp(pTokBegin, (xmlChar const*)"xmlns", 5) != 0)
3117 {
3118 hr = E_FAIL;
3119 WARN("Syntax error in xmlns string: %s\n\tat token: %s\n",
3120 debugstr_w(bstr), debugstr_an((const char*)pTokBegin, pTokEnd-pTokBegin));
3121 continue;
3122 }
3123
3124 pTokBegin += 5;
3125 if (*pTokBegin == '=')
3126 {
3127 /*valid for XSLPattern?*/
3128 FIXME("Setting default xmlns not supported - skipping.\n");
3129 continue;
3130 }
3131 else if (*pTokBegin == ':')
3132 {
3133 ns_entry->prefix = ++pTokBegin;
3134 for (pTokInner = pTokBegin; pTokInner != pTokEnd && *pTokInner != '='; ++pTokInner)
3135 ;
3136
3137 if (pTokInner == pTokEnd)
3138 {
3139 hr = E_FAIL;
3140 WARN("Syntax error in xmlns string: %s\n\tat token: %s\n",
3141 debugstr_w(bstr), debugstr_an((const char*)pTokBegin, pTokEnd-pTokBegin));
3142 continue;
3143 }
3144
3145 ns_entry->prefix_end = *pTokInner;
3146 *pTokInner = 0;
3147 ++pTokInner;
3148
3149 if (pTokEnd-pTokInner > 1 &&
3150 ((*pTokInner == '\'' && *(pTokEnd-1) == '\'') ||
3151 (*pTokInner == '"' && *(pTokEnd-1) == '"')))
3152 {
3153 ns_entry->href = ++pTokInner;
3154 ns_entry->href_end = *(pTokEnd-1);
3155 *(pTokEnd-1) = 0;
3156 list_add_tail(pNsList, &ns_entry->entry);
3157 /*let libxml figure out if they're valid from here ;)*/
3158 if (xmlXPathRegisterNs(ctx, ns_entry->prefix, ns_entry->href) != 0)
3159 {
3160 hr = E_FAIL;
3161 }
3162 ns_entry = NULL;
3163 continue;
3164 }
3165 else
3166 {
3167 WARN("Syntax error in xmlns string: %s\n\tat token: %s\n",
3168 debugstr_w(bstr), debugstr_an((const char*)pTokInner, pTokEnd-pTokInner));
3169 list_add_tail(pNsList, &ns_entry->entry);
3170
3171 ns_entry = NULL;
3172 hr = E_FAIL;
3173 continue;
3174 }
3175 }
3176 else
3177 {
3178 hr = E_FAIL;
3179 continue;
3180 }
3181 }
3182 free(ns_entry);
3183 xmlXPathFreeContext(ctx);
3184 }
3185
3186 VariantClear(&varStr);
3187 return hr;
3188 }
3189 else if (lstrcmpiW(p, PropertyValidateOnParse) == 0)
3190 {
3191 if (This->properties->version < MSXML4)
3192 return E_FAIL;
3193 else
3194 {
3195 This->properties->validating = V_BOOL(&value);
3196 return S_OK;
3197 }
3198 }
3199 else if (lstrcmpiW(p, PropertyProhibitDTDW) == 0 ||
3206 {
3207 /* Ignore */
3208 FIXME("Ignoring property %s, value %s\n", debugstr_w(p), debugstr_variant(&value));
3209 return S_OK;
3210 }
3211
3212 FIXME("Unknown property %s\n", debugstr_w(p));
3213 return E_FAIL;
3214}
#define FALSE
Definition: types.h:117
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:55
static void clear_selectNsList(struct list *pNsList)
Definition: domdoc.c:252
static const WCHAR PropertyResolveExternalsW[]
Definition: domdoc.c:58
static const WCHAR PropertyAllowDocumentFunctionW[]
Definition: domdoc.c:60
static const WCHAR PropertyAllowXsltScriptW[]
Definition: domdoc.c:59
static const WCHAR PropertyMaxElementDepth[]
Definition: domdoc.c:63
static const WCHAR PropertyNormalizeAttributeValuesW[]
Definition: domdoc.c:61
static const WCHAR PropertyProhibitDTDW[]
Definition: domdoc.c:54
static const WCHAR PropertyNewParserW[]
Definition: domdoc.c:55
#define memset(x, y, z)
Definition: compat.h:39
HRESULT WINAPI DECLSPEC_HOTPATCH VariantChangeType(VARIANTARG *pvargDest, VARIANTARG *pvargSrc, USHORT wFlags, VARTYPE vt)
Definition: variant.c:962
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
XMLPUBFUN int xmlStrlen(const xmlChar *str)
Definition: xmlstring.c:428
XMLPUBFUN int xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len)
Definition: xmlstring.c:215

◆ domdoc_stream_save_closecallback()

static int XMLCALL domdoc_stream_save_closecallback ( void ctx)
static

Definition at line 2546 of file domdoc.c.

2547{
2548 IStream_Release((IStream*)ctx);
2549 return 0;
2550}

Referenced by domdoc_save().

◆ domdoc_stream_save_writecallback()

static int XMLCALL domdoc_stream_save_writecallback ( void ctx,
const char buffer,
int  len 
)
static

Definition at line 2530 of file domdoc.c.

2531{
2532 ULONG written = 0;
2533 HRESULT hr;
2534
2535 hr = IStream_Write((IStream*)ctx, buffer, len, &written);
2536 TRACE("hr %#lx, %p, %d, %lu.\n", hr, buffer, len, written);
2537 if (hr != S_OK)
2538 {
2539 WARN("stream write error, hr %#lx.\n", hr);
2540 return -1;
2541 }
2542 else
2543 return len;
2544}

Referenced by domdoc_save().

◆ domdoc_transformNode()

static HRESULT WINAPI domdoc_transformNode ( IXMLDOMDocument3 iface,
IXMLDOMNode node,
BSTR p 
)
static

Definition at line 1472 of file domdoc.c.

1476{
1478 TRACE("(%p)->(%p %p)\n", This, node, p);
1479 return node_transform_node(&This->node, node, p);
1480}
HRESULT node_transform_node(const xmlnode *, IXMLDOMNode *, BSTR *)
Definition: node.c:1553

◆ domdoc_transformNodeToObject()

static HRESULT WINAPI domdoc_transformNodeToObject ( IXMLDOMDocument3 iface,
IXMLDOMNode stylesheet,
VARIANT  output 
)
static

Definition at line 1544 of file domdoc.c.

1548{
1550
1551 TRACE("(%p)->(%p %s)\n", This, stylesheet, debugstr_variant(&output));
1552
1553 switch (V_VT(&output))
1554 {
1555 case VT_UNKNOWN:
1556 case VT_DISPATCH:
1557 {
1559 IXMLDOMDocument *doc;
1560 HRESULT hr;
1561 BSTR str;
1562
1563 if (!V_UNKNOWN(&output))
1564 return E_INVALIDARG;
1565
1566 /* FIXME: we're not supposed to query for document interface, should use IStream
1567 which we don't support currently. */
1568 if (IUnknown_QueryInterface(V_UNKNOWN(&output), &IID_IXMLDOMDocument, (void **)&doc) == S_OK)
1569 {
1571
1572 if (FAILED(hr = node_transform_node(&This->node, stylesheet, &str)))
1573 return hr;
1574
1575 hr = IXMLDOMDocument_loadXML(doc, str, &b);
1577 return hr;
1578 }
1579 else if (IUnknown_QueryInterface(V_UNKNOWN(&output), &IID_ISequentialStream, (void**)&stream) == S_OK)
1580 {
1581 hr = node_transform_node_params(&This->node, stylesheet, NULL, stream, NULL);
1582 ISequentialStream_Release(stream);
1583 return hr;
1584 }
1585 else
1586 {
1587 FIXME("Unsupported destination type.\n");
1588 return E_INVALIDARG;
1589 }
1590 }
1591 default:
1592 FIXME("Output type %d not handled.\n", V_VT(&output));
1593 return E_NOTIMPL;
1594 }
1595
1596 return E_NOTIMPL;
1597}
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define b
Definition: ke_i.h:79
HRESULT node_transform_node_params(const xmlnode *, IXMLDOMNode *, BSTR *, ISequentialStream *, const struct xslprocessor_params *)
Definition: node.c:1480

◆ domdoc_validate()

static HRESULT WINAPI domdoc_validate ( IXMLDOMDocument3 iface,
IXMLDOMParseError **  err 
)
static

Definition at line 3012 of file domdoc.c.

3015{
3017 TRACE("(%p)->(%p)\n", This, err);
3018 return IXMLDOMDocument3_validateNode(iface, (IXMLDOMNode*)iface, err);
3019}

◆ domdoc_validateNode()

static HRESULT WINAPI domdoc_validateNode ( IXMLDOMDocument3 iface,
IXMLDOMNode node,
IXMLDOMParseError **  err 
)
static

Definition at line 2912 of file domdoc.c.

2916{
2918 LONG state, err_code = 0;
2919 HRESULT hr = S_OK;
2920 int validated = 0;
2921
2922 TRACE("(%p)->(%p, %p)\n", This, node, err);
2923 IXMLDOMDocument3_get_readyState(iface, &state);
2924 if (state != READYSTATE_COMPLETE)
2925 {
2926 if (err)
2927 *err = create_parseError(err_code, NULL, NULL, NULL, 0, 0, 0);
2928 return E_PENDING;
2929 }
2930
2931 if (!node)
2932 {
2933 if (err)
2934 *err = create_parseError(err_code, NULL, NULL, NULL, 0, 0, 0);
2935 return E_POINTER;
2936 }
2937
2938 if (!get_node_obj(node)->node || get_node_obj(node)->node->doc != get_doc(This))
2939 {
2940 if (err)
2941 *err = create_parseError(err_code, NULL, NULL, NULL, 0, 0, 0);
2942 return E_FAIL;
2943 }
2944
2945 if (!is_wellformed(get_doc(This)))
2946 {
2947 ERR("doc not well-formed\n");
2948 if (err)
2949 *err = create_parseError(E_XML_NOTWF, NULL, NULL, NULL, 0, 0, 0);
2950 return S_FALSE;
2951 }
2952
2953 /* DTD validation */
2954 if (get_doc(This)->intSubset || get_doc(This)->extSubset)
2955 {
2956 xmlValidCtxtPtr vctx = xmlNewValidCtxt();
2957 vctx->error = validate_error;
2958 vctx->warning = validate_warning;
2959 ++validated;
2960
2961 if (!((node == (IXMLDOMNode*)iface)?
2962 xmlValidateDocument(vctx, get_doc(This)) :
2963 xmlValidateElement(vctx, get_doc(This), get_node_obj(node)->node)))
2964 {
2965 /* TODO: get a real error code here */
2966 TRACE("DTD validation failed\n");
2967 err_code = E_XML_INVALID;
2968 hr = S_FALSE;
2969 }
2970 xmlFreeValidCtxt(vctx);
2971 }
2972
2973 /* Schema validation */
2974 if (hr == S_OK && This->properties->schemaCache != NULL)
2975 {
2976
2977 hr = SchemaCache_validate_tree(This->properties->schemaCache, get_node_obj(node)->node);
2978 if (SUCCEEDED(hr))
2979 {
2980 ++validated;
2981 /* TODO: get a real error code here */
2982 if (hr == S_OK)
2983 {
2984 TRACE("schema validation succeeded\n");
2985 }
2986 else
2987 {
2988 ERR("schema validation failed\n");
2989 err_code = E_XML_INVALID;
2990 }
2991 }
2992 else
2993 {
2994 /* not really OK, just didn't find a schema for the ns */
2995 hr = S_OK;
2996 }
2997 }
2998
2999 if (!validated)
3000 {
3001 ERR("no DTD or schema found\n");
3002 err_code = E_XML_NODTD;
3003 hr = S_FALSE;
3004 }
3005
3006 if (err)
3007 *err = create_parseError(err_code, NULL, NULL, NULL, 0, 0, 0);
3008
3009 return hr;
3010}
static int state
Definition: maze.c:121
#define E_PENDING
Definition: dinput.h:172
static void LIBXML2_LOG_CALLBACK validate_warning(void *ctx, char const *msg,...)
Definition: domdoc.c:2904
static void LIBXML2_LOG_CALLBACK validate_error(void *ctx, char const *msg,...)
Definition: domdoc.c:2896
static BOOL is_wellformed(xmlDocPtr doc)
Definition: domdoc.c:2891
HRESULT SchemaCache_validate_tree(IXMLDOMSchemaCollection2 *, xmlNodePtr)
Definition: schema.c:1537
xmlValidCtxt * xmlValidCtxtPtr
Definition: valid.h:68

Referenced by validate_error(), and validate_warning().

◆ doparse()

static xmlDocPtr doparse ( domdoc This,
char const ptr,
int  len,
xmlCharEncoding  encoding 
)
static

Definition at line 502 of file domdoc.c.

503{
504 char *ctx_encoding;
505 xmlDocPtr doc = NULL;
506 xmlParserCtxtPtr pctx;
507 static xmlSAXHandler sax_handler = {
508 xmlSAX2InternalSubset, /* internalSubset */
509 xmlSAX2IsStandalone, /* isStandalone */
510 xmlSAX2HasInternalSubset, /* hasInternalSubset */
511 xmlSAX2HasExternalSubset, /* hasExternalSubset */
512 xmlSAX2ResolveEntity, /* resolveEntity */
513 xmlSAX2GetEntity, /* getEntity */
514 xmlSAX2EntityDecl, /* entityDecl */
515 xmlSAX2NotationDecl, /* notationDecl */
516 xmlSAX2AttributeDecl, /* attributeDecl */
517 xmlSAX2ElementDecl, /* elementDecl */
518 xmlSAX2UnparsedEntityDecl, /* unparsedEntityDecl */
519 xmlSAX2SetDocumentLocator, /* setDocumentLocator */
520 xmlSAX2StartDocument, /* startDocument */
521 xmlSAX2EndDocument, /* endDocument */
522 xmlSAX2StartElement, /* startElement */
523 xmlSAX2EndElement, /* endElement */
524 xmlSAX2Reference, /* reference */
525 sax_characters, /* characters */
526 sax_characters, /* ignorableWhitespace */
527 xmlSAX2ProcessingInstruction, /* processingInstruction */
528 xmlSAX2Comment, /* comment */
529 sax_warning, /* warning */
530 sax_error, /* error */
531 sax_error, /* fatalError */
532 xmlSAX2GetParameterEntity, /* getParameterEntity */
533 xmlSAX2CDataBlock, /* cdataBlock */
534 xmlSAX2ExternalSubset, /* externalSubset */
535 0, /* initialized */
536 NULL, /* _private */
537 xmlSAX2StartElementNs, /* startElementNs */
538 xmlSAX2EndElementNs, /* endElementNs */
539 sax_serror /* serror */
540 };
541
543 if (!pctx)
544 {
545 ERR("Failed to create parser context\n");
546 return NULL;
547 }
548
549 if (pctx->sax) xmlFree(pctx->sax);
550 pctx->sax = &sax_handler;
551 pctx->_private = This;
552 pctx->recovery = 0;
553
554 if (encoding != XML_CHAR_ENCODING_NONE)
555 xmlSwitchEncoding(pctx, encoding);
556
557 xmlParseDocument(pctx);
558
559 if (pctx->wellFormed)
560 {
561 doc = pctx->myDoc;
562 }
563 else
564 {
565 xmlFreeDoc(pctx->myDoc);
566 pctx->myDoc = NULL;
567 }
568 pctx->sax = NULL;
569 ctx_encoding = (char *)pctx->encoding;
570 pctx->encoding = NULL;
571 xmlFreeParserCtxt(pctx);
572
573 /* TODO: put this in one of the SAX callbacks */
574 /* create first child as a <?xml...?> */
575 if (doc && doc->standalone != -1)
576 {
577 xmlNodePtr node;
578 char buff[30];
579 xmlChar *xmlbuff = (xmlChar*)buff;
580
581 node = xmlNewDocPI( doc, (xmlChar*)"xml", NULL );
582
583 /* version attribute can't be omitted */
584 sprintf(buff, "version=\"%s\"", doc->version ? (char*)doc->version : "1.0");
585 xmlNodeAddContent( node, xmlbuff );
586
587 if (ctx_encoding)
588 {
589 sprintf(buff, " encoding=\"%s\"", ctx_encoding);
590 xmlNodeAddContent( node, xmlbuff );
591 }
592
593 if (doc->standalone != -2)
594 {
595 sprintf(buff, " standalone=\"%s\"", doc->standalone == 0 ? "no" : "yes");
596 xmlNodeAddContent( node, xmlbuff );
597 }
598
600 }
601
602 xmlFree( ctx_encoding );
603 return doc;
604}
XMLPUBFUN void xmlSAX2StartDocument(void *ctx)
Definition: SAX2.c:887
XMLPUBFUN void xmlSAX2EntityDecl(void *ctx, const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, xmlChar *content)
Definition: SAX2.c:588
XMLPUBFUN void xmlSAX2UnparsedEntityDecl(void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId, const xmlChar *notationName)
Definition: SAX2.c:813
XMLPUBFUN void xmlSAX2EndDocument(void *ctx)
Definition: SAX2.c:944
XMLPUBFUN xmlEntityPtr xmlSAX2GetParameterEntity(void *ctx, const xmlChar *name)
Definition: SAX2.c:564
XMLPUBFUN void xmlSAX2Comment(void *ctx, const xmlChar *value)
Definition: SAX2.c:2614
XMLPUBFUN void xmlSAX2ElementDecl(void *ctx, const xmlChar *name, int type, xmlElementContentPtr content)
Definition: SAX2.c:720
XMLPUBFUN int xmlSAX2HasInternalSubset(void *ctx)
Definition: SAX2.c:291
XMLPUBFUN void xmlSAX2AttributeDecl(void *ctx, const xmlChar *elem, const xmlChar *fullname, int type, int def, const xmlChar *defaultValue, xmlEnumerationPtr tree)
Definition: SAX2.c:653
XMLPUBFUN void xmlSAX2NotationDecl(void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId)
Definition: SAX2.c:764
XMLPUBFUN int xmlSAX2IsStandalone(void *ctx)
Definition: SAX2.c:275
XMLPUBFUN void xmlSAX2CDataBlock(void *ctx, const xmlChar *value, int len)
Definition: SAX2.c:2660
XMLPUBFUN void xmlSAX2ExternalSubset(void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID)
Definition: SAX2.c:357
XMLPUBFUN void xmlSAX2StartElementNs(void *ctx, const xmlChar *localname, const xmlChar *prefix, const xmlChar *URI, int nb_namespaces, const xmlChar **namespaces, int nb_attributes, int nb_defaulted, const xmlChar **attributes)
Definition: SAX2.c:2077
XMLPUBFUN xmlParserInputPtr xmlSAX2ResolveEntity(void *ctx, const xmlChar *publicId, const xmlChar *systemId)
Definition: SAX2.c:486
XMLPUBFUN void xmlSAX2InternalSubset(void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID)
Definition: SAX2.c:324
XMLPUBFUN void xmlSAX2EndElementNs(void *ctx, const xmlChar *localname, const xmlChar *prefix, const xmlChar *URI)
XMLPUBFUN void xmlSAX2ProcessingInstruction(void *ctx, const xmlChar *target, const xmlChar *data)
Definition: SAX2.c:2567
XMLPUBFUN void xmlSAX2Reference(void *ctx, const xmlChar *name)
Definition: SAX2.c:2379
XMLPUBFUN void xmlSAX2SetDocumentLocator(void *ctx, xmlSAXLocatorPtr loc)
XMLPUBFUN int xmlSAX2HasExternalSubset(void *ctx)
Definition: SAX2.c:307
XMLPUBFUN xmlEntityPtr xmlSAX2GetEntity(void *ctx, const xmlChar *name)
Definition: SAX2.c:518
static void sax_serror(void *ctx, const xmlError *err)
Definition: domdoc.c:497
void xmldoc_link_xmldecl(xmlDocPtr doc, xmlNodePtr node)
Definition: domdoc.c:386
static void LIBXML2_LOG_CALLBACK sax_error(void *ctx, char const *msg,...)
Definition: domdoc.c:481
static void sax_characters(void *ctx, const xmlChar *ch, int len)
Definition: domdoc.c:438
static void LIBXML2_LOG_CALLBACK sax_warning(void *ctx, char const *msg,...)
Definition: domdoc.c:489
static unsigned char buff[32768]
Definition: fatten.c:17
#define sprintf
Definition: sprintf.c:45
XMLPUBFUN xmlParserCtxtPtr xmlCreateMemoryParserCtxt(const char *buffer, int size)
Definition: parser.c:13996
XMLPUBFUN int xmlSwitchEncoding(xmlParserCtxtPtr ctxt, xmlCharEncoding enc)
XMLPUBFUN int xmlParseDocument(xmlParserCtxtPtr ctxt)
Definition: parser.c:11009
XMLPUBFUN void xmlFreeParserCtxt(xmlParserCtxtPtr ctxt)

Referenced by domdoc_load(), domdoc_load_from_stream(), domdoc_loadXML(), domdoc_onDataAvailable(), sax_error(), sax_serror(), and sax_warning().

◆ get_doc()

static xmlDocPtr get_doc ( domdoc This)
inlinestatic

◆ get_domdoc_from_xmldoc()

HRESULT get_domdoc_from_xmldoc ( xmlDocPtr  xmldoc,
IXMLDOMDocument3 **  document 
)

Definition at line 3749 of file domdoc.c.

3750{
3751 domdoc *doc;
3752
3753 doc = malloc(sizeof(*doc));
3754 if( !doc )
3755 return E_OUTOFMEMORY;
3756
3762 doc->ref = 1;
3763 doc->async = VARIANT_TRUE;
3764 doc->resolving = 0;
3766 doc->error = S_OK;
3767 doc->site = NULL;
3768 doc->base_uri = NULL;
3769 doc->safeopt = 0;
3770 doc->cp_list = NULL;
3771 doc->namespaces = NULL;
3772 memset(doc->events, 0, sizeof(doc->events));
3773
3774 /* events connection points */
3777 ConnectionPoint_Init(&doc->cp_domdocevents, doc, &DIID_XMLDOMDocumentEvents);
3778
3779 init_xmlnode(&doc->node, (xmlNodePtr)xmldoc, (IXMLDOMNode*)&doc->IXMLDOMDocument3_iface,
3780 &domdoc_dispex);
3781
3782 *document = &doc->IXMLDOMDocument3_iface;
3783
3784 TRACE("returning iface %p\n", *document);
3785 return S_OK;
3786}
static void ConnectionPoint_Init(ConnectionPoint *cp, struct domdoc *doc, REFIID riid)
Definition: domdoc.c:3588
static const IObjectSafetyVtbl domdocObjectSafetyVtbl
Definition: domdoc.c:3729
static const IPersistStreamInitVtbl xmldoc_IPersistStreamInit_VTable
Definition: domdoc.c:902
static dispex_static_data_t domdoc_dispex
Definition: domdoc.c:3742
static const struct IConnectionPointContainerVtbl ConnectionPointContainerVtbl
Definition: domdoc.c:3441
static const IObjectWithSiteVtbl domdocObjectSite
Definition: domdoc.c:3668
static const struct IXMLDOMDocument3Vtbl XMLDOMDocument3Vtbl
Definition: domdoc.c:3298
void init_xmlnode(xmlnode *, xmlNodePtr, IXMLDOMNode *, dispex_static_data_t *)
Definition: node.c:1647
IUri * base_uri
Definition: domdoc.c:126
VARIANT_BOOL async
Definition: domdoc.c:119
ConnectionPoint cp_propnotif
Definition: domdoc.c:134
IPersistStreamInit IPersistStreamInit_iface
Definition: domdoc.c:114
ConnectionPoint cp_domdocevents
Definition: domdoc.c:133
IXMLDOMSchemaCollection2 * namespaces
Definition: domdoc.c:140
xmlnode node
Definition: domdoc.c:112
ConnectionPoint cp_dispatch
Definition: domdoc.c:135
HRESULT error
Definition: domdoc.c:122
IObjectSafety IObjectSafety_iface
Definition: domdoc.c:116
IDispatch * events[EVENTID_LAST]
Definition: domdoc.c:138
domdoc_properties * properties
Definition: domdoc.c:121
IObjectWithSite IObjectWithSite_iface
Definition: domdoc.c:115
VARIANT_BOOL resolving
Definition: domdoc.c:120
IXMLDOMDocument3 IXMLDOMDocument3_iface
Definition: domdoc.c:113
IUnknown * site
Definition: domdoc.c:125

Referenced by create_domdoc(), dom_document_create(), node_get_owner_doc(), and schema_cache_get().

◆ get_node_type()

static HRESULT get_node_type ( VARIANT  Type,
DOMNodeType type 
)
static

Definition at line 2027 of file domdoc.c.

2028{
2029 VARIANT tmp;
2030 HRESULT hr;
2031
2032 VariantInit(&tmp);
2033 hr = VariantChangeType(&tmp, &Type, 0, VT_I4);
2034 if(FAILED(hr))
2035 return E_INVALIDARG;
2036
2037 *type = V_I4(&tmp);
2038
2039 return S_OK;
2040}
@ VT_I4
Definition: compat.h:2298
#define V_I4(A)
Definition: oleauto.h:247
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568

◆ impl_from_IConnectionPoint()

static ConnectionPoint * impl_from_IConnectionPoint ( IConnectionPoint iface)
inlinestatic

◆ impl_from_IConnectionPointContainer()

static domdoc * impl_from_IConnectionPointContainer ( IConnectionPointContainer iface)
inlinestatic

◆ impl_from_IObjectSafety()

static domdoc * impl_from_IObjectSafety ( IObjectSafety iface)
inlinestatic

◆ impl_from_IObjectWithSite()

static domdoc * impl_from_IObjectWithSite ( IObjectWithSite iface)
inlinestatic

◆ impl_from_IPersistStreamInit()

◆ impl_from_IXMLDOMDocument3()

static domdoc * impl_from_IXMLDOMDocument3 ( IXMLDOMDocument3 iface)
inlinestatic

Definition at line 727 of file domdoc.c.

728{
729 return CONTAINING_RECORD(iface, domdoc, IXMLDOMDocument3_iface);
730}

Referenced by domdoc_abort(), domdoc_AddRef(), domdoc_appendChild(), domdoc_cloneNode(), domdoc_createAttribute(), domdoc_createCDATASection(), domdoc_createComment(), domdoc_createDocumentFragment(), domdoc_createElement(), domdoc_createEntityReference(), domdoc_createNode(), domdoc_createProcessingInstruction(), domdoc_createTextNode(), domdoc_get_async(), domdoc_get_attributes(), domdoc_get_baseName(), domdoc_get_childNodes(), domdoc_get_dataType(), domdoc_get_definition(), domdoc_get_doctype(), domdoc_get_documentElement(), domdoc_get_firstChild(), domdoc_get_implementation(), domdoc_get_lastChild(), domdoc_get_namespaces(), domdoc_get_namespaceURI(), domdoc_get_nextSibling(), domdoc_get_nodeName(), domdoc_get_nodeType(), domdoc_get_nodeTypedValue(), domdoc_get_nodeTypeString(), domdoc_get_nodeValue(), domdoc_get_ownerDocument(), domdoc_get_parentNode(), domdoc_get_parsed(), domdoc_get_parseError(), domdoc_get_prefix(), domdoc_get_preserveWhiteSpace(), domdoc_get_previousSibling(), domdoc_get_readyState(), domdoc_get_resolveExternals(), domdoc_get_schemas(), domdoc_get_specified(), domdoc_get_text(), domdoc_get_url(), domdoc_get_validateOnParse(), domdoc_get_xml(), domdoc_getElementsByTagName(), domdoc_GetIDsOfNames(), domdoc_getProperty(), domdoc_GetTypeInfo(), domdoc_GetTypeInfoCount(), domdoc_hasChildNodes(), domdoc_importNode(), domdoc_insertBefore(), domdoc_Invoke(), domdoc_load(), domdoc_loadXML(), domdoc_nodeFromID(), domdoc_put_async(), domdoc_put_dataType(), domdoc_put_documentElement(), domdoc_put_nodeTypedValue(), domdoc_put_nodeValue(), domdoc_put_onDataAvailable(), domdoc_put_onreadystatechange(), domdoc_put_onTransformNode(), domdoc_put_preserveWhiteSpace(), domdoc_put_resolveExternals(), domdoc_put_text(), domdoc_put_validateOnParse(), domdoc_putref_schemas(), domdoc_QueryInterface(), domdoc_Release(), domdoc_removeChild(), domdoc_replaceChild(), domdoc_save(), domdoc_selectNodes(), domdoc_selectSingleNode(), domdoc_setProperty(), domdoc_transformNode(), domdoc_transformNodeToObject(), domdoc_validate(), and domdoc_validateNode().

◆ is_preserving_whitespace()

BOOL is_preserving_whitespace ( xmlNodePtr  node)

Definition at line 419 of file domdoc.c.

420{
421 domdoc_properties* properties = NULL;
422 /* during parsing the xmlDoc._private stuff is not there */
423 if (priv_from_xmlDocPtr(node->doc))
424 properties = properties_from_xmlDocPtr(node->doc);
425 return ((properties && properties->preserving == VARIANT_TRUE) ||
426 xmlNodeGetSpacePreserve(node) == 1);
427}

Referenced by do_get_text(), and sax_characters().

◆ is_wellformed()

static BOOL is_wellformed ( xmlDocPtr  doc)
inlinestatic

Definition at line 2891 of file domdoc.c.

2892{
2893 return doc->properties & XML_DOC_WELLFORMED;
2894}

Referenced by domdoc_validateNode().

◆ is_xpathmode()

BOOL is_xpathmode ( const xmlDocPtr  doc)

Definition at line 225 of file domdoc.c.

226{
227 return properties_from_xmlDocPtr(doc)->XPath;
228}

Referenced by create_selection(), and domelem_getElementsByTagName().

◆ PersistStreamInit_AddRef()

static ULONG WINAPI PersistStreamInit_AddRef ( IPersistStreamInit iface)
static

Definition at line 762 of file domdoc.c.

764{
766 return IXMLDOMDocument3_AddRef(&This->IXMLDOMDocument3_iface);
767}
static domdoc * impl_from_IPersistStreamInit(IPersistStreamInit *iface)
Definition: domdoc.c:732

◆ PersistStreamInit_GetClassID()

static HRESULT WINAPI PersistStreamInit_GetClassID ( IPersistStreamInit iface,
CLSID classid 
)
static

Definition at line 776 of file domdoc.c.

778{
780 TRACE("(%p)->(%p)\n", This, classid);
781
782 if(!classid)
783 return E_POINTER;
784
785 *classid = *DOMDocument_version(This->properties->version);
786
787 return S_OK;
788}
const CLSID * DOMDocument_version(MSXML_VERSION v)
Definition: main.c:348

◆ PersistStreamInit_GetSizeMax()

static HRESULT WINAPI PersistStreamInit_GetSizeMax ( IPersistStreamInit iface,
ULARGE_INTEGER pcbSize 
)
static

Definition at line 886 of file domdoc.c.

888{
890 TRACE("(%p)->(%p)\n", This, pcbSize);
891 return E_NOTIMPL;
892}

◆ PersistStreamInit_InitNew()

static HRESULT WINAPI PersistStreamInit_InitNew ( IPersistStreamInit iface)
static

Definition at line 894 of file domdoc.c.

896{
898 TRACE("(%p)\n", This);
899 return S_OK;
900}

◆ PersistStreamInit_IsDirty()

static HRESULT WINAPI PersistStreamInit_IsDirty ( IPersistStreamInit iface)
static

Definition at line 790 of file domdoc.c.

792{
794 FIXME("(%p): stub!\n", This);
795 return S_FALSE;
796}

◆ PersistStreamInit_Load()

static HRESULT WINAPI PersistStreamInit_Load ( IPersistStreamInit iface,
IStream stream 
)
static

Definition at line 851 of file domdoc.c.

852{
854
855 TRACE("(%p)->(%p)\n", This, stream);
856
857 if (!stream)
858 return E_INVALIDARG;
859
861}

◆ PersistStreamInit_QueryInterface()

static HRESULT WINAPI PersistStreamInit_QueryInterface ( IPersistStreamInit iface,
REFIID  riid,
void **  ppvObj 
)
static

Definition at line 755 of file domdoc.c.

757{
759 return IXMLDOMDocument3_QueryInterface(&This->IXMLDOMDocument3_iface, riid, ppvObj);
760}

◆ PersistStreamInit_Release()

static ULONG WINAPI PersistStreamInit_Release ( IPersistStreamInit iface)
static

Definition at line 769 of file domdoc.c.

771{
773 return IXMLDOMDocument3_Release(&This->IXMLDOMDocument3_iface);
774}

◆ PersistStreamInit_Save()

static HRESULT WINAPI PersistStreamInit_Save ( IPersistStreamInit iface,
IStream stream,
BOOL  clr_dirty 
)
static

Definition at line 863 of file domdoc.c.

865{
867 BSTR xmlString;
868 HRESULT hr;
869
870 TRACE("(%p)->(%p %d)\n", This, stream, clr_dirty);
871
872 hr = IXMLDOMDocument3_get_xml(&This->IXMLDOMDocument3_iface, &xmlString);
873 if(hr == S_OK)
874 {
875 DWORD len = SysStringLen(xmlString) * sizeof(WCHAR);
876
877 hr = IStream_Write( stream, xmlString, len, NULL );
878 SysFreeString(xmlString);
879 }
880
881 TRACE("hr %#lx.\n", hr);
882
883 return hr;
884}
UINT WINAPI SysStringLen(BSTR str)
Definition: oleaut.c:196

◆ priv_from_xmlDocPtr()

static xmldoc_priv * priv_from_xmlDocPtr ( const xmlDocPtr  doc)
inlinestatic

◆ properties_add_ref()

static domdoc_properties * properties_add_ref ( domdoc_properties properties)
static

Definition at line 340 of file domdoc.c.

341{
342 LONG ref;
343
344 if (!properties) return NULL;
345
346 ref = InterlockedIncrement(&properties->refs);
347 TRACE("%p, %ld.\n", properties, ref);
348 return properties;
349}

Referenced by attach_xmldoc(), and get_domdoc_from_xmldoc().

◆ properties_from_xmlDocPtr()

static domdoc_properties * properties_from_xmlDocPtr ( xmlDocPtr  doc)
inlinestatic

◆ properties_release()

static void properties_release ( domdoc_properties properties)
static

Definition at line 351 of file domdoc.c.

352{
353 LONG ref;
354
355 if (!properties) return;
356
357 ref = InterlockedDecrement(&properties->refs);
358
359 TRACE("%p, %ld.\n", properties, ref);
360
361 if (ref < 0)
362 WARN("negative refcount, expect troubles\n");
363
364 if (ref == 0)
365 {
366 if (properties->schemaCache)
367 IXMLDOMSchemaCollection2_Release(properties->schemaCache);
368 clear_selectNsList(&properties->selectNsList);
369 free((xmlChar*)properties->selectNsStr);
370 if (properties->uri)
371 IUri_Release(properties->uri);
372 free(properties);
373 }
374}

Referenced by attach_xmldoc(), dom_document_create(), domdoc_Release(), and xmldoc_release_refs().

◆ registerNamespaces()

int registerNamespaces ( xmlXPathContextPtr  ctxt)

Definition at line 235 of file domdoc.c.

236{
237 int n = 0;
238 const select_ns_entry* ns = NULL;
239 const struct list* pNsList = &properties_from_xmlDocPtr(ctxt->doc)->selectNsList;
240
241 TRACE("(%p)\n", ctxt);
242
244 {
245 xmlXPathRegisterNs(ctxt, ns->prefix, ns->href);
246 ++n;
247 }
248
249 return n;
250}
GLdouble n
Definition: glext.h:7729
BSTR prefix
Definition: mxnamespace.c:39

Referenced by create_selection().

◆ release_namespaces()

static void release_namespaces ( domdoc This)
static

Definition at line 376 of file domdoc.c.

377{
378 if (This->namespaces)
379 {
380 IXMLDOMSchemaCollection2_Release(This->namespaces);
381 This->namespaces = NULL;
382 }
383}

Referenced by attach_xmldoc(), domdoc_get_namespaces(), and domdoc_Release().

◆ sax_characters()

static void sax_characters ( void ctx,
const xmlChar ch,
int  len 
)
static

Definition at line 438 of file domdoc.c.

439{
440 xmlParserCtxtPtr ctxt;
441 const domdoc *This;
442
443 ctxt = (xmlParserCtxtPtr) ctx;
444 This = (const domdoc*) ctxt->_private;
445
446 if (ctxt->node)
447 {
448 xmlChar cur = *(ctxt->input->cur);
449
450 /* Characters are reported with multiple calls, for example each charref is reported with a separate
451 call and then parser appends it to a single text node or creates a new node if not created.
452 It's not possible to tell if it's ignorable data or not just looking at data itself cause it could be
453 space chars that separate charrefs or similar case. We only need to skip leading and trailing spaces,
454 or whole node if it has nothing but space chars, so to detect leading space node->last is checked that
455 contains text node pointer if already created, trailing spaces are detected directly looking at parser input
456 for next '<' opening bracket - similar logic is used by libxml2 itself. Basically 'cur' == '<' means the last
457 chunk of char data, in case it's not the last chunk we check for previously added node type and if it's not
458 a text node it's safe to ignore.
459
460 Note that during domdoc_loadXML() the xmlDocPtr->_private data is not available. */
461
462 if (!This->properties->preserving &&
463 !is_preserving_whitespace(ctxt->node) &&
464 strn_isspace(ch, len) &&
465 (!ctxt->node->last ||
466 ((ctxt->node->last && (cur == '<' || ctxt->node->last->type != XML_TEXT_NODE))
467 )))
468 {
469 /* Keep information about ignorable whitespace text node in previous or parent node */
470 if (ctxt->node->last)
471 *(DWORD*)&ctxt->node->last->_private |= NODE_PRIV_TRAILING_IGNORABLE_WS;
472 else if (ctxt->node->type != XML_DOCUMENT_NODE)
473 *(DWORD*)&ctxt->node->_private |= NODE_PRIV_CHILD_IGNORABLE_WS;
474 return;
475 }
476 }
477
478 xmlSAX2Characters(ctxt, ch, len);
479}
XMLPUBFUN void xmlSAX2Characters(void *ctx, const xmlChar *ch, int len)
Definition: SAX2.c:2539
unsigned char ch[4][2]
Definition: console.c:118
BOOL is_preserving_whitespace(xmlNodePtr node)
Definition: domdoc.c:419
static BOOL strn_isspace(xmlChar const *str, int len)
Definition: domdoc.c:429
if(dx< 0)
Definition: linetemp.h:194
#define NODE_PRIV_TRAILING_IGNORABLE_WS
#define NODE_PRIV_CHILD_IGNORABLE_WS

Referenced by doparse().

◆ sax_error()

static void LIBXML2_LOG_CALLBACK sax_error ( void ctx,
char const msg,
  ... 
)
static

Definition at line 481 of file domdoc.c.

482{
483 va_list ap;
484 va_start(ap, msg);
486 va_end(ap);
487}
#define msg(x)
Definition: auth_time.c:54
#define va_end(v)
Definition: stdarg.h:28
#define va_start(v, l)
Definition: stdarg.h:26
char * va_list
Definition: vadefs.h:50
#define LIBXML2_CALLBACK_ERR(caller, msg, ap)
void int int ULONGLONG int va_list * ap
Definition: winesup.h:36

Referenced by doparse().

◆ sax_serror()

static void sax_serror ( void ctx,
const xmlError err 
)
static

Definition at line 497 of file domdoc.c.

498{
500}
#define LIBXML2_CALLBACK_SERROR(caller, err)

Referenced by doparse().

◆ sax_warning()

static void LIBXML2_LOG_CALLBACK sax_warning ( void ctx,
char const msg,
  ... 
)
static

Definition at line 489 of file domdoc.c.

490{
491 va_list ap;
492 va_start(ap, msg);
494 va_end(ap);
495}
#define LIBXML2_CALLBACK_WARN(caller, msg, ap)

Referenced by doparse().

◆ set_doc_event()

static HRESULT set_doc_event ( domdoc doc,
eventid_t  eid,
const VARIANT v 
)
static

Definition at line 143 of file domdoc.c.

144{
145 IDispatch *disp;
146
147 switch (V_VT(v))
148 {
149 case VT_UNKNOWN:
150 if (V_UNKNOWN(v))
151 IUnknown_QueryInterface(V_UNKNOWN(v), &IID_IDispatch, (void**)&disp);
152 else
153 disp = NULL;
154 break;
155 case VT_DISPATCH:
156 disp = V_DISPATCH(v);
157 if (disp) IDispatch_AddRef(disp);
158 break;
159 default:
160 return DISP_E_TYPEMISMATCH;
161 }
162
163 if (doc->events[eid]) IDispatch_Release(doc->events[eid]);
164 doc->events[eid] = disp;
165
166 return S_OK;
167}
#define DISP_E_TYPEMISMATCH
Definition: winerror.h:3617

Referenced by domdoc_put_onreadystatechange().

◆ set_xpathmode()

void set_xpathmode ( xmlDocPtr  doc,
BOOL  xpath 
)

Definition at line 230 of file domdoc.c.

231{
232 properties_from_xmlDocPtr(doc)->XPath = xpath;
233}

Referenced by domelem_getElementsByTagName().

◆ strn_isspace()

static BOOL strn_isspace ( xmlChar const str,
int  len 
)
inlinestatic

Definition at line 429 of file domdoc.c.

430{
431 for (; str && len > 0 && *str; ++str, --len)
432 if (!isspace(*str))
433 break;
434
435 return len == 0;
436}
#define isspace(c)
Definition: acclib.h:69

Referenced by sax_characters().

◆ tagName_to_XPath()

xmlChar * tagName_to_XPath ( const BSTR  tagName)

Definition at line 1955 of file domdoc.c.

1956{
1957 xmlChar *query, *tmp;
1958 static const xmlChar everything[] = "/descendant::node()";
1959 static const xmlChar mod_pre[] = "*[local-name()='";
1960 static const xmlChar mod_post[] = "']";
1961 static const xmlChar prefix[] = "descendant::";
1962 const WCHAR *tokBegin, *tokEnd;
1963 int len;
1964
1965 /* Special case - empty tagname - means select all nodes,
1966 except document itself. */
1967 if (!*tagName)
1968 return xmlStrdup(everything);
1969
1971
1972 tokBegin = tagName;
1973 while (tokBegin && *tokBegin)
1974 {
1975 switch (*tokBegin)
1976 {
1977 case '/':
1978 query = xmlStrcat(query, BAD_CAST "/");
1979 ++tokBegin;
1980 break;
1981 case '*':
1982 query = xmlStrcat(query, BAD_CAST "*");
1983 ++tokBegin;
1984 break;
1985 default:
1986 query = xmlStrcat(query, mod_pre);
1987 tokEnd = tokBegin;
1988 while (*tokEnd && *tokEnd != '/')
1989 ++tokEnd;
1990 len = WideCharToMultiByte(CP_UTF8, 0, tokBegin, tokEnd-tokBegin, NULL, 0, NULL, NULL);
1991 tmp = xmlMalloc(len);
1992 WideCharToMultiByte(CP_UTF8, 0, tokBegin, tokEnd-tokBegin, (char*)tmp, len, NULL, NULL);
1993 query = xmlStrncat(query, tmp, len);
1994 xmlFree(tmp);
1995 tokBegin = tokEnd;
1996 query = xmlStrcat(query, mod_post);
1997 }
1998 }
1999
2000 return query;
2001}
#define WideCharToMultiByte
Definition: compat.h:111
xmlMallocFunc xmlMalloc
Definition: globals.c:193
XMLPUBFUN xmlChar * xmlStrncat(xmlChar *cur, const xmlChar *add, int len)
Definition: xmlstring.c:448
XMLPUBFUN xmlChar * xmlStrcat(xmlChar *cur, const xmlChar *add)
Definition: xmlstring.c:524
#define BAD_CAST
Definition: xmlstring.h:35
XMLPUBFUN xmlChar * xmlStrdup(const xmlChar *cur)
Definition: xmlstring.c:69

Referenced by domdoc_getElementsByTagName(), and domelem_getElementsByTagName().

◆ validate_error()

static void LIBXML2_LOG_CALLBACK validate_error ( void ctx,
char const msg,
  ... 
)
static

Definition at line 2896 of file domdoc.c.

2897{
2898 va_list ap;
2899 va_start(ap, msg);
2901 va_end(ap);
2902}
static HRESULT WINAPI domdoc_validateNode(IXMLDOMDocument3 *iface, IXMLDOMNode *node, IXMLDOMParseError **err)
Definition: domdoc.c:2912

Referenced by domdoc_validateNode().

◆ validate_warning()

static void LIBXML2_LOG_CALLBACK validate_warning ( void ctx,
char const msg,
  ... 
)
static

Definition at line 2904 of file domdoc.c.

2905{
2906 va_list ap;
2907 va_start(ap, msg);
2909 va_end(ap);
2910}

Referenced by domdoc_validateNode().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msxml  )

◆ xmldoc_add_orphan()

HRESULT xmldoc_add_orphan ( xmlDocPtr  doc,
xmlNodePtr  node 
)

Definition at line 658 of file domdoc.c.

659{
660 xmldoc_priv *priv = priv_from_xmlDocPtr(doc);
662
663 entry = malloc(sizeof(*entry));
664 if(!entry)
665 return E_OUTOFMEMORY;
666
667 entry->node = node;
668 list_add_head( &priv->orphans, &entry->entry );
669 return S_OK;
670}
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
Definition: domdoc.c:202

Referenced by domdoc_cloneNode(), domdoc_createNode(), domdoc_put_documentElement(), domelem_remove_qualified_item(), node_clone(), node_remove_child(), and node_replace_child().

◆ xmldoc_add_ref()

LONG xmldoc_add_ref ( xmlDocPtr  doc)

◆ xmldoc_add_refs()

LONG xmldoc_add_refs ( xmlDocPtr  doc,
LONG  refs 
)

Definition at line 612 of file domdoc.c.

613{
614 LONG ref = InterlockedExchangeAdd(&priv_from_xmlDocPtr(doc)->refs, refs) + refs;
615 TRACE("%p, refcount %ld.\n", doc, ref);
616 return ref;
617}
#define InterlockedExchangeAdd
Definition: interlocked.h:196

Referenced by domdoc_put_documentElement(), node_insert_before(), node_replace_child(), and xmldoc_add_ref().

◆ xmldoc_encoding()

static char * xmldoc_encoding ( IXMLDOMDocument3 doc)
static

Definition at line 2552 of file domdoc.c.

2553{
2554 HRESULT hr;
2556 char *encoding = NULL;
2557
2558 hr = IXMLDOMDocument3_get_firstChild(doc, &node);
2559 if (hr == S_OK)
2560 {
2562
2563 hr = IXMLDOMNode_get_nodeType(node, &type);
2565 {
2568 IXMLDOMNamedNodeMap *node_map;
2569
2570 hr = IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMProcessingInstruction, (void **)&pi);
2571 if (hr == S_OK)
2572 {
2573 hr = IXMLDOMNode_get_attributes(node, &node_map);
2574 if (hr == S_OK)
2575 {
2576 static const WCHAR encodingW[] = {'e','n','c','o','d','i','n','g',0};
2577 BSTR bstr;
2578
2579 bstr = SysAllocString(encodingW);
2580 hr = IXMLDOMNamedNodeMap_getNamedItem(node_map, bstr, &item);
2581 SysFreeString(bstr);
2582 if (hr == S_OK)
2583 {
2584 VARIANT var;
2585
2586 hr = IXMLDOMNode_get_nodeValue(item, &var);
2587 if (hr == S_OK)
2588 {
2589 if (V_VT(&var) == VT_BSTR)
2590 encoding = (char *)xmlchar_from_wchar(V_BSTR(&var));
2591
2592 VariantClear(&var);
2593 }
2594 }
2595
2596 IXMLDOMNamedNodeMap_Release(node_map);
2597 }
2598
2599 IXMLDOMProcessingInstruction_Release(pi);
2600 }
2601 }
2602
2603 IXMLDOMNode_Release(node);
2604 }
2605
2606 if (!encoding && (encoding = malloc(sizeof("UTF-8"))))
2607 strcpy(encoding, "UTF-8");
2608
2609 return encoding;
2610}
strcpy
Definition: string.h:131

Referenced by domdoc_save().

◆ xmldoc_init()

void xmldoc_init ( xmlDocPtr  doc,
MSXML_VERSION  version 
)

Definition at line 606 of file domdoc.c.

607{
608 doc->_private = create_priv();
610}
static domdoc_properties * create_properties(MSXML_VERSION version)
Definition: domdoc.c:277

Referenced by cache_entry_from_xdr_doc(), cache_entry_from_xsd_doc(), and dom_document_create().

◆ xmldoc_link_xmldecl()

void xmldoc_link_xmldecl ( xmlDocPtr  doc,
xmlNodePtr  node 
)

Definition at line 386 of file domdoc.c.

387{
388 assert(doc != NULL);
389 if (doc->standalone != -1) xmlAddPrevSibling( doc->children, node );
390}

Referenced by doparse(), and node_get_xml().

◆ xmldoc_release()

LONG xmldoc_release ( xmlDocPtr  doc)

◆ xmldoc_release_refs()

LONG xmldoc_release_refs ( xmlDocPtr  doc,
LONG  refs 
)

Definition at line 624 of file domdoc.c.

625{
626 xmldoc_priv *priv = priv_from_xmlDocPtr(doc);
627 LONG ref = InterlockedExchangeAdd(&priv->refs, -refs) - refs;
628
629 TRACE("%p, refcount %ld.\n", doc, ref);
630
631 if (ref < 0)
632 WARN("negative refcount, expect troubles\n");
633
634 if (ref == 0)
635 {
636 orphan_entry *orphan, *orphan2;
637 TRACE("freeing docptr %p\n", doc);
638
640 {
641 xmlFreeNode( orphan->node );
642 free( orphan );
643 }
645 free(doc->_private);
646
647 xmlFreeDoc(doc);
648 }
649
650 return ref;
651}
Definition: send.c:34

Referenced by domdoc_put_documentElement(), node_insert_before(), node_replace_child(), and xmldoc_release().

◆ xmldoc_remove_orphan()

HRESULT xmldoc_remove_orphan ( xmlDocPtr  doc,
xmlNodePtr  node 
)

Definition at line 672 of file domdoc.c.

673{
674 xmldoc_priv *priv = priv_from_xmlDocPtr(doc);
675 orphan_entry *entry, *entry2;
676
678 {
679 if( entry->node == node )
680 {
681 list_remove( &entry->entry );
682 free( entry );
683 return S_OK;
684 }
685 }
686
687 return S_FALSE;
688}
static void list_remove(struct list_entry *entry)
Definition: list.h:90

Referenced by domdoc_put_documentElement(), domelem_set_named_item(), node_clone(), node_insert_before(), and node_replace_child().

◆ xmldoc_unlink_xmldecl()

xmlNodePtr xmldoc_unlink_xmldecl ( xmlDocPtr  doc)

Definition at line 393 of file domdoc.c.

394{
395 static const xmlChar xmlA[] = "xml";
396 xmlNodePtr node, first_child;
397
398 assert(doc != NULL);
399
400 /* xml declaration node could be created automatically after parsing or added
401 to a tree later */
402 first_child = doc->children;
403 if (first_child && first_child->type == XML_PI_NODE && xmlStrEqual(first_child->name, xmlA))
404 {
405 node = first_child;
406 xmlUnlinkNode( node );
407 }
408 else
409 node = NULL;
410
411 return node;
412}
XMLPUBFUN int xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
Definition: xmlstring.c:162

Referenced by node_get_xml().

◆ xmldoc_version()

MSXML_VERSION xmldoc_version ( xmlDocPtr  doc)

Definition at line 414 of file domdoc.c.

415{
417}

Referenced by domattr_get_namespaceURI(), domattr_get_prefix(), node_get_base_name(), and node_get_nodeName().

Variable Documentation

◆ ConnectionPointContainerVtbl

const struct IConnectionPointContainerVtbl ConnectionPointContainerVtbl
static
Initial value:
=
{
}
static HRESULT WINAPI ConnectionPointContainer_QueryInterface(IConnectionPointContainer *iface, REFIID riid, void **ppv)
Definition: domdoc.c:3387
static HRESULT WINAPI ConnectionPointContainer_EnumConnectionPoints(IConnectionPointContainer *iface, IEnumConnectionPoints **ppEnum)
Definition: domdoc.c:3406
static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPointContainer *iface, REFIID riid, IConnectionPoint **cp)
Definition: domdoc.c:3414
static ULONG WINAPI ConnectionPointContainer_AddRef(IConnectionPointContainer *iface)
Definition: domdoc.c:3394
static ULONG WINAPI ConnectionPointContainer_Release(IConnectionPointContainer *iface)
Definition: domdoc.c:3400

Definition at line 3441 of file domdoc.c.

Referenced by get_domdoc_from_xmldoc().

◆ ConnectionPointVtbl

const IConnectionPointVtbl ConnectionPointVtbl
static
Initial value:
=
{
}
static HRESULT WINAPI ConnectionPoint_QueryInterface(IConnectionPoint *iface, REFIID riid, void **ppv)
Definition: domdoc.c:3451
static HRESULT WINAPI ConnectionPoint_GetConnectionInterface(IConnectionPoint *iface, IID *iid)
Definition: domdoc.c:3488
static HRESULT WINAPI ConnectionPoint_GetConnectionPointContainer(IConnectionPoint *iface, IConnectionPointContainer **container)
Definition: domdoc.c:3500
static HRESULT WINAPI ConnectionPoint_Unadvise(IConnectionPoint *iface, DWORD cookie)
Definition: domdoc.c:3553
static HRESULT WINAPI ConnectionPoint_Advise(IConnectionPoint *iface, IUnknown *unk_sink, DWORD *cookie)
Definition: domdoc.c:3514
static HRESULT WINAPI ConnectionPoint_EnumConnections(IConnectionPoint *iface, IEnumConnections **ppEnum)
Definition: domdoc.c:3568
static ULONG WINAPI ConnectionPoint_AddRef(IConnectionPoint *iface)
Definition: domdoc.c:3476
static ULONG WINAPI ConnectionPoint_Release(IConnectionPoint *iface)
Definition: domdoc.c:3482

Definition at line 3576 of file domdoc.c.

Referenced by ConnectionPoint_Init().

◆ domdoc_dispex

dispex_static_data_t domdoc_dispex
static
Initial value:
= {
}
static const tid_t domdoc_iface_tids[]
Definition: domdoc.c:3737
@ IXMLDOMDocument3_tid
Definition: msxml_dispex.h:44

Definition at line 3742 of file domdoc.c.

Referenced by get_domdoc_from_xmldoc().

◆ domdoc_iface_tids

const tid_t domdoc_iface_tids[]
static
Initial value:

Definition at line 3737 of file domdoc.c.

◆ domdoc_se_tids

const tid_t domdoc_se_tids[]
static
Initial value:

Definition at line 917 of file domdoc.c.

Referenced by domdoc_QueryInterface().

◆ domdocObjectSafetyVtbl

const IObjectSafetyVtbl domdocObjectSafetyVtbl
static
Initial value:
= {
}
static HRESULT WINAPI domdoc_Safety_SetInterfaceSafetyOptions(IObjectSafety *iface, REFIID riid, DWORD mask, DWORD enabled)
Definition: domdoc.c:3712
static ULONG WINAPI domdoc_Safety_AddRef(IObjectSafety *iface)
Definition: domdoc.c:3683
static ULONG WINAPI domdoc_Safety_Release(IObjectSafety *iface)
Definition: domdoc.c:3689
static HRESULT WINAPI domdoc_Safety_QueryInterface(IObjectSafety *iface, REFIID riid, void **ppv)
Definition: domdoc.c:3677
static HRESULT WINAPI domdoc_Safety_GetInterfaceSafetyOptions(IObjectSafety *iface, REFIID riid, DWORD *supported, DWORD *enabled)
Definition: domdoc.c:3697

Definition at line 3729 of file domdoc.c.

Referenced by get_domdoc_from_xmldoc().

◆ domdocObjectSite

const IObjectWithSiteVtbl domdocObjectSite
static
Initial value:
=
{
}
static HRESULT WINAPI domdoc_ObjectWithSite_GetSite(IObjectWithSite *iface, REFIID iid, void **ppvSite)
Definition: domdoc.c:3622
static ULONG WINAPI domdoc_ObjectWithSite_Release(IObjectWithSite *iface)
Definition: domdoc.c:3616
static HRESULT WINAPI domdoc_ObjectWithSite_SetSite(IObjectWithSite *iface, IUnknown *punk)
Definition: domdoc.c:3634
static ULONG WINAPI domdoc_ObjectWithSite_AddRef(IObjectWithSite *iface)
Definition: domdoc.c:3610
static HRESULT WINAPI domdoc_ObjectWithSite_QueryInterface(IObjectWithSite *iface, REFIID riid, void **ppvObject)
Definition: domdoc.c:3604

Definition at line 3668 of file domdoc.c.

Referenced by get_domdoc_from_xmldoc().

◆ PropertyAllowDocumentFunctionW

const WCHAR PropertyAllowDocumentFunctionW[] = {'A','l','l','o','w','D','o','c','u','m','e','n','t','F','u','n','c','t','i','o','n',0}
static

Definition at line 60 of file domdoc.c.

Referenced by domdoc_setProperty().

◆ PropertyAllowXsltScriptW

const WCHAR PropertyAllowXsltScriptW[] = {'A','l','l','o','w','X','s','l','t','S','c','r','i','p','t',0}
static

Definition at line 59 of file domdoc.c.

Referenced by domdoc_setProperty().

◆ PropertyMaxElementDepth

const WCHAR PropertyMaxElementDepth[] = L"MaxElementDepth"
static

Definition at line 63 of file domdoc.c.

Referenced by domdoc_setProperty().

◆ PropertyNewParserW

const WCHAR PropertyNewParserW[] = {'N','e','w','P','a','r','s','e','r',0}
static

Definition at line 55 of file domdoc.c.

Referenced by domdoc_setProperty().

◆ PropertyNormalizeAttributeValuesW

const WCHAR PropertyNormalizeAttributeValuesW[] = {'N','o','r','m','a','l','i','z','e','A','t','t','r','i','b','u','t','e','V','a','l','u','e','s',0}
static

Definition at line 61 of file domdoc.c.

Referenced by domdoc_setProperty().

◆ PropertyProhibitDTDW

const WCHAR PropertyProhibitDTDW[] = {'P','r','o','h','i','b','i','t','D','T','D',0}
static

Definition at line 54 of file domdoc.c.

Referenced by domdoc_setProperty().

◆ PropertyResolveExternalsW

const WCHAR PropertyResolveExternalsW[] = {'R','e','s','o','l','v','e','E','x','t','e','r','n','a','l','s',0}
static

Definition at line 58 of file domdoc.c.

Referenced by domdoc_setProperty().

◆ PropertySelectionLanguageW

const WCHAR PropertySelectionLanguageW[] = {'S','e','l','e','c','t','i','o','n','L','a','n','g','u','a','g','e',0}
static

Definition at line 52 of file domdoc.c.

Referenced by domdoc_getProperty(), and domdoc_setProperty().

◆ PropertySelectionNamespacesW

const WCHAR PropertySelectionNamespacesW[] = {'S','e','l','e','c','t','i','o','n','N','a','m','e','s','p','a','c','e','s',0}
static

Definition at line 53 of file domdoc.c.

Referenced by domdoc_getProperty(), and domdoc_setProperty().

◆ PropertyValidateOnParse

const WCHAR PropertyValidateOnParse[] = L"ValidateOnParse"
static

Definition at line 62 of file domdoc.c.

Referenced by domdoc_getProperty(), and domdoc_setProperty().

◆ PropValueXPathW

const WCHAR PropValueXPathW[] = {'X','P','a','t','h',0}
static

Definition at line 56 of file domdoc.c.

Referenced by domdoc_getProperty(), and domdoc_setProperty().

◆ PropValueXSLPatternW

const WCHAR PropValueXSLPatternW[] = {'X','S','L','P','a','t','t','e','r','n',0}
static

Definition at line 57 of file domdoc.c.

Referenced by domdoc_getProperty(), and domdoc_setProperty().

◆ xmldoc_IPersistStreamInit_VTable

const IPersistStreamInitVtbl xmldoc_IPersistStreamInit_VTable
static
Initial value:
=
{
}
static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, IStream *stream, BOOL clr_dirty)
Definition: domdoc.c:863
static HRESULT WINAPI PersistStreamInit_QueryInterface(IPersistStreamInit *iface, REFIID riid, void **ppvObj)
Definition: domdoc.c:755
static HRESULT WINAPI PersistStreamInit_GetSizeMax(IPersistStreamInit *iface, ULARGE_INTEGER *pcbSize)
Definition: domdoc.c:886
static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface)
Definition: domdoc.c:894
static HRESULT WINAPI PersistStreamInit_GetClassID(IPersistStreamInit *iface, CLSID *classid)
Definition: domdoc.c:776
static ULONG WINAPI PersistStreamInit_AddRef(IPersistStreamInit *iface)
Definition: domdoc.c:762
static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface)
Definition: domdoc.c:790
static ULONG WINAPI PersistStreamInit_Release(IPersistStreamInit *iface)
Definition: domdoc.c:769
static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, IStream *stream)
Definition: domdoc.c:851

Definition at line 902 of file domdoc.c.

Referenced by get_domdoc_from_xmldoc().

◆ XMLDOMDocument3Vtbl

const struct IXMLDOMDocument3Vtbl XMLDOMDocument3Vtbl
static

Definition at line 3298 of file domdoc.c.

Referenced by get_domdoc_from_xmldoc().