ReactOS 0.4.16-dev-2232-gc2aaa52
xmlreader.h
Go to the documentation of this file.
1/*
2 * Summary: the XMLReader implementation
3 * Description: API of the XML streaming API based on C# interfaces.
4 *
5 * Copy: See Copyright for the status of this software.
6 *
7 * Author: Daniel Veillard
8 */
9
10#ifndef __XML_XMLREADER_H__
11#define __XML_XMLREADER_H__
12
13#include <libxml/xmlversion.h>
14#include <libxml/tree.h>
15#include <libxml/xmlerror.h>
16#include <libxml/xmlIO.h>
17#ifdef LIBXML_SCHEMAS_ENABLED
18#include <libxml/relaxng.h>
19#include <libxml/xmlschemas.h>
20#endif
21/* for compatibility */
22#include <libxml/parser.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
34typedef enum {
40
41#ifdef LIBXML_READER_ENABLED
42
48typedef enum {
49 XML_TEXTREADER_MODE_INITIAL = 0,
50 XML_TEXTREADER_MODE_INTERACTIVE = 1,
51 XML_TEXTREADER_MODE_ERROR = 2,
52 XML_TEXTREADER_MODE_EOF =3,
53 XML_TEXTREADER_MODE_CLOSED = 4,
54 XML_TEXTREADER_MODE_READING = 5
55} xmlTextReaderMode;
56
64typedef enum {
65 XML_PARSER_LOADDTD = 1,
66 XML_PARSER_DEFAULTATTRS = 2,
67 XML_PARSER_VALIDATE = 3,
68 XML_PARSER_SUBST_ENTITIES = 4
69} xmlParserProperties;
70
76typedef enum {
77 XML_READER_TYPE_NONE = 0,
78 XML_READER_TYPE_ELEMENT = 1,
79 XML_READER_TYPE_ATTRIBUTE = 2,
80 XML_READER_TYPE_TEXT = 3,
81 XML_READER_TYPE_CDATA = 4,
82 XML_READER_TYPE_ENTITY_REFERENCE = 5,
83 XML_READER_TYPE_ENTITY = 6,
84 XML_READER_TYPE_PROCESSING_INSTRUCTION = 7,
85 XML_READER_TYPE_COMMENT = 8,
86 XML_READER_TYPE_DOCUMENT = 9,
87 XML_READER_TYPE_DOCUMENT_TYPE = 10,
88 XML_READER_TYPE_DOCUMENT_FRAGMENT = 11,
89 XML_READER_TYPE_NOTATION = 12,
90 XML_READER_TYPE_WHITESPACE = 13,
91 XML_READER_TYPE_SIGNIFICANT_WHITESPACE = 14,
92 XML_READER_TYPE_END_ELEMENT = 15,
93 XML_READER_TYPE_END_ENTITY = 16,
94 XML_READER_TYPE_XML_DECLARATION = 17
95} xmlReaderTypes;
96
102typedef struct _xmlTextReader xmlTextReader;
103
109typedef xmlTextReader *xmlTextReaderPtr;
110
111/*
112 * Constructors & Destructor
113 */
114XMLPUBFUN xmlTextReaderPtr
115 xmlNewTextReader (xmlParserInputBufferPtr input,
116 const char *URI);
117XMLPUBFUN xmlTextReaderPtr
118 xmlNewTextReaderFilename(const char *URI);
119
120XMLPUBFUN void
121 xmlFreeTextReader (xmlTextReaderPtr reader);
122
123XMLPUBFUN int
124 xmlTextReaderSetup(xmlTextReaderPtr reader,
125 xmlParserInputBufferPtr input, const char *URL,
126 const char *encoding, int options);
127XMLPUBFUN void
128 xmlTextReaderSetMaxAmplification(xmlTextReaderPtr reader,
129 unsigned maxAmpl);
130
131/*
132 * Iterators
133 */
134XMLPUBFUN int
135 xmlTextReaderRead (xmlTextReaderPtr reader);
136
137#ifdef LIBXML_WRITER_ENABLED
139 xmlTextReaderReadInnerXml(xmlTextReaderPtr reader);
140
142 xmlTextReaderReadOuterXml(xmlTextReaderPtr reader);
143#endif
144
146 xmlTextReaderReadString (xmlTextReaderPtr reader);
147XMLPUBFUN int
148 xmlTextReaderReadAttributeValue(xmlTextReaderPtr reader);
149
150/*
151 * Attributes of the node
152 */
153XMLPUBFUN int
154 xmlTextReaderAttributeCount(xmlTextReaderPtr reader);
155XMLPUBFUN int
156 xmlTextReaderDepth (xmlTextReaderPtr reader);
157XMLPUBFUN int
158 xmlTextReaderHasAttributes(xmlTextReaderPtr reader);
159XMLPUBFUN int
160 xmlTextReaderHasValue(xmlTextReaderPtr reader);
161XMLPUBFUN int
162 xmlTextReaderIsDefault (xmlTextReaderPtr reader);
163XMLPUBFUN int
164 xmlTextReaderIsEmptyElement(xmlTextReaderPtr reader);
165XMLPUBFUN int
166 xmlTextReaderNodeType (xmlTextReaderPtr reader);
167XMLPUBFUN int
168 xmlTextReaderQuoteChar (xmlTextReaderPtr reader);
169XMLPUBFUN int
170 xmlTextReaderReadState (xmlTextReaderPtr reader);
171XMLPUBFUN int
172 xmlTextReaderIsNamespaceDecl(xmlTextReaderPtr reader);
173
174XMLPUBFUN const xmlChar *
175 xmlTextReaderConstBaseUri (xmlTextReaderPtr reader);
176XMLPUBFUN const xmlChar *
177 xmlTextReaderConstLocalName (xmlTextReaderPtr reader);
178XMLPUBFUN const xmlChar *
179 xmlTextReaderConstName (xmlTextReaderPtr reader);
180XMLPUBFUN const xmlChar *
181 xmlTextReaderConstNamespaceUri(xmlTextReaderPtr reader);
182XMLPUBFUN const xmlChar *
183 xmlTextReaderConstPrefix (xmlTextReaderPtr reader);
184XMLPUBFUN const xmlChar *
185 xmlTextReaderConstXmlLang (xmlTextReaderPtr reader);
186XMLPUBFUN const xmlChar *
187 xmlTextReaderConstString (xmlTextReaderPtr reader,
188 const xmlChar *str);
189XMLPUBFUN const xmlChar *
190 xmlTextReaderConstValue (xmlTextReaderPtr reader);
191
192/*
193 * use the Const version of the routine for
194 * better performance and simpler code
195 */
197 xmlTextReaderBaseUri (xmlTextReaderPtr reader);
199 xmlTextReaderLocalName (xmlTextReaderPtr reader);
201 xmlTextReaderName (xmlTextReaderPtr reader);
203 xmlTextReaderNamespaceUri(xmlTextReaderPtr reader);
205 xmlTextReaderPrefix (xmlTextReaderPtr reader);
207 xmlTextReaderXmlLang (xmlTextReaderPtr reader);
209 xmlTextReaderValue (xmlTextReaderPtr reader);
210
211/*
212 * Methods of the XmlTextReader
213 */
214XMLPUBFUN int
215 xmlTextReaderClose (xmlTextReaderPtr reader);
217 xmlTextReaderGetAttributeNo (xmlTextReaderPtr reader,
218 int no);
220 xmlTextReaderGetAttribute (xmlTextReaderPtr reader,
221 const xmlChar *name);
223 xmlTextReaderGetAttributeNs (xmlTextReaderPtr reader,
224 const xmlChar *localName,
225 const xmlChar *namespaceURI);
226XMLPUBFUN xmlParserInputBufferPtr
227 xmlTextReaderGetRemainder (xmlTextReaderPtr reader);
229 xmlTextReaderLookupNamespace(xmlTextReaderPtr reader,
230 const xmlChar *prefix);
231XMLPUBFUN int
232 xmlTextReaderMoveToAttributeNo(xmlTextReaderPtr reader,
233 int no);
234XMLPUBFUN int
235 xmlTextReaderMoveToAttribute(xmlTextReaderPtr reader,
236 const xmlChar *name);
237XMLPUBFUN int
238 xmlTextReaderMoveToAttributeNs(xmlTextReaderPtr reader,
239 const xmlChar *localName,
240 const xmlChar *namespaceURI);
241XMLPUBFUN int
242 xmlTextReaderMoveToFirstAttribute(xmlTextReaderPtr reader);
243XMLPUBFUN int
244 xmlTextReaderMoveToNextAttribute(xmlTextReaderPtr reader);
245XMLPUBFUN int
246 xmlTextReaderMoveToElement (xmlTextReaderPtr reader);
247XMLPUBFUN int
248 xmlTextReaderNormalization (xmlTextReaderPtr reader);
249XMLPUBFUN const xmlChar *
250 xmlTextReaderConstEncoding (xmlTextReaderPtr reader);
251
252/*
253 * Extensions
254 */
255XMLPUBFUN int
256 xmlTextReaderSetParserProp (xmlTextReaderPtr reader,
257 int prop,
258 int value);
259XMLPUBFUN int
260 xmlTextReaderGetParserProp (xmlTextReaderPtr reader,
261 int prop);
262XMLPUBFUN xmlNodePtr
263 xmlTextReaderCurrentNode (xmlTextReaderPtr reader);
264
265XMLPUBFUN int
266 xmlTextReaderGetParserLineNumber(xmlTextReaderPtr reader);
267
268XMLPUBFUN int
269 xmlTextReaderGetParserColumnNumber(xmlTextReaderPtr reader);
270
271XMLPUBFUN xmlNodePtr
272 xmlTextReaderPreserve (xmlTextReaderPtr reader);
273#ifdef LIBXML_PATTERN_ENABLED
274XMLPUBFUN int
275 xmlTextReaderPreservePattern(xmlTextReaderPtr reader,
276 const xmlChar *pattern,
277 const xmlChar **namespaces);
278#endif /* LIBXML_PATTERN_ENABLED */
279XMLPUBFUN xmlDocPtr
280 xmlTextReaderCurrentDoc (xmlTextReaderPtr reader);
281XMLPUBFUN xmlNodePtr
282 xmlTextReaderExpand (xmlTextReaderPtr reader);
283XMLPUBFUN int
284 xmlTextReaderNext (xmlTextReaderPtr reader);
285XMLPUBFUN int
286 xmlTextReaderNextSibling (xmlTextReaderPtr reader);
287XMLPUBFUN int
288 xmlTextReaderIsValid (xmlTextReaderPtr reader);
289#ifdef LIBXML_SCHEMAS_ENABLED
290XMLPUBFUN int
291 xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader,
292 const char *rng);
293XMLPUBFUN int
294 xmlTextReaderRelaxNGValidateCtxt(xmlTextReaderPtr reader,
295 xmlRelaxNGValidCtxtPtr ctxt,
296 int options);
297
298XMLPUBFUN int
299 xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader,
300 xmlRelaxNGPtr schema);
301XMLPUBFUN int
302 xmlTextReaderSchemaValidate (xmlTextReaderPtr reader,
303 const char *xsd);
304XMLPUBFUN int
305 xmlTextReaderSchemaValidateCtxt(xmlTextReaderPtr reader,
306 xmlSchemaValidCtxtPtr ctxt,
307 int options);
308XMLPUBFUN int
309 xmlTextReaderSetSchema (xmlTextReaderPtr reader,
310 xmlSchemaPtr schema);
311#endif
312XMLPUBFUN const xmlChar *
313 xmlTextReaderConstXmlVersion(xmlTextReaderPtr reader);
314XMLPUBFUN int
315 xmlTextReaderStandalone (xmlTextReaderPtr reader);
316
317
318/*
319 * Index lookup
320 */
321XMLPUBFUN long
322 xmlTextReaderByteConsumed (xmlTextReaderPtr reader);
323
324/*
325 * New more complete APIs for simpler creation and reuse of readers
326 */
327XMLPUBFUN xmlTextReaderPtr
328 xmlReaderWalker (xmlDocPtr doc);
329XMLPUBFUN xmlTextReaderPtr
330 xmlReaderForDoc (const xmlChar * cur,
331 const char *URL,
332 const char *encoding,
333 int options);
334XMLPUBFUN xmlTextReaderPtr
335 xmlReaderForFile (const char *filename,
336 const char *encoding,
337 int options);
338XMLPUBFUN xmlTextReaderPtr
339 xmlReaderForMemory (const char *buffer,
340 int size,
341 const char *URL,
342 const char *encoding,
343 int options);
344XMLPUBFUN xmlTextReaderPtr
345 xmlReaderForFd (int fd,
346 const char *URL,
347 const char *encoding,
348 int options);
349XMLPUBFUN xmlTextReaderPtr
350 xmlReaderForIO (xmlInputReadCallback ioread,
351 xmlInputCloseCallback ioclose,
352 void *ioctx,
353 const char *URL,
354 const char *encoding,
355 int options);
356
357XMLPUBFUN int
358 xmlReaderNewWalker (xmlTextReaderPtr reader,
359 xmlDocPtr doc);
360XMLPUBFUN int
361 xmlReaderNewDoc (xmlTextReaderPtr reader,
362 const xmlChar * cur,
363 const char *URL,
364 const char *encoding,
365 int options);
366XMLPUBFUN int
367 xmlReaderNewFile (xmlTextReaderPtr reader,
368 const char *filename,
369 const char *encoding,
370 int options);
371XMLPUBFUN int
372 xmlReaderNewMemory (xmlTextReaderPtr reader,
373 const char *buffer,
374 int size,
375 const char *URL,
376 const char *encoding,
377 int options);
378XMLPUBFUN int
379 xmlReaderNewFd (xmlTextReaderPtr reader,
380 int fd,
381 const char *URL,
382 const char *encoding,
383 int options);
384XMLPUBFUN int
385 xmlReaderNewIO (xmlTextReaderPtr reader,
387 xmlInputCloseCallback ioclose,
388 void *ioctx,
389 const char *URL,
390 const char *encoding,
391 int options);
392/*
393 * Error handling extensions
394 */
395typedef void * xmlTextReaderLocatorPtr;
396
406typedef void (*xmlTextReaderErrorFunc)(void *arg,
407 const char *msg,
409 xmlTextReaderLocatorPtr locator);
410XMLPUBFUN int
411 xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator);
413 xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator);
414XMLPUBFUN void
415 xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader,
416 xmlTextReaderErrorFunc f,
417 void *arg);
418XMLPUBFUN void
419 xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader,
421 void *arg);
422XMLPUBFUN void
423 xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader,
424 xmlTextReaderErrorFunc *f,
425 void **arg);
426
427#endif /* LIBXML_READER_ENABLED */
428
429#ifdef __cplusplus
430}
431#endif
432
433#endif /* __XML_XMLREADER_H__ */
#define msg(x)
Definition: auth_time.c:54
static WCHAR no[MAX_STRING_RESOURCE_LEN]
Definition: object.c:2340
FxCollectionEntry * cur
GLuint buffer
Definition: glext.h:5915
GLsizeiptr size
Definition: glext.h:5919
GLubyte * pattern
Definition: glext.h:7787
GLfloat f
Definition: glext.h:7540
GLenum GLenum severity
Definition: glext.h:7750
GLenum GLenum GLenum input
Definition: glext.h:9031
const char * filename
Definition: ioapi.h:137
const WCHAR * schema
const WCHAR * str
static int fd
Definition: io.c:51
Definition: name.c:39
Definition: reader.h:84
Character const *const prefix
Definition: tempnam.cpp:195
Definition: pdh_main.c:96
void * arg
Definition: msvc.h:10
int(* xmlInputReadCallback)(void *context, char *buffer, int len)
Definition: xmlIO.h:58
int(* xmlInputCloseCallback)(void *context)
Definition: xmlIO.h:67
void(*) typedef void(* xmlStructuredErrorFunc)(void *userData, const xmlError *error)
Definition: xmlerror.h:859
#define XMLPUBFUN
Definition: xmlexports.h:30
xmlParserSeverities
Definition: xmlreader.h:34
@ XML_PARSER_SEVERITY_ERROR
Definition: xmlreader.h:38
@ XML_PARSER_SEVERITY_WARNING
Definition: xmlreader.h:37
@ XML_PARSER_SEVERITY_VALIDITY_WARNING
Definition: xmlreader.h:35
@ XML_PARSER_SEVERITY_VALIDITY_ERROR
Definition: xmlreader.h:36
unsigned char xmlChar
Definition: xmlstring.h:28