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