VirtualBox

source: vbox/trunk/src/libs/libxml2-2.6.30/include/libxml/xmlreader.h@ 20364

最後變更 在這個檔案從20364是 6076,由 vboxsync 提交於 17 年 前

Merged dmik/s2 branch (r25959:26751) to the trunk.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Date Revision Author Id
檔案大小: 12.2 KB
 
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 LIBXML_READER_ENABLED
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/**
28 * xmlTextReaderMode:
29 *
30 * Internal state values for the reader.
31 */
32typedef enum {
33 XML_TEXTREADER_MODE_INITIAL = 0,
34 XML_TEXTREADER_MODE_INTERACTIVE = 1,
35 XML_TEXTREADER_MODE_ERROR = 2,
36 XML_TEXTREADER_MODE_EOF =3,
37 XML_TEXTREADER_MODE_CLOSED = 4,
38 XML_TEXTREADER_MODE_READING = 5
39} xmlTextReaderMode;
40
41/**
42 * xmlParserProperties:
43 *
44 * Some common options to use with xmlTextReaderSetParserProp, but it
45 * is better to use xmlParserOption and the xmlReaderNewxxx and
46 * xmlReaderForxxx APIs now.
47 */
48typedef enum {
49 XML_PARSER_LOADDTD = 1,
50 XML_PARSER_DEFAULTATTRS = 2,
51 XML_PARSER_VALIDATE = 3,
52 XML_PARSER_SUBST_ENTITIES = 4
53} xmlParserProperties;
54
55/**
56 * xmlParserSeverities:
57 *
58 * How severe an error callback is when the per-reader error callback API
59 * is used.
60 */
61typedef enum {
62 XML_PARSER_SEVERITY_VALIDITY_WARNING = 1,
63 XML_PARSER_SEVERITY_VALIDITY_ERROR = 2,
64 XML_PARSER_SEVERITY_WARNING = 3,
65 XML_PARSER_SEVERITY_ERROR = 4
66} xmlParserSeverities;
67
68/**
69 * xmlReaderTypes:
70 *
71 * Predefined constants for the different types of nodes.
72 */
73typedef 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
94/**
95 * xmlTextReader:
96 *
97 * Structure for an xmlReader context.
98 */
99typedef struct _xmlTextReader xmlTextReader;
100
101/**
102 * xmlTextReaderPtr:
103 *
104 * Pointer to an xmlReader context.
105 */
106typedef xmlTextReader *xmlTextReaderPtr;
107
108/*
109 * Constructors & Destructor
110 */
111XMLPUBFUN xmlTextReaderPtr XMLCALL
112 xmlNewTextReader (xmlParserInputBufferPtr input,
113 const char *URI);
114XMLPUBFUN xmlTextReaderPtr XMLCALL
115 xmlNewTextReaderFilename(const char *URI);
116
117XMLPUBFUN void XMLCALL
118 xmlFreeTextReader (xmlTextReaderPtr reader);
119
120XMLPUBFUN int XMLCALL
121 xmlTextReaderSetup(xmlTextReaderPtr reader,
122 xmlParserInputBufferPtr input, const char *URL,
123 const char *encoding, int options);
124
125/*
126 * Iterators
127 */
128XMLPUBFUN int XMLCALL
129 xmlTextReaderRead (xmlTextReaderPtr reader);
130
131#ifdef LIBXML_WRITER_ENABLED
132XMLPUBFUN xmlChar * XMLCALL
133 xmlTextReaderReadInnerXml (xmlTextReaderPtr reader);
134
135XMLPUBFUN xmlChar * XMLCALL
136 xmlTextReaderReadOuterXml (xmlTextReaderPtr reader);
137#endif
138
139XMLPUBFUN xmlChar * XMLCALL
140 xmlTextReaderReadString (xmlTextReaderPtr reader);
141XMLPUBFUN int XMLCALL
142 xmlTextReaderReadAttributeValue (xmlTextReaderPtr reader);
143
144/*
145 * Attributes of the node
146 */
147XMLPUBFUN int XMLCALL
148 xmlTextReaderAttributeCount(xmlTextReaderPtr reader);
149XMLPUBFUN int XMLCALL
150 xmlTextReaderDepth (xmlTextReaderPtr reader);
151XMLPUBFUN int XMLCALL
152 xmlTextReaderHasAttributes(xmlTextReaderPtr reader);
153XMLPUBFUN int XMLCALL
154 xmlTextReaderHasValue(xmlTextReaderPtr reader);
155XMLPUBFUN int XMLCALL
156 xmlTextReaderIsDefault (xmlTextReaderPtr reader);
157XMLPUBFUN int XMLCALL
158 xmlTextReaderIsEmptyElement(xmlTextReaderPtr reader);
159XMLPUBFUN int XMLCALL
160 xmlTextReaderNodeType (xmlTextReaderPtr reader);
161XMLPUBFUN int XMLCALL
162 xmlTextReaderQuoteChar (xmlTextReaderPtr reader);
163XMLPUBFUN int XMLCALL
164 xmlTextReaderReadState (xmlTextReaderPtr reader);
165XMLPUBFUN int XMLCALL
166 xmlTextReaderIsNamespaceDecl(xmlTextReaderPtr reader);
167
168XMLPUBFUN const xmlChar * XMLCALL
169 xmlTextReaderConstBaseUri (xmlTextReaderPtr reader);
170XMLPUBFUN const xmlChar * XMLCALL
171 xmlTextReaderConstLocalName (xmlTextReaderPtr reader);
172XMLPUBFUN const xmlChar * XMLCALL
173 xmlTextReaderConstName (xmlTextReaderPtr reader);
174XMLPUBFUN const xmlChar * XMLCALL
175 xmlTextReaderConstNamespaceUri(xmlTextReaderPtr reader);
176XMLPUBFUN const xmlChar * XMLCALL
177 xmlTextReaderConstPrefix (xmlTextReaderPtr reader);
178XMLPUBFUN const xmlChar * XMLCALL
179 xmlTextReaderConstXmlLang (xmlTextReaderPtr reader);
180XMLPUBFUN const xmlChar * XMLCALL
181 xmlTextReaderConstString (xmlTextReaderPtr reader,
182 const xmlChar *str);
183XMLPUBFUN 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 */
190XMLPUBFUN xmlChar * XMLCALL
191 xmlTextReaderBaseUri (xmlTextReaderPtr reader);
192XMLPUBFUN xmlChar * XMLCALL
193 xmlTextReaderLocalName (xmlTextReaderPtr reader);
194XMLPUBFUN xmlChar * XMLCALL
195 xmlTextReaderName (xmlTextReaderPtr reader);
196XMLPUBFUN xmlChar * XMLCALL
197 xmlTextReaderNamespaceUri(xmlTextReaderPtr reader);
198XMLPUBFUN xmlChar * XMLCALL
199 xmlTextReaderPrefix (xmlTextReaderPtr reader);
200XMLPUBFUN xmlChar * XMLCALL
201 xmlTextReaderXmlLang (xmlTextReaderPtr reader);
202XMLPUBFUN xmlChar * XMLCALL
203 xmlTextReaderValue (xmlTextReaderPtr reader);
204
205/*
206 * Methods of the XmlTextReader
207 */
208XMLPUBFUN int XMLCALL
209 xmlTextReaderClose (xmlTextReaderPtr reader);
210XMLPUBFUN xmlChar * XMLCALL
211 xmlTextReaderGetAttributeNo (xmlTextReaderPtr reader,
212 int no);
213XMLPUBFUN xmlChar * XMLCALL
214 xmlTextReaderGetAttribute (xmlTextReaderPtr reader,
215 const xmlChar *name);
216XMLPUBFUN xmlChar * XMLCALL
217 xmlTextReaderGetAttributeNs (xmlTextReaderPtr reader,
218 const xmlChar *localName,
219 const xmlChar *namespaceURI);
220XMLPUBFUN xmlParserInputBufferPtr XMLCALL
221 xmlTextReaderGetRemainder (xmlTextReaderPtr reader);
222XMLPUBFUN xmlChar * XMLCALL
223 xmlTextReaderLookupNamespace(xmlTextReaderPtr reader,
224 const xmlChar *prefix);
225XMLPUBFUN int XMLCALL
226 xmlTextReaderMoveToAttributeNo(xmlTextReaderPtr reader,
227 int no);
228XMLPUBFUN int XMLCALL
229 xmlTextReaderMoveToAttribute(xmlTextReaderPtr reader,
230 const xmlChar *name);
231XMLPUBFUN int XMLCALL
232 xmlTextReaderMoveToAttributeNs(xmlTextReaderPtr reader,
233 const xmlChar *localName,
234 const xmlChar *namespaceURI);
235XMLPUBFUN int XMLCALL
236 xmlTextReaderMoveToFirstAttribute(xmlTextReaderPtr reader);
237XMLPUBFUN int XMLCALL
238 xmlTextReaderMoveToNextAttribute(xmlTextReaderPtr reader);
239XMLPUBFUN int XMLCALL
240 xmlTextReaderMoveToElement (xmlTextReaderPtr reader);
241XMLPUBFUN int XMLCALL
242 xmlTextReaderNormalization (xmlTextReaderPtr reader);
243XMLPUBFUN const xmlChar * XMLCALL
244 xmlTextReaderConstEncoding (xmlTextReaderPtr reader);
245
246/*
247 * Extensions
248 */
249XMLPUBFUN int XMLCALL
250 xmlTextReaderSetParserProp (xmlTextReaderPtr reader,
251 int prop,
252 int value);
253XMLPUBFUN int XMLCALL
254 xmlTextReaderGetParserProp (xmlTextReaderPtr reader,
255 int prop);
256XMLPUBFUN xmlNodePtr XMLCALL
257 xmlTextReaderCurrentNode (xmlTextReaderPtr reader);
258
259XMLPUBFUN int XMLCALL
260 xmlTextReaderGetParserLineNumber(xmlTextReaderPtr reader);
261
262XMLPUBFUN int XMLCALL
263 xmlTextReaderGetParserColumnNumber(xmlTextReaderPtr reader);
264
265XMLPUBFUN xmlNodePtr XMLCALL
266 xmlTextReaderPreserve (xmlTextReaderPtr reader);
267#ifdef LIBXML_PATTERN_ENABLED
268XMLPUBFUN int XMLCALL
269 xmlTextReaderPreservePattern(xmlTextReaderPtr reader,
270 const xmlChar *pattern,
271 const xmlChar **namespaces);
272#endif /* LIBXML_PATTERN_ENABLED */
273XMLPUBFUN xmlDocPtr XMLCALL
274 xmlTextReaderCurrentDoc (xmlTextReaderPtr reader);
275XMLPUBFUN xmlNodePtr XMLCALL
276 xmlTextReaderExpand (xmlTextReaderPtr reader);
277XMLPUBFUN int XMLCALL
278 xmlTextReaderNext (xmlTextReaderPtr reader);
279XMLPUBFUN int XMLCALL
280 xmlTextReaderNextSibling (xmlTextReaderPtr reader);
281XMLPUBFUN int XMLCALL
282 xmlTextReaderIsValid (xmlTextReaderPtr reader);
283#ifdef LIBXML_SCHEMAS_ENABLED
284XMLPUBFUN int XMLCALL
285 xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader,
286 const char *rng);
287XMLPUBFUN int XMLCALL
288 xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader,
289 xmlRelaxNGPtr schema);
290XMLPUBFUN int XMLCALL
291 xmlTextReaderSchemaValidate (xmlTextReaderPtr reader,
292 const char *xsd);
293XMLPUBFUN int XMLCALL
294 xmlTextReaderSchemaValidateCtxt(xmlTextReaderPtr reader,
295 xmlSchemaValidCtxtPtr ctxt,
296 int options);
297XMLPUBFUN int XMLCALL
298 xmlTextReaderSetSchema (xmlTextReaderPtr reader,
299 xmlSchemaPtr schema);
300#endif
301XMLPUBFUN const xmlChar * XMLCALL
302 xmlTextReaderConstXmlVersion(xmlTextReaderPtr reader);
303XMLPUBFUN int XMLCALL
304 xmlTextReaderStandalone (xmlTextReaderPtr reader);
305
306
307/*
308 * Index lookup
309 */
310XMLPUBFUN long XMLCALL
311 xmlTextReaderByteConsumed (xmlTextReaderPtr reader);
312
313/*
314 * New more complete APIs for simpler creation and reuse of readers
315 */
316XMLPUBFUN xmlTextReaderPtr XMLCALL
317 xmlReaderWalker (xmlDocPtr doc);
318XMLPUBFUN xmlTextReaderPtr XMLCALL
319 xmlReaderForDoc (const xmlChar * cur,
320 const char *URL,
321 const char *encoding,
322 int options);
323XMLPUBFUN xmlTextReaderPtr XMLCALL
324 xmlReaderForFile (const char *filename,
325 const char *encoding,
326 int options);
327XMLPUBFUN xmlTextReaderPtr XMLCALL
328 xmlReaderForMemory (const char *buffer,
329 int size,
330 const char *URL,
331 const char *encoding,
332 int options);
333XMLPUBFUN xmlTextReaderPtr XMLCALL
334 xmlReaderForFd (int fd,
335 const char *URL,
336 const char *encoding,
337 int options);
338XMLPUBFUN xmlTextReaderPtr XMLCALL
339 xmlReaderForIO (xmlInputReadCallback ioread,
340 xmlInputCloseCallback ioclose,
341 void *ioctx,
342 const char *URL,
343 const char *encoding,
344 int options);
345
346XMLPUBFUN int XMLCALL
347 xmlReaderNewWalker (xmlTextReaderPtr reader,
348 xmlDocPtr doc);
349XMLPUBFUN int XMLCALL
350 xmlReaderNewDoc (xmlTextReaderPtr reader,
351 const xmlChar * cur,
352 const char *URL,
353 const char *encoding,
354 int options);
355XMLPUBFUN int XMLCALL
356 xmlReaderNewFile (xmlTextReaderPtr reader,
357 const char *filename,
358 const char *encoding,
359 int options);
360XMLPUBFUN int XMLCALL
361 xmlReaderNewMemory (xmlTextReaderPtr reader,
362 const char *buffer,
363 int size,
364 const char *URL,
365 const char *encoding,
366 int options);
367XMLPUBFUN int XMLCALL
368 xmlReaderNewFd (xmlTextReaderPtr reader,
369 int fd,
370 const char *URL,
371 const char *encoding,
372 int options);
373XMLPUBFUN int XMLCALL
374 xmlReaderNewIO (xmlTextReaderPtr reader,
375 xmlInputReadCallback ioread,
376 xmlInputCloseCallback ioclose,
377 void *ioctx,
378 const char *URL,
379 const char *encoding,
380 int options);
381/*
382 * Error handling extensions
383 */
384typedef void * xmlTextReaderLocatorPtr;
385typedef void (XMLCALL *xmlTextReaderErrorFunc) (void *arg,
386 const char *msg,
387 xmlParserSeverities severity,
388 xmlTextReaderLocatorPtr locator);
389XMLPUBFUN int XMLCALL
390 xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator);
391/*int xmlTextReaderLocatorLinePosition(xmlTextReaderLocatorPtr locator);*/
392XMLPUBFUN xmlChar * XMLCALL
393 xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator);
394XMLPUBFUN void XMLCALL
395 xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader,
396 xmlTextReaderErrorFunc f,
397 void *arg);
398XMLPUBFUN void XMLCALL
399 xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader,
400 xmlStructuredErrorFunc f,
401 void *arg);
402XMLPUBFUN void XMLCALL
403 xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader,
404 xmlTextReaderErrorFunc *f,
405 void **arg);
406
407#ifdef __cplusplus
408}
409#endif
410
411#endif /* LIBXML_READER_ENABLED */
412
413#endif /* __XML_XMLREADER_H__ */
414
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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