2005-08-02 11:29:04 +00:00
|
|
|
/*
|
2010-02-12 03:44:59 +00:00
|
|
|
* Common definitions
|
2005-08-02 11:29:04 +00:00
|
|
|
*
|
|
|
|
* Copyright 2005 Mike McCormack
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 12:49:52 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2005-08-02 11:29:04 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __MSXML_PRIVATE__
|
|
|
|
#define __MSXML_PRIVATE__
|
|
|
|
|
2008-08-21 21:37:48 +00:00
|
|
|
#include "dispex.h"
|
|
|
|
|
|
|
|
#include "wine/unicode.h"
|
|
|
|
|
2007-01-20 08:19:55 +00:00
|
|
|
#ifndef __WINE_CONFIG_H
|
|
|
|
# error You must include config.h to use this header
|
|
|
|
#endif
|
|
|
|
|
2010-11-24 19:53:47 +00:00
|
|
|
typedef enum {
|
|
|
|
MSXML_DEFAULT = 0,
|
|
|
|
MSXML3 = 30,
|
|
|
|
MSXML4 = 40,
|
|
|
|
MSXML6 = 60
|
|
|
|
} MSXML_VERSION;
|
|
|
|
|
2009-08-29 13:01:37 +00:00
|
|
|
/* typelibs */
|
|
|
|
typedef enum tid_t {
|
|
|
|
IXMLDOMAttribute_tid,
|
|
|
|
IXMLDOMCDATASection_tid,
|
|
|
|
IXMLDOMComment_tid,
|
|
|
|
IXMLDOMDocument_tid,
|
|
|
|
IXMLDOMDocument2_tid,
|
|
|
|
IXMLDOMDocumentFragment_tid,
|
2010-11-04 22:34:01 +00:00
|
|
|
IXMLDOMDocumentType_tid,
|
2009-08-29 13:01:37 +00:00
|
|
|
IXMLDOMElement_tid,
|
|
|
|
IXMLDOMEntityReference_tid,
|
|
|
|
IXMLDOMImplementation_tid,
|
|
|
|
IXMLDOMNamedNodeMap_tid,
|
|
|
|
IXMLDOMNode_tid,
|
|
|
|
IXMLDOMNodeList_tid,
|
|
|
|
IXMLDOMParseError_tid,
|
|
|
|
IXMLDOMProcessingInstruction_tid,
|
|
|
|
IXMLDOMSchemaCollection_tid,
|
2009-08-29 13:02:19 +00:00
|
|
|
IXMLDOMSelection_tid,
|
2009-08-29 13:01:37 +00:00
|
|
|
IXMLDOMText_tid,
|
|
|
|
IXMLElement_tid,
|
|
|
|
IXMLDocument_tid,
|
|
|
|
IXMLHTTPRequest_tid,
|
|
|
|
IVBSAXAttributes_tid,
|
|
|
|
IVBSAXContentHandler_tid,
|
|
|
|
IVBSAXDeclHandler_tid,
|
|
|
|
IVBSAXDTDHandler_tid,
|
|
|
|
IVBSAXEntityResolver_tid,
|
|
|
|
IVBSAXErrorHandler_tid,
|
|
|
|
IVBSAXLexicalHandler_tid,
|
|
|
|
IVBSAXLocator_tid,
|
|
|
|
IVBSAXXMLFilter_tid,
|
|
|
|
IVBSAXXMLReader_tid,
|
|
|
|
IMXAttributes_tid,
|
|
|
|
IMXReaderControl_tid,
|
|
|
|
IMXWriter_tid,
|
|
|
|
LAST_tid
|
|
|
|
} tid_t;
|
|
|
|
|
2010-11-16 00:16:10 +00:00
|
|
|
/* The XDR datatypes (urn:schemas-microsoft-com:datatypes)
|
|
|
|
* These are actually valid for XSD schemas as well
|
|
|
|
* See datatypes.xsd
|
|
|
|
*/
|
|
|
|
typedef enum _XDR_DT {
|
|
|
|
DT_INVALID = -1,
|
|
|
|
DT_BIN_BASE64,
|
|
|
|
DT_BIN_HEX,
|
|
|
|
DT_BOOLEAN,
|
|
|
|
DT_CHAR,
|
|
|
|
DT_DATE,
|
|
|
|
DT_DATE_TZ,
|
|
|
|
DT_DATETIME,
|
|
|
|
DT_DATETIME_TZ,
|
|
|
|
DT_ENTITY,
|
|
|
|
DT_ENTITIES,
|
|
|
|
DT_ENUMERATION,
|
|
|
|
DT_FIXED_14_4,
|
|
|
|
DT_FLOAT,
|
|
|
|
DT_I1,
|
|
|
|
DT_I2,
|
|
|
|
DT_I4,
|
|
|
|
DT_I8,
|
|
|
|
DT_ID,
|
|
|
|
DT_IDREF,
|
|
|
|
DT_IDREFS,
|
|
|
|
DT_INT,
|
|
|
|
DT_NMTOKEN,
|
|
|
|
DT_NMTOKENS,
|
|
|
|
DT_NOTATION,
|
|
|
|
DT_NUMBER,
|
|
|
|
DT_R4,
|
|
|
|
DT_R8,
|
|
|
|
DT_STRING,
|
|
|
|
DT_TIME,
|
|
|
|
DT_TIME_TZ,
|
|
|
|
DT_UI1,
|
|
|
|
DT_UI2,
|
|
|
|
DT_UI4,
|
|
|
|
DT_UI8,
|
|
|
|
DT_URI,
|
|
|
|
DT_UUID
|
|
|
|
} XDR_DT;
|
|
|
|
#define DT__N_TYPES (DT_UUID+1)
|
|
|
|
|
2009-08-29 13:01:37 +00:00
|
|
|
extern HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo);
|
|
|
|
extern void release_typelib(void);
|
|
|
|
|
|
|
|
typedef struct dispex_data_t dispex_data_t;
|
|
|
|
typedef struct dispex_dynamic_data_t dispex_dynamic_data_t;
|
|
|
|
|
|
|
|
#define MSXML_DISPID_CUSTOM_MIN 0x60000000
|
|
|
|
#define MSXML_DISPID_CUSTOM_MAX 0x6fffffff
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
HRESULT (*get_dispid)(IUnknown*,BSTR,DWORD,DISPID*);
|
|
|
|
HRESULT (*invoke)(IUnknown*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*);
|
|
|
|
} dispex_static_data_vtbl_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
const dispex_static_data_vtbl_t *vtbl;
|
|
|
|
const tid_t disp_tid;
|
|
|
|
dispex_data_t *data;
|
|
|
|
const tid_t* const iface_tids;
|
|
|
|
} dispex_static_data_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
const IDispatchExVtbl *lpIDispatchExVtbl;
|
|
|
|
|
|
|
|
IUnknown *outer;
|
|
|
|
|
|
|
|
dispex_static_data_t *data;
|
|
|
|
dispex_dynamic_data_t *dynamic_data;
|
|
|
|
} DispatchEx;
|
|
|
|
|
2010-11-10 03:40:34 +00:00
|
|
|
extern HINSTANCE MSXML_hInstance;
|
|
|
|
|
2009-08-29 13:01:37 +00:00
|
|
|
void init_dispex(DispatchEx*,IUnknown*,dispex_static_data_t*);
|
|
|
|
BOOL dispex_query_interface(DispatchEx*,REFIID,void**);
|
|
|
|
|
2009-09-01 12:05:02 +00:00
|
|
|
#ifdef HAVE_LIBXML2
|
|
|
|
|
|
|
|
#ifdef HAVE_LIBXML_PARSER_H
|
|
|
|
#include <libxml/parser.h>
|
|
|
|
#endif
|
|
|
|
|
2010-10-29 14:27:09 +00:00
|
|
|
|
2010-11-12 14:33:17 +00:00
|
|
|
|
2010-10-27 14:35:56 +00:00
|
|
|
#include <libxml/xmlerror.h>
|
|
|
|
|
2010-11-12 14:33:17 +00:00
|
|
|
extern void schemasInit(void);
|
|
|
|
extern void schemasCleanup(void);
|
|
|
|
|
2010-11-11 21:16:24 +00:00
|
|
|
#ifndef HAVE_XMLFIRSTELEMENTCHILD
|
2010-11-12 14:33:17 +00:00
|
|
|
static inline xmlNodePtr xmlFirstElementChild(xmlNodePtr parent)
|
|
|
|
{
|
2010-11-11 21:16:24 +00:00
|
|
|
xmlNodePtr child;
|
|
|
|
for (child = parent->children; child != NULL; child = child->next)
|
|
|
|
if (child->type == XML_ELEMENT_NODE)
|
|
|
|
break;
|
|
|
|
|
|
|
|
return child;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-09-01 12:05:02 +00:00
|
|
|
/* constructors */
|
|
|
|
extern IUnknown *create_domdoc( xmlNodePtr document );
|
|
|
|
extern IUnknown *create_xmldoc( void );
|
|
|
|
extern IXMLDOMNode *create_node( xmlNodePtr node );
|
|
|
|
extern IUnknown *create_element( xmlNodePtr element );
|
|
|
|
extern IUnknown *create_attribute( xmlNodePtr attribute );
|
|
|
|
extern IUnknown *create_text( xmlNodePtr text );
|
|
|
|
extern IUnknown *create_pi( xmlNodePtr pi );
|
|
|
|
extern IUnknown *create_comment( xmlNodePtr comment );
|
|
|
|
extern IUnknown *create_cdata( xmlNodePtr text );
|
|
|
|
extern IXMLDOMNodeList *create_children_nodelist( xmlNodePtr );
|
|
|
|
extern IXMLDOMNamedNodeMap *create_nodemap( IXMLDOMNode *node );
|
2009-10-07 10:24:53 +00:00
|
|
|
extern IUnknown *create_doc_Implementation(void);
|
2009-09-01 12:05:02 +00:00
|
|
|
extern IUnknown *create_doc_fragment( xmlNodePtr fragment );
|
|
|
|
extern IUnknown *create_doc_entity_ref( xmlNodePtr entity );
|
2010-11-04 22:34:01 +00:00
|
|
|
extern IUnknown *create_doc_type( xmlNodePtr doctype );
|
2009-09-01 12:05:02 +00:00
|
|
|
|
2010-11-23 02:59:20 +00:00
|
|
|
extern HRESULT queryresult_create( xmlNodePtr node, xmlChar* szQuery, IXMLDOMNodeList** out );
|
2009-09-01 12:05:02 +00:00
|
|
|
|
|
|
|
/* data accessors */
|
|
|
|
xmlNodePtr xmlNodePtr_from_domnode( IXMLDOMNode *iface, xmlElementType type );
|
|
|
|
|
|
|
|
/* helpers */
|
2010-09-01 20:29:18 +00:00
|
|
|
extern xmlChar *xmlChar_from_wchar( LPCWSTR str );
|
2009-09-01 12:05:02 +00:00
|
|
|
|
2010-10-15 14:25:11 +00:00
|
|
|
extern void xmldoc_init( xmlDocPtr doc, const GUID *clsid );
|
2009-09-01 12:05:02 +00:00
|
|
|
extern LONG xmldoc_add_ref( xmlDocPtr doc );
|
|
|
|
extern LONG xmldoc_release( xmlDocPtr doc );
|
|
|
|
extern HRESULT xmldoc_add_orphan( xmlDocPtr doc, xmlNodePtr node );
|
|
|
|
extern HRESULT xmldoc_remove_orphan( xmlDocPtr doc, xmlNodePtr node );
|
2010-06-28 08:17:56 +00:00
|
|
|
extern void xmldoc_link_xmldecl(xmlDocPtr doc, xmlNodePtr node);
|
|
|
|
extern xmlNodePtr xmldoc_unlink_xmldecl(xmlDocPtr doc);
|
2009-09-01 12:05:02 +00:00
|
|
|
|
2010-01-14 21:18:32 +00:00
|
|
|
extern HRESULT XMLElement_create( IUnknown *pUnkOuter, xmlNodePtr node, LPVOID *ppObj, BOOL own );
|
2009-09-01 12:05:02 +00:00
|
|
|
|
2010-10-27 14:35:56 +00:00
|
|
|
extern void wineXmlCallbackLog(char const* caller, xmlErrorLevel lvl, char const* msg, va_list ap);
|
2010-11-17 13:21:09 +00:00
|
|
|
extern void wineXmlCallbackError(char const* caller, xmlErrorPtr err);
|
2010-10-27 14:35:56 +00:00
|
|
|
|
|
|
|
#define LIBXML2_LOG_CALLBACK __WINE_PRINTF_ATTR(2,3)
|
|
|
|
|
|
|
|
#define LIBXML2_CALLBACK_TRACE(caller, msg, ap) \
|
|
|
|
wineXmlCallbackLog(#caller, XML_ERR_NONE, msg, ap)
|
|
|
|
|
|
|
|
#define LIBXML2_CALLBACK_WARN(caller, msg, ap) \
|
|
|
|
wineXmlCallbackLog(#caller, XML_ERR_WARNING, msg, ap)
|
|
|
|
|
|
|
|
#define LIBXML2_CALLBACK_ERR(caller, msg, ap) \
|
|
|
|
wineXmlCallbackLog(#caller, XML_ERR_ERROR, msg, ap)
|
|
|
|
|
2010-11-17 13:21:09 +00:00
|
|
|
#define LIBXML2_CALLBACK_SERROR(caller, err) wineXmlCallbackError(#caller, err)
|
2009-09-01 12:05:02 +00:00
|
|
|
|
2010-11-03 21:13:58 +00:00
|
|
|
extern BOOL is_preserving_whitespace(xmlNodePtr node);
|
2010-11-23 02:59:20 +00:00
|
|
|
extern BOOL is_xpathmode(const xmlDocPtr doc);
|
|
|
|
extern void set_xpathmode(xmlDocPtr doc, BOOL xpath);
|
2010-11-03 21:13:58 +00:00
|
|
|
|
2008-01-03 22:06:03 +00:00
|
|
|
/* IXMLDOMNode Internal Structure */
|
|
|
|
typedef struct _xmlnode
|
|
|
|
{
|
2009-08-29 13:01:37 +00:00
|
|
|
DispatchEx dispex;
|
2008-01-03 22:06:03 +00:00
|
|
|
const struct IXMLDOMNodeVtbl *lpVtbl;
|
2010-09-04 15:54:13 +00:00
|
|
|
IXMLDOMNode *iface;
|
2008-01-03 22:06:03 +00:00
|
|
|
xmlNodePtr node;
|
|
|
|
} xmlnode;
|
|
|
|
|
2009-08-21 11:24:31 +00:00
|
|
|
static inline IXMLDOMNode *IXMLDOMNode_from_impl(xmlnode *This)
|
|
|
|
{
|
|
|
|
return (IXMLDOMNode*)&This->lpVtbl;
|
|
|
|
}
|
|
|
|
|
2010-09-04 15:54:13 +00:00
|
|
|
extern void init_xmlnode(xmlnode*,xmlNodePtr,IXMLDOMNode*,dispex_static_data_t*);
|
2009-09-30 13:36:38 +00:00
|
|
|
extern void destroy_xmlnode(xmlnode*);
|
2010-09-04 15:54:46 +00:00
|
|
|
extern BOOL node_query_interface(xmlnode*,REFIID,void**);
|
2010-09-04 15:55:04 +00:00
|
|
|
extern xmlnode *get_node_obj(IXMLDOMNode*);
|
2009-08-21 11:24:31 +00:00
|
|
|
|
2010-09-04 15:56:25 +00:00
|
|
|
extern HRESULT node_get_nodeName(xmlnode*,BSTR*);
|
2010-09-04 15:56:45 +00:00
|
|
|
extern HRESULT node_get_content(xmlnode*,VARIANT*);
|
2010-10-25 22:06:52 +00:00
|
|
|
extern HRESULT node_set_content(xmlnode*,LPCWSTR);
|
2010-09-07 13:27:31 +00:00
|
|
|
extern HRESULT node_put_value(xmlnode*,VARIANT*);
|
2010-11-04 15:35:58 +00:00
|
|
|
extern HRESULT node_put_value_escaped(xmlnode*,VARIANT*);
|
2010-09-07 13:28:21 +00:00
|
|
|
extern HRESULT node_get_parent(xmlnode*,IXMLDOMNode**);
|
2010-09-08 13:12:02 +00:00
|
|
|
extern HRESULT node_get_child_nodes(xmlnode*,IXMLDOMNodeList**);
|
2010-09-08 13:12:14 +00:00
|
|
|
extern HRESULT node_get_first_child(xmlnode*,IXMLDOMNode**);
|
|
|
|
extern HRESULT node_get_last_child(xmlnode*,IXMLDOMNode**);
|
2010-09-10 14:53:48 +00:00
|
|
|
extern HRESULT node_get_previous_sibling(xmlnode*,IXMLDOMNode**);
|
|
|
|
extern HRESULT node_get_next_sibling(xmlnode*,IXMLDOMNode**);
|
2010-09-10 14:55:14 +00:00
|
|
|
extern HRESULT node_insert_before(xmlnode*,IXMLDOMNode*,const VARIANT*,IXMLDOMNode**);
|
2010-10-13 13:11:32 +00:00
|
|
|
extern HRESULT node_replace_child(xmlnode*,IXMLDOMNode*,IXMLDOMNode*,IXMLDOMNode**);
|
2010-10-18 23:27:48 +00:00
|
|
|
extern HRESULT node_put_text(xmlnode*,BSTR);
|
2010-10-29 14:27:09 +00:00
|
|
|
extern HRESULT node_get_xml(xmlnode*,BOOL,BOOL,BSTR*);
|
2010-10-31 08:50:58 +00:00
|
|
|
extern HRESULT node_clone(xmlnode*,VARIANT_BOOL,IXMLDOMNode**);
|
2010-10-31 09:22:53 +00:00
|
|
|
extern HRESULT node_get_prefix(xmlnode*,BSTR*);
|
2010-10-31 09:39:53 +00:00
|
|
|
extern HRESULT node_get_base_name(xmlnode*,BSTR*);
|
2010-09-08 13:12:02 +00:00
|
|
|
|
2010-08-29 21:31:49 +00:00
|
|
|
extern HRESULT DOMDocument_create_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument3 **document);
|
2010-11-01 19:11:46 +00:00
|
|
|
extern HRESULT SchemaCache_validate_tree(IXMLDOMSchemaCollection2* iface, xmlNodePtr tree);
|
2010-11-16 00:16:51 +00:00
|
|
|
extern XDR_DT SchemaCache_get_node_dt(IXMLDOMSchemaCollection2* iface, xmlNodePtr node);
|
2008-07-14 09:48:37 +00:00
|
|
|
|
2010-11-23 02:56:31 +00:00
|
|
|
extern XDR_DT str_to_dt(xmlChar const* str, int len /* calculated if -1 */);
|
|
|
|
extern XDR_DT bstr_to_dt(OLECHAR const* bstr, int len /* calculated if -1 */);
|
|
|
|
extern xmlChar const* dt_to_str(XDR_DT dt);
|
|
|
|
extern OLECHAR const* dt_to_bstr(XDR_DT dt);
|
2010-11-23 02:55:54 +00:00
|
|
|
extern XDR_DT element_get_dt(xmlNodePtr node);
|
2010-11-23 02:57:29 +00:00
|
|
|
extern HRESULT dt_validate(XDR_DT dt, xmlChar const* content);
|
2010-11-16 00:16:10 +00:00
|
|
|
|
2010-11-06 19:07:11 +00:00
|
|
|
extern BSTR EnsureCorrectEOL(BSTR);
|
|
|
|
|
2010-11-23 02:59:20 +00:00
|
|
|
extern xmlChar* tagName_to_XPath(const BSTR tagName);
|
|
|
|
|
2009-08-14 10:23:05 +00:00
|
|
|
static inline BSTR bstr_from_xmlChar(const xmlChar *str)
|
|
|
|
{
|
|
|
|
BSTR ret = NULL;
|
|
|
|
|
|
|
|
if(str) {
|
|
|
|
DWORD len = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)str, -1, NULL, 0);
|
|
|
|
ret = SysAllocStringLen(NULL, len-1);
|
|
|
|
if(ret)
|
|
|
|
MultiByteToWideChar( CP_UTF8, 0, (LPCSTR)str, -1, ret, len);
|
|
|
|
}
|
2010-02-12 18:26:50 +00:00
|
|
|
else
|
|
|
|
ret = SysAllocStringLen(NULL, 0);
|
2009-08-14 10:23:05 +00:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2010-09-04 15:56:25 +00:00
|
|
|
static inline HRESULT return_bstr(const WCHAR *value, BSTR *p)
|
|
|
|
{
|
|
|
|
if(!p)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
if(value) {
|
|
|
|
*p = SysAllocString(value);
|
|
|
|
if(!*p)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
}else {
|
|
|
|
*p = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2010-09-08 13:12:14 +00:00
|
|
|
static inline HRESULT return_null_node(IXMLDOMNode **p)
|
|
|
|
{
|
|
|
|
if(!p)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
*p = NULL;
|
|
|
|
return S_FALSE;
|
|
|
|
}
|
|
|
|
|
2010-09-10 14:54:06 +00:00
|
|
|
static inline HRESULT return_null_ptr(void **p)
|
|
|
|
{
|
|
|
|
if(!p)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
*p = NULL;
|
|
|
|
return S_FALSE;
|
|
|
|
}
|
|
|
|
|
2010-10-18 23:13:30 +00:00
|
|
|
static inline HRESULT return_null_var(VARIANT *p)
|
|
|
|
{
|
|
|
|
if(!p)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
V_VT(p) = VT_NULL;
|
|
|
|
return S_FALSE;
|
|
|
|
}
|
|
|
|
|
2010-10-31 09:22:53 +00:00
|
|
|
static inline HRESULT return_null_bstr(BSTR *p)
|
|
|
|
{
|
|
|
|
if(!p)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*p = NULL;
|
|
|
|
return S_FALSE;
|
|
|
|
}
|
|
|
|
|
2008-01-07 19:04:50 +00:00
|
|
|
#endif
|
|
|
|
|
2010-10-01 11:42:22 +00:00
|
|
|
extern void* libxslt_handle;
|
2008-11-17 18:29:32 +00:00
|
|
|
#ifdef SONAME_LIBXSLT
|
|
|
|
# ifdef HAVE_LIBXSLT_PATTERN_H
|
|
|
|
# include <libxslt/pattern.h>
|
|
|
|
# endif
|
|
|
|
# ifdef HAVE_LIBXSLT_TRANSFORM_H
|
|
|
|
# include <libxslt/transform.h>
|
|
|
|
# endif
|
|
|
|
# include <libxslt/xsltutils.h>
|
|
|
|
# include <libxslt/xsltInternals.h>
|
|
|
|
|
|
|
|
# define MAKE_FUNCPTR(f) extern typeof(f) * p##f
|
|
|
|
MAKE_FUNCPTR(xsltApplyStylesheet);
|
|
|
|
MAKE_FUNCPTR(xsltCleanupGlobals);
|
|
|
|
MAKE_FUNCPTR(xsltFreeStylesheet);
|
|
|
|
MAKE_FUNCPTR(xsltParseStylesheetDoc);
|
|
|
|
# undef MAKE_FUNCPTR
|
|
|
|
#endif
|
|
|
|
|
2008-01-07 19:04:50 +00:00
|
|
|
extern IXMLDOMParseError *create_parseError( LONG code, BSTR url, BSTR reason, BSTR srcText,
|
|
|
|
LONG line, LONG linepos, LONG filepos );
|
2010-09-14 05:15:31 +00:00
|
|
|
extern HRESULT DOMDocument_create( const GUID *clsid, IUnknown *pUnkOuter, void **ppObj );
|
2010-11-24 19:53:47 +00:00
|
|
|
extern HRESULT SchemaCache_create( const GUID *clsid, IUnknown *pUnkOuter, void **ppObj );
|
2010-09-14 05:15:31 +00:00
|
|
|
extern HRESULT XMLDocument_create( IUnknown *pUnkOuter, void **pObj );
|
|
|
|
extern HRESULT SAXXMLReader_create(IUnknown *pUnkOuter, void **pObj );
|
|
|
|
extern HRESULT XMLHTTPRequest_create(IUnknown *pUnkOuter, void **pObj);
|
2008-01-07 19:04:50 +00:00
|
|
|
|
2010-11-24 19:53:47 +00:00
|
|
|
static inline const CLSID* DOMDocument_version(const MSXML_VERSION v)
|
|
|
|
{
|
|
|
|
CLSID const* clsid;
|
|
|
|
switch (v)
|
|
|
|
{
|
|
|
|
case MSXML_DEFAULT:
|
|
|
|
clsid = &CLSID_DOMDocument;
|
|
|
|
break;
|
|
|
|
case MSXML3:
|
|
|
|
clsid = &CLSID_DOMDocument30;
|
|
|
|
break;
|
|
|
|
case MSXML4:
|
|
|
|
clsid = &CLSID_DOMDocument40;
|
|
|
|
break;
|
|
|
|
case MSXML6:
|
|
|
|
clsid = &CLSID_DOMDocument60;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return clsid;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline const CLSID* SchemaCache_version(const MSXML_VERSION v)
|
|
|
|
{
|
|
|
|
CLSID const* clsid;
|
|
|
|
switch (v)
|
|
|
|
{
|
|
|
|
case MSXML_DEFAULT:
|
|
|
|
clsid = &CLSID_XMLSchemaCache;
|
|
|
|
break;
|
|
|
|
case MSXML3:
|
|
|
|
clsid = &CLSID_XMLSchemaCache30;
|
|
|
|
break;
|
|
|
|
case MSXML4:
|
|
|
|
clsid = &CLSID_XMLSchemaCache40;
|
|
|
|
break;
|
|
|
|
case MSXML6:
|
|
|
|
clsid = &CLSID_XMLSchemaCache60;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return clsid;
|
|
|
|
}
|
|
|
|
|
2008-07-27 17:54:38 +00:00
|
|
|
typedef struct bsc_t bsc_t;
|
|
|
|
|
|
|
|
HRESULT bind_url(LPCWSTR, HRESULT (*onDataAvailable)(void*,char*,DWORD), void*, bsc_t**);
|
|
|
|
void detach_bsc(bsc_t*);
|
|
|
|
|
2008-08-21 21:37:48 +00:00
|
|
|
/* memory allocation functions */
|
|
|
|
|
|
|
|
static inline void *heap_alloc(size_t len)
|
|
|
|
{
|
|
|
|
return HeapAlloc(GetProcessHeap(), 0, len);
|
|
|
|
}
|
2008-02-14 09:55:33 +00:00
|
|
|
|
2008-08-21 21:37:48 +00:00
|
|
|
static inline void *heap_alloc_zero(size_t len)
|
|
|
|
{
|
|
|
|
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void *heap_realloc(void *mem, size_t len)
|
|
|
|
{
|
|
|
|
return HeapReAlloc(GetProcessHeap(), 0, mem, len);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline BOOL heap_free(void *mem)
|
|
|
|
{
|
|
|
|
return HeapFree(GetProcessHeap(), 0, mem);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline LPWSTR heap_strdupW(LPCWSTR str)
|
|
|
|
{
|
|
|
|
LPWSTR ret = NULL;
|
|
|
|
|
|
|
|
if(str) {
|
|
|
|
DWORD size;
|
|
|
|
|
|
|
|
size = (strlenW(str)+1)*sizeof(WCHAR);
|
|
|
|
ret = heap_alloc(size);
|
|
|
|
memcpy(ret, str, size);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
2008-02-14 09:55:33 +00:00
|
|
|
|
2010-11-01 19:12:04 +00:00
|
|
|
/* Error Codes - not defined anywhere in the public headers */
|
|
|
|
#define E_XML_ELEMENT_UNDECLARED 0xC00CE00D
|
|
|
|
#define E_XML_ELEMENT_ID_NOT_FOUND 0xC00CE00E
|
|
|
|
/* ... */
|
|
|
|
#define E_XML_EMPTY_NOT_ALLOWED 0xC00CE011
|
|
|
|
#define E_XML_ELEMENT_NOT_COMPLETE 0xC00CE012
|
|
|
|
#define E_XML_ROOT_NAME_MISMATCH 0xC00CE013
|
|
|
|
#define E_XML_INVALID_CONTENT 0xC00CE014
|
|
|
|
#define E_XML_ATTRIBUTE_NOT_DEFINED 0xC00CE015
|
|
|
|
#define E_XML_ATTRIBUTE_FIXED 0xC00CE016
|
|
|
|
#define E_XML_ATTRIBUTE_VALUE 0xC00CE017
|
|
|
|
#define E_XML_ILLEGAL_TEXT 0xC00CE018
|
|
|
|
/* ... */
|
|
|
|
#define E_XML_REQUIRED_ATTRIBUTE_MISSING 0xC00CE020
|
|
|
|
|
2005-08-02 11:29:04 +00:00
|
|
|
#endif /* __MSXML_PRIVATE__ */
|