2 * Copyright (C) 2011 Alistair Leslie-Hughes
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 interface IXMLNodeSource;
25 interface IXMLNodeFactory;
62 XML_VERSION = XML_LASTNODETYPE,
98 XML_E_PARSEERRORBASE = 0xC00CE500L,
100 XML_E_ENDOFINPUT = XML_E_PARSEERRORBASE,
101 XML_E_MISSINGEQUALS = 0xC00CE501,
102 XML_E_MISSINGQUOTE = 0xC00CE502,
103 XML_E_COMMENTSYNTAX = 0xC00CE503,
104 XML_E_BADSTARTNAMECHAR = 0xC00CE504,
105 XML_E_BADNAMECHAR = 0xC00CE505,
106 XML_E_BADCHARINSTRING = 0xC00CE506,
107 XML_E_XMLDECLSYNTAX = 0xC00CE507,
108 XML_E_BADCHARDATA = 0xC00CE508,
109 XML_E_MISSINGWHITESPACE = 0xC00CE509,
110 XML_E_EXPECTINGTAGEND = 0xC00CE50A,
111 XML_E_BADCHARINDTD = 0xC00CE50B,
112 XML_E_BADCHARINDECL = 0xC00CE50C,
113 XML_E_MISSINGSEMICOLON = 0xC00CE50D,
114 XML_E_BADCHARINENTREF = 0xC00CE50E,
115 XML_E_UNBALANCEDPAREN = 0xC00CE50F,
116 XML_E_EXPECTINGOPENBRACKET = 0xC00CE510,
117 XML_E_BADENDCONDSECT = 0xC00CE511,
118 XML_E_INTERNALERROR = 0xC00CE512,
119 XML_E_UNEXPECTED_WHITESPACE = 0xC00CE513,
120 XML_E_INCOMPLETE_ENCODING = 0xC00CE514,
121 XML_E_BADCHARINMIXEDMODEL = 0xC00CE515,
122 XML_E_MISSING_STAR = 0xC00CE516,
123 XML_E_BADCHARINMODEL = 0xC00CE517,
124 XML_E_MISSING_PAREN = 0xC00CE518,
125 XML_E_BADCHARINENUMERATION = 0xC00CE519,
126 XML_E_PIDECLSYNTAX = 0xC00CE51A,
127 XML_E_EXPECTINGCLOSEQUOTE = 0xC00CE51B,
128 XML_E_MULTIPLE_COLONS = 0xC00CE51C,
129 XML_E_INVALID_DECIMAL = 0xC00CE51D,
130 XML_E_INVALID_HEXIDECIMAL = 0xC00CE51E,
131 XML_E_INVALID_UNICODE = 0xC00CE51F,
132 XML_E_WHITESPACEORQUESTIONMARK = 0xC00CE520,
133 XML_E_ENDOFPE = 0xC00CE521,
135 XML_E_TOKEN_ERROR = XML_E_PARSEERRORBASE + 0x50,
136 XML_E_SUSPENDED = 0xC00CE550,
137 XML_E_STOPPED = 0xC00CE551,
138 XML_E_UNEXPECTEDENDTAG = 0xC00CE552,
139 XML_E_UNCLOSEDTAG = 0xC00CE553,
140 XML_E_DUPLICATEATTRIBUTE = 0xC00CE554,
141 XML_E_MULTIPLEROOTS = 0xC00CE555,
142 XML_E_INVALIDATROOTLEVEL = 0xC00CE556,
143 XML_E_BADXMLDECL = 0xC00CE557,
144 XML_E_MISSINGROOT = 0xC00CE558,
145 XML_E_UNEXPECTEDEOF = 0xC00CE559,
146 XML_E_BADPEREFINSUBSET = 0xC00CE55A,
147 XML_E_PE_NESTING = 0xC00CE55B,
148 XML_E_INVALID_CDATACLOSINGTAG = 0xC00CE55C,
149 XML_E_UNCLOSEDPI = 0xC00CE55D,
150 XML_E_UNCLOSEDSTARTTAG = 0xC00CE55E,
151 XML_E_UNCLOSEDENDTAG = 0xC00CE55F,
152 XML_E_UNCLOSEDSTRING = 0xC00CE560,
153 XML_E_UNCLOSEDCOMMENT = 0xC00CE561,
154 XML_E_UNCLOSEDDECL = 0xC00CE562,
155 XML_E_UNCLOSEDMARKUPDECL = 0xC00CE563,
156 XML_E_UNCLOSEDCDATA = 0xC00CE564,
157 XML_E_BADDECLNAME = 0xC00CE565,
158 XML_E_BADEXTERNALID = 0xC00CE566,
159 XML_E_BADELEMENTINDTD = 0xC00CE567,
160 XML_E_RESERVEDNAMESPACE = 0xC00CE568,
161 XML_E_EXPECTING_VERSION = 0xC00CE569,
162 XML_E_EXPECTING_ENCODING = 0xC00CE56A,
163 XML_E_EXPECTING_NAME = 0xC00CE56B,
164 XML_E_UNEXPECTED_ATTRIBUTE = 0xC00CE56C,
165 XML_E_ENDTAGMISMATCH = 0xC00CE56D,
166 XML_E_INVALIDENCODING = 0xC00CE56E,
167 XML_E_INVALIDSWITCH = 0xC00CE56F,
168 XML_E_EXPECTING_NDATA = 0xC00CE570,
169 XML_E_INVALID_MODEL = 0xC00CE571,
170 XML_E_INVALID_TYPE = 0xC00CE572,
171 XML_E_INVALIDXMLSPACE = 0xC00CE573,
172 XML_E_MULTI_ATTR_VALUE = 0xC00CE574,
173 XML_E_INVALID_PRESENCE = 0xC00CE575,
174 XML_E_BADXMLCASE = 0xC00CE576,
175 XML_E_CONDSECTINSUBSET = 0xC00CE577,
176 XML_E_CDATAINVALID = 0xC00CE578,
177 XML_E_INVALID_STANDALONE = 0xC00CE579,
178 XML_E_UNEXPECTED_STANDALONE = 0xC00CE57A,
179 XML_E_DOCTYPE_IN_DTD = 0xC00CE57B,
180 XML_E_MISSING_ENTITY = 0xC00CE57C,
181 XML_E_ENTITYREF_INNAME = 0xC00CE57D,
182 XML_E_DOCTYPE_OUTSIDE_PROLOG = 0xC00CE57E,
183 XML_E_INVALID_VERSION = 0xC00CE57F,
184 XML_E_DTDELEMENT_OUTSIDE_DTD = 0xC00CE580,
185 XML_E_DUPLICATEDOCTYPE = 0xC00CE581,
186 XML_E_RESOURCE = 0xC00CE582,
187 XML_E_MISSINGNAME = 0xC00CE583,
188 XML_E_LASTERROR = 0xC00CE584
203 XMLFLAG_FLOATINGAMP = 0x00000001,
204 XMLFLAG_SHORTENDTAGS = 0x00000002,
205 XMLFLAG_CASEINSENSITIVE = 0x00000004,
206 XMLFLAG_NONAMESPACES = 0x00000008,
207 XMLFLAG_NOWHITESPACE = 0x00000010,
208 XMLFLAG_IE4QUIRKS = 0x00000020,
209 XMLFLAG_NODTDNODES = 0x00000040,
210 XMLFLAG_IE4COMPATIBILITY = 0x000000FF,
211 XMLFLAG_IE5COMPATIBILITY = 0x00000100,
212 XMLFLAG_SAX = 0x00000200,
213 XMLFLAG_NORMALIZELB = 0x00000400,
214 XMLFLAG_IGNOREENCODING = 0x00000800,
215 XMLFLAG_USEWINHTTP = 0x00001000,
216 XMLFLAG_RUNBUFFERONLY = 0x00002000,
217 XMLFLAG_PROHIBIT_DTD = 0x00008000
226 XMLNF_STARTDTDSUBSET,
233 XMLNF_LASTEVENT = XMLNF_DATAAVAILABLE
234 } XML_NODEFACTORY_EVENT;
236 typedef struct _XML_NODE_INFO
242 const WCHAR* pwcText;
250 uuid(d242361c-51a0-11d2-9caf-0060b0ec3d39),
251 helpstring("Microsoft XML Parser 1.0"),
257 importlib("stdole32.tlb");
258 importlib("stdole2.tlb");
263 pointer_default(unique),
264 helpstring("IXMLNodeFactory Interface"),
265 uuid(d242361f-51a0-11d2-9caf-0060b0ec3d39)
267 interface IXMLNodeFactory : IUnknown
269 HRESULT NotifyEvent([in] IXMLNodeSource* pSource,[in] XML_NODEFACTORY_EVENT iEvt);
270 HRESULT BeginChildren([in] IXMLNodeSource* pSource, [in] XML_NODE_INFO* pNodeInfo);
271 HRESULT EndChildren([in] IXMLNodeSource* pSource, [in] BOOL fEmpty, [in] XML_NODE_INFO* pNodeInfo);
272 HRESULT Error([in] IXMLNodeSource* pSource,[in] HRESULT hrErrorCode,
273 [in] USHORT cNumRecs, [in] XML_NODE_INFO** ppNodeInfo);
274 HRESULT CreateNode([in] IXMLNodeSource* pSource, [in] PVOID pNodeParent, [in] USHORT cNumRecs,
275 [in] XML_NODE_INFO** ppNodeInfo);
281 pointer_default(unique),
282 uuid(d242361d-51a0-11d2-9caf-0060b0ec3d39)
284 interface IXMLNodeSource : IUnknown
286 HRESULT SetFactory([in] IXMLNodeFactory* pNodeFactory);
287 HRESULT GetFactory([out] IXMLNodeFactory** ppNodeFactory);
288 HRESULT Abort([in] BSTR bstrErrorInfo);
289 ULONG GetLineNumber();
290 ULONG GetLinePosition();
291 ULONG GetAbsolutePosition();
292 HRESULT GetLineBuffer([out] const WCHAR** ppBuf,[out] ULONG* Len, [out] ULONG* StartPos);
293 HRESULT GetLastError();
294 HRESULT GetErrorInfo([out] BSTR* pErrorInfo);
296 HRESULT GetURL([out] const WCHAR** ppBuf);
302 pointer_default(unique),
303 helpstring("IXMLParser Interface"),
304 uuid(d242361e-51a0-11d2-9caf-0060b0ec3d39)
306 interface IXMLParser : IXMLNodeSource
308 HRESULT SetURL([in] const WCHAR* pszBaseUrl,[in] const WCHAR* pszRelativeUrl,[in] BOOL fAsync);
309 HRESULT Load([in] BOOL fFullyAvailable, [in] IMoniker *pimkName, [in] LPBC pibc, [in] DWORD grfMode);
310 HRESULT SetInput([in] IUnknown *pStm);
311 HRESULT PushData([in] const char* pData, [in] ULONG ulChars, [in] BOOL fLastBuffer);
312 HRESULT LoadDTD([in] const WCHAR* pszBaseUrl, [in] const WCHAR* pszRelativeUrl);
313 HRESULT LoadEntity([in] const WCHAR* pszBaseUrl, [in] const WCHAR* pszRelativeUrl, [in] BOOL fpe);
314 HRESULT ParseEntity([in] const WCHAR* pwcText, [in] ULONG ulLen, [in] BOOL fpe);
315 HRESULT ExpandEntity([in] const WCHAR* pwcText, [in] ULONG ulLen);
316 HRESULT SetRoot([in] PVOID pRoot);
317 HRESULT GetRoot([in] PVOID* ppRoot);
318 HRESULT Run([in] long lChars);
319 HRESULT GetParserState();
322 HRESULT SetFlags([in] ULONG iFlags);
323 HRESULT SetSecureBaseURL([in] const WCHAR* pszBaseUrl);
324 HRESULT GetSecureBaseURL([out] const WCHAR** ppwcBuf);
330 helpstring("XML Parser"),
331 uuid(f5078f19-c551-11d3-89b9-0000f81fe221),
333 progid("Msxml2.XMLParser"),
334 vi_progid("Msxml2.XMLParser"),
339 [default] interface IXMLParser;
343 helpstring("XML Parser 2.6"),
344 uuid(f5078f20-c551-11d3-89b9-0000f81fe221),
346 progid("Msxml2.XMLParser.2.6"),
347 vi_progid("Msxml2.XMLParser"),
352 [default] interface IXMLParser;
356 helpstring("XML Parser 3.0"),
357 uuid(f5078f31-c551-11d3-89b9-0000f81fe221),
359 progid("Msxml2.XMLParser.3.0"),
360 vi_progid("Msxml2.XMLParser"),
365 [default] interface IXMLParser;