VirtualBox

source: vbox/trunk/src/libs/libxml2-2.13.2/include/libxml/xmlreader.h@ 105420

Last change on this file since 105420 was 105420, checked in by vboxsync, 10 months ago

libxml2-2.12.6: Applied and adjusted our libxml2 changes to 2.12.6. bugref:10730

  • Property svn:eol-style set to native
File size: 11.9 KB
Line 
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
28/**
29 * xmlParserSeverities:
30 *
31 * How severe an error callback is when the per-reader error callback API
32 * is used.
33 */
34typedef enum {
35 XML_PARSER_SEVERITY_VALIDITY_WARNING = 1,
36 XML_PARSER_SEVERITY_VALIDITY_ERROR = 2,
37 XML_PARSER_SEVERITY_WARNING = 3,
38 XML_PARSER_SEVERITY_ERROR = 4
39} xmlParserSeverities;
40
41#ifdef LIBXML_READER_ENABLED
42
43/**
44 * xmlTextReaderMode:
45 *
46 * Internal state values for the reader.
47 */
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
57/**
58 * xmlParserProperties:
59 *
60 * Some common options to use with xmlTextReaderSetParserProp, but it
61 * is better to use xmlParserOption and the xmlReaderNewxxx and
62 * xmlReaderForxxx APIs now.
63 */
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
71/**
72 * xmlReaderTypes:
73 *
74 * Predefined constants for the different types of nodes.
75 */
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
97/**
98 * xmlTextReader:
99 *
100 * Structure for an xmlReader context.
101 */
102typedef struct _xmlTextReader xmlTextReader;
103
104/**
105 * xmlTextReaderPtr:
106 *
107 * Pointer to an xmlReader context.
108 */
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);
130XMLPUBFUN const xmlError *
131 xmlTextReaderGetLastError(xmlTextReaderPtr reader);
132
133/*
134 * Iterators
135 */
136XMLPUBFUN int
137 xmlTextReaderRead (xmlTextReaderPtr reader);
138
139#ifdef LIBXML_WRITER_ENABLED
140XMLPUBFUN xmlChar *
141 xmlTextReaderReadInnerXml(xmlTextReaderPtr reader);
142
143XMLPUBFUN xmlChar *
144 xmlTextReaderReadOuterXml(xmlTextReaderPtr reader);
145#endif
146
147XMLPUBFUN xmlChar *
148 xmlTextReaderReadString (xmlTextReaderPtr reader);
149XMLPUBFUN int
150 xmlTextReaderReadAttributeValue(xmlTextReaderPtr reader);
151
152/*
153 * Attributes of the node
154 */
155XMLPUBFUN int
156 xmlTextReaderAttributeCount(xmlTextReaderPtr reader);
157XMLPUBFUN int
158 xmlTextReaderDepth (xmlTextReaderPtr reader);
159XMLPUBFUN int
160 xmlTextReaderHasAttributes(xmlTextReaderPtr reader);
161XMLPUBFUN int
162 xmlTextReaderHasValue(xmlTextReaderPtr reader);
163XMLPUBFUN int
164 xmlTextReaderIsDefault (xmlTextReaderPtr reader);
165XMLPUBFUN int
166 xmlTextReaderIsEmptyElement(xmlTextReaderPtr reader);
167XMLPUBFUN int
168 xmlTextReaderNodeType (xmlTextReaderPtr reader);
169XMLPUBFUN int
170 xmlTextReaderQuoteChar (xmlTextReaderPtr reader);
171XMLPUBFUN int
172 xmlTextReaderReadState (xmlTextReaderPtr reader);
173XMLPUBFUN int
174 xmlTextReaderIsNamespaceDecl(xmlTextReaderPtr reader);
175
176XMLPUBFUN const xmlChar *
177 xmlTextReaderConstBaseUri (xmlTextReaderPtr reader);
178XMLPUBFUN const xmlChar *
179 xmlTextReaderConstLocalName (xmlTextReaderPtr reader);
180XMLPUBFUN const xmlChar *
181 xmlTextReaderConstName (xmlTextReaderPtr reader);
182XMLPUBFUN const xmlChar *
183 xmlTextReaderConstNamespaceUri(xmlTextReaderPtr reader);
184XMLPUBFUN const xmlChar *
185 xmlTextReaderConstPrefix (xmlTextReaderPtr reader);
186XMLPUBFUN const xmlChar *
187 xmlTextReaderConstXmlLang (xmlTextReaderPtr reader);
188XMLPUBFUN const xmlChar *
189 xmlTextReaderConstString (xmlTextReaderPtr reader,
190 const xmlChar *str);
191XMLPUBFUN const xmlChar *
192 xmlTextReaderConstValue (xmlTextReaderPtr reader);
193
194/*
195 * use the Const version of the routine for
196 * better performance and simpler code
197 */
198XMLPUBFUN xmlChar *
199 xmlTextReaderBaseUri (xmlTextReaderPtr reader);
200XMLPUBFUN xmlChar *
201 xmlTextReaderLocalName (xmlTextReaderPtr reader);
202XMLPUBFUN xmlChar *
203 xmlTextReaderName (xmlTextReaderPtr reader);
204XMLPUBFUN xmlChar *
205 xmlTextReaderNamespaceUri(xmlTextReaderPtr reader);
206XMLPUBFUN xmlChar *
207 xmlTextReaderPrefix (xmlTextReaderPtr reader);
208XMLPUBFUN xmlChar *
209 xmlTextReaderXmlLang (xmlTextReaderPtr reader);
210XMLPUBFUN xmlChar *
211 xmlTextReaderValue (xmlTextReaderPtr reader);
212
213/*
214 * Methods of the XmlTextReader
215 */
216XMLPUBFUN int
217 xmlTextReaderClose (xmlTextReaderPtr reader);
218XMLPUBFUN xmlChar *
219 xmlTextReaderGetAttributeNo (xmlTextReaderPtr reader,
220 int no);
221XMLPUBFUN xmlChar *
222 xmlTextReaderGetAttribute (xmlTextReaderPtr reader,
223 const xmlChar *name);
224XMLPUBFUN xmlChar *
225 xmlTextReaderGetAttributeNs (xmlTextReaderPtr reader,
226 const xmlChar *localName,
227 const xmlChar *namespaceURI);
228XMLPUBFUN xmlParserInputBufferPtr
229 xmlTextReaderGetRemainder (xmlTextReaderPtr reader);
230XMLPUBFUN xmlChar *
231 xmlTextReaderLookupNamespace(xmlTextReaderPtr reader,
232 const xmlChar *prefix);
233XMLPUBFUN int
234 xmlTextReaderMoveToAttributeNo(xmlTextReaderPtr reader,
235 int no);
236XMLPUBFUN int
237 xmlTextReaderMoveToAttribute(xmlTextReaderPtr reader,
238 const xmlChar *name);
239XMLPUBFUN int
240 xmlTextReaderMoveToAttributeNs(xmlTextReaderPtr reader,
241 const xmlChar *localName,
242 const xmlChar *namespaceURI);
243XMLPUBFUN int
244 xmlTextReaderMoveToFirstAttribute(xmlTextReaderPtr reader);
245XMLPUBFUN int
246 xmlTextReaderMoveToNextAttribute(xmlTextReaderPtr reader);
247XMLPUBFUN int
248 xmlTextReaderMoveToElement (xmlTextReaderPtr reader);
249XMLPUBFUN int
250 xmlTextReaderNormalization (xmlTextReaderPtr reader);
251XMLPUBFUN const xmlChar *
252 xmlTextReaderConstEncoding (xmlTextReaderPtr reader);
253
254/*
255 * Extensions
256 */
257XMLPUBFUN int
258 xmlTextReaderSetParserProp (xmlTextReaderPtr reader,
259 int prop,
260 int value);
261XMLPUBFUN int
262 xmlTextReaderGetParserProp (xmlTextReaderPtr reader,
263 int prop);
264XMLPUBFUN xmlNodePtr
265 xmlTextReaderCurrentNode (xmlTextReaderPtr reader);
266
267XMLPUBFUN int
268 xmlTextReaderGetParserLineNumber(xmlTextReaderPtr reader);
269
270XMLPUBFUN int
271 xmlTextReaderGetParserColumnNumber(xmlTextReaderPtr reader);
272
273XMLPUBFUN xmlNodePtr
274 xmlTextReaderPreserve (xmlTextReaderPtr reader);
275#ifdef LIBXML_PATTERN_ENABLED
276XMLPUBFUN int
277 xmlTextReaderPreservePattern(xmlTextReaderPtr reader,
278 const xmlChar *pattern,
279 const xmlChar **namespaces);
280#endif /* LIBXML_PATTERN_ENABLED */
281XMLPUBFUN xmlDocPtr
282 xmlTextReaderCurrentDoc (xmlTextReaderPtr reader);
283XMLPUBFUN xmlNodePtr
284 xmlTextReaderExpand (xmlTextReaderPtr reader);
285XMLPUBFUN int
286 xmlTextReaderNext (xmlTextReaderPtr reader);
287XMLPUBFUN int
288 xmlTextReaderNextSibling (xmlTextReaderPtr reader);
289XMLPUBFUN int
290 xmlTextReaderIsValid (xmlTextReaderPtr reader);
291#ifdef LIBXML_SCHEMAS_ENABLED
292XMLPUBFUN int
293 xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader,
294 const char *rng);
295XMLPUBFUN int
296 xmlTextReaderRelaxNGValidateCtxt(xmlTextReaderPtr reader,
297 xmlRelaxNGValidCtxtPtr ctxt,
298 int options);
299
300XMLPUBFUN int
301 xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader,
302 xmlRelaxNGPtr schema);
303XMLPUBFUN int
304 xmlTextReaderSchemaValidate (xmlTextReaderPtr reader,
305 const char *xsd);
306XMLPUBFUN int
307 xmlTextReaderSchemaValidateCtxt(xmlTextReaderPtr reader,
308 xmlSchemaValidCtxtPtr ctxt,
309 int options);
310XMLPUBFUN int
311 xmlTextReaderSetSchema (xmlTextReaderPtr reader,
312 xmlSchemaPtr schema);
313#endif
314XMLPUBFUN const xmlChar *
315 xmlTextReaderConstXmlVersion(xmlTextReaderPtr reader);
316XMLPUBFUN int
317 xmlTextReaderStandalone (xmlTextReaderPtr reader);
318
319
320/*
321 * Index lookup
322 */
323XMLPUBFUN long
324 xmlTextReaderByteConsumed (xmlTextReaderPtr reader);
325
326/*
327 * New more complete APIs for simpler creation and reuse of readers
328 */
329XMLPUBFUN xmlTextReaderPtr
330 xmlReaderWalker (xmlDocPtr doc);
331XMLPUBFUN xmlTextReaderPtr
332 xmlReaderForDoc (const xmlChar * cur,
333 const char *URL,
334 const char *encoding,
335 int options);
336XMLPUBFUN xmlTextReaderPtr
337 xmlReaderForFile (const char *filename,
338 const char *encoding,
339 int options);
340XMLPUBFUN xmlTextReaderPtr
341 xmlReaderForMemory (const char *buffer,
342 int size,
343 const char *URL,
344 const char *encoding,
345 int options);
346XMLPUBFUN xmlTextReaderPtr
347 xmlReaderForFd (int fd,
348 const char *URL,
349 const char *encoding,
350 int options);
351XMLPUBFUN xmlTextReaderPtr
352 xmlReaderForIO (xmlInputReadCallback ioread,
353 xmlInputCloseCallback ioclose,
354 void *ioctx,
355 const char *URL,
356 const char *encoding,
357 int options);
358
359XMLPUBFUN int
360 xmlReaderNewWalker (xmlTextReaderPtr reader,
361 xmlDocPtr doc);
362XMLPUBFUN int
363 xmlReaderNewDoc (xmlTextReaderPtr reader,
364 const xmlChar * cur,
365 const char *URL,
366 const char *encoding,
367 int options);
368XMLPUBFUN int
369 xmlReaderNewFile (xmlTextReaderPtr reader,
370 const char *filename,
371 const char *encoding,
372 int options);
373XMLPUBFUN int
374 xmlReaderNewMemory (xmlTextReaderPtr reader,
375 const char *buffer,
376 int size,
377 const char *URL,
378 const char *encoding,
379 int options);
380XMLPUBFUN int
381 xmlReaderNewFd (xmlTextReaderPtr reader,
382 int fd,
383 const char *URL,
384 const char *encoding,
385 int options);
386XMLPUBFUN int
387 xmlReaderNewIO (xmlTextReaderPtr reader,
388 xmlInputReadCallback ioread,
389 xmlInputCloseCallback ioclose,
390 void *ioctx,
391 const char *URL,
392 const char *encoding,
393 int options);
394/*
395 * Error handling extensions
396 */
397typedef void * xmlTextReaderLocatorPtr;
398
399/**
400 * xmlTextReaderErrorFunc:
401 * @arg: the user argument
402 * @msg: the message
403 * @severity: the severity of the error
404 * @locator: a locator indicating where the error occurred
405 *
406 * Signature of an error callback from a reader parser
407 */
408typedef void (*xmlTextReaderErrorFunc)(void *arg,
409 const char *msg,
410 xmlParserSeverities severity,
411 xmlTextReaderLocatorPtr locator);
412XMLPUBFUN int
413 xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator);
414XMLPUBFUN xmlChar *
415 xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator);
416XMLPUBFUN void
417 xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader,
418 xmlTextReaderErrorFunc f,
419 void *arg);
420XMLPUBFUN void
421 xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader,
422 xmlStructuredErrorFunc f,
423 void *arg);
424XMLPUBFUN void
425 xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader,
426 xmlTextReaderErrorFunc *f,
427 void **arg);
428
429#endif /* LIBXML_READER_ENABLED */
430
431#ifdef __cplusplus
432}
433#endif
434
435#endif /* __XML_XMLREADER_H__ */
436
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette