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

msxml3: Support creating IXMLParser Interface.

parent 83daee9a
...@@ -34,7 +34,8 @@ C_SRCS = \ ...@@ -34,7 +34,8 @@ C_SRCS = \
uuid.c \ uuid.c \
xdr.c \ xdr.c \
xmldoc.c \ xmldoc.c \
xmlelem.c xmlelem.c \
xmlparser.c
LEX_SRCS = xslpattern.l LEX_SRCS = xslpattern.l
...@@ -44,6 +45,8 @@ RC_SRCS = \ ...@@ -44,6 +45,8 @@ RC_SRCS = \
schemas.rc \ schemas.rc \
version.rc version.rc
IDL_R_SRCS = xmlparser.idl
IDL_H_SRCS = xmlparser.idl IDL_H_SRCS = xmlparser.idl
IDL_TLB_SRCS = msxml3_v1.idl IDL_TLB_SRCS = msxml3_v1.idl
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "ole2.h" #include "ole2.h"
#include "msxml.h" #include "msxml.h"
#include "msxml2.h" #include "msxml2.h"
#include "xmlparser.h"
/* undef the #define in msxml2 so that we can access the v.2 version /* undef the #define in msxml2 so that we can access the v.2 version
independent CLSID as well as the v.3 one. */ independent CLSID as well as the v.3 one. */
...@@ -270,6 +271,7 @@ static ClassFactory saxreadcf = { { &ClassFactoryVtbl }, SAXXMLReader_create }; ...@@ -270,6 +271,7 @@ static ClassFactory saxreadcf = { { &ClassFactoryVtbl }, SAXXMLReader_create };
static ClassFactory httpreqcf = { { &ClassFactoryVtbl }, XMLHTTPRequest_create }; static ClassFactory httpreqcf = { { &ClassFactoryVtbl }, XMLHTTPRequest_create };
static ClassFactory xsltemplatecf = { { &ClassFactoryVtbl }, XSLTemplate_create }; static ClassFactory xsltemplatecf = { { &ClassFactoryVtbl }, XSLTemplate_create };
static ClassFactory mxnsmanagercf = { {&ClassFactoryVtbl }, MXNamespaceManager_create }; static ClassFactory mxnsmanagercf = { {&ClassFactoryVtbl }, MXNamespaceManager_create };
static ClassFactory xmlparsercf = { { &ClassFactoryVtbl }, XMLParser_create };
/****************************************************************** /******************************************************************
* DllGetClassObject (MSXML3.@) * DllGetClassObject (MSXML3.@)
...@@ -347,6 +349,12 @@ HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID riid, void **ppv ) ...@@ -347,6 +349,12 @@ HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID riid, void **ppv )
{ {
cf = &mxnsmanagercf.IClassFactory_iface; cf = &mxnsmanagercf.IClassFactory_iface;
} }
else if( IsEqualCLSID( rclsid, &CLSID_XMLParser ) ||
IsEqualCLSID( rclsid, &CLSID_XMLParser26 ) ||
IsEqualCLSID( rclsid, &CLSID_XMLParser30 ) )
{
cf = &xmlparsercf.IClassFactory_iface;
}
if ( !cf ) if ( !cf )
return CLASS_E_CLASSNOTAVAILABLE; return CLASS_E_CLASSNOTAVAILABLE;
......
...@@ -438,6 +438,7 @@ extern HRESULT XMLHTTPRequest_create(IUnknown*, void **) DECLSPEC_HIDDEN; ...@@ -438,6 +438,7 @@ extern HRESULT XMLHTTPRequest_create(IUnknown*, void **) DECLSPEC_HIDDEN;
extern HRESULT XSLTemplate_create(IUnknown*, void**) DECLSPEC_HIDDEN; extern HRESULT XSLTemplate_create(IUnknown*, void**) DECLSPEC_HIDDEN;
extern HRESULT MXWriter_create(MSXML_VERSION, IUnknown*, void**) DECLSPEC_HIDDEN; extern HRESULT MXWriter_create(MSXML_VERSION, IUnknown*, void**) DECLSPEC_HIDDEN;
extern HRESULT MXNamespaceManager_create(IUnknown*,void**) DECLSPEC_HIDDEN; extern HRESULT MXNamespaceManager_create(IUnknown*,void**) DECLSPEC_HIDDEN;
extern HRESULT XMLParser_create(IUnknown*,void**) DECLSPEC_HIDDEN;
static inline const CLSID* DOMDocument_version(MSXML_VERSION v) static inline const CLSID* DOMDocument_version(MSXML_VERSION v)
{ {
......
...@@ -5,6 +5,7 @@ C_SRCS = \ ...@@ -5,6 +5,7 @@ C_SRCS = \
domdoc.c \ domdoc.c \
saxreader.c \ saxreader.c \
schema.c \ schema.c \
xmldoc.c xmldoc.c \
xmlparser.c
@MAKE_TEST_RULES@ @MAKE_TEST_RULES@
/*
* XML Parser implementation
*
* Copyright 2011 Alistair Leslie-Hughes
*
* 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
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#define CONST_VTABLE
#include <stdio.h>
#include <assert.h>
#include "windows.h"
#include "ole2.h"
#include "initguid.h"
#include "wine/test.h"
DEFINE_GUID(IID_IXMLParser, 0xd242361e, 0x51a0, 0x11d2, 0x9c,0xaf, 0x00,0x60,0xb0,0xec,0x3d,0x39);
DEFINE_GUID(CLSID_XMLParser30, 0xf5078f31, 0xc551, 0x11d3, 0x89,0xb9, 0x00,0x00,0xf8,0x1f,0xe2,0x21);
static void create_test(void)
{
HRESULT hr;
IUnknown *parser;
hr = CoCreateInstance(&CLSID_XMLParser30, NULL, CLSCTX_INPROC_SERVER, &IID_IXMLParser, (void**)&parser);
if (FAILED(hr))
{
win_skip("IXMLParser is not available (0x%08x)\n", hr);
return;
}
IUnknown_Release(parser);
}
START_TEST(xmlparser)
{
HRESULT hr;
hr = CoInitialize( NULL );
ok( hr == S_OK, "failed to init com\n");
if (hr != S_OK)
return;
create_test();
CoUninitialize();
}
...@@ -324,9 +324,15 @@ interface IXMLParser : IXMLNodeSource ...@@ -324,9 +324,15 @@ interface IXMLParser : IXMLNodeSource
HRESULT GetSecureBaseURL([out] const WCHAR** ppwcBuf); HRESULT GetSecureBaseURL([out] const WCHAR** ppwcBuf);
}; };
}
[ [
uuid(f5078f19-c551-11d3-89b9-0000f81fe221) helpstring("XML Parser"),
uuid(f5078f19-c551-11d3-89b9-0000f81fe221),
threading(both),
progid("Msxml2.XMLParser"),
vi_progid("Msxml2.XMLParser"),
version(3.0)
] ]
coclass XMLParser coclass XMLParser
{ {
...@@ -334,7 +340,12 @@ coclass XMLParser ...@@ -334,7 +340,12 @@ coclass XMLParser
}; };
[ [
uuid(f5078f20-c551-11d3-89b9-0000f81fe221) helpstring("XML Parser 2.6"),
uuid(f5078f20-c551-11d3-89b9-0000f81fe221),
threading(both),
progid("Msxml2.XMLParser.2.6"),
vi_progid("Msxml2.XMLParser"),
version(2.6)
] ]
coclass XMLParser26 coclass XMLParser26
{ {
...@@ -342,11 +353,14 @@ coclass XMLParser26 ...@@ -342,11 +353,14 @@ coclass XMLParser26
}; };
[ [
uuid(f5078f31-c551-11d3-89b9-0000f81fe221) helpstring("XML Parser 3.0"),
uuid(f5078f31-c551-11d3-89b9-0000f81fe221),
threading(both),
progid("Msxml2.XMLParser.3.0"),
vi_progid("Msxml2.XMLParser"),
version(3.0)
] ]
coclass XMLParser30 coclass XMLParser30
{ {
[default] interface IXMLParser; [default] interface IXMLParser;
}; };
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment