lxml 6.0.0__cp39-cp39-musllinux_1_2_armv7l.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. lxml/ElementInclude.py +244 -0
  2. lxml/__init__.py +22 -0
  3. lxml/_elementpath.cpython-39-arm-linux-gnueabihf.so +0 -0
  4. lxml/_elementpath.py +343 -0
  5. lxml/apihelpers.pxi +1801 -0
  6. lxml/builder.cpython-39-arm-linux-gnueabihf.so +0 -0
  7. lxml/builder.py +243 -0
  8. lxml/classlookup.pxi +580 -0
  9. lxml/cleanup.pxi +215 -0
  10. lxml/cssselect.py +101 -0
  11. lxml/debug.pxi +36 -0
  12. lxml/docloader.pxi +178 -0
  13. lxml/doctestcompare.py +488 -0
  14. lxml/dtd.pxi +479 -0
  15. lxml/etree.cpython-39-arm-linux-gnueabihf.so +0 -0
  16. lxml/etree.h +244 -0
  17. lxml/etree.pyx +3853 -0
  18. lxml/etree_api.h +204 -0
  19. lxml/extensions.pxi +830 -0
  20. lxml/html/ElementSoup.py +10 -0
  21. lxml/html/__init__.py +1927 -0
  22. lxml/html/_diffcommand.py +86 -0
  23. lxml/html/_difflib.cpython-39-arm-linux-gnueabihf.so +0 -0
  24. lxml/html/_difflib.py +2106 -0
  25. lxml/html/_html5builder.py +100 -0
  26. lxml/html/_setmixin.py +56 -0
  27. lxml/html/builder.py +173 -0
  28. lxml/html/clean.py +21 -0
  29. lxml/html/defs.py +135 -0
  30. lxml/html/diff.cpython-39-arm-linux-gnueabihf.so +0 -0
  31. lxml/html/diff.py +972 -0
  32. lxml/html/formfill.py +299 -0
  33. lxml/html/html5parser.py +260 -0
  34. lxml/html/soupparser.py +314 -0
  35. lxml/html/usedoctest.py +13 -0
  36. lxml/includes/__init__.pxd +0 -0
  37. lxml/includes/__init__.py +0 -0
  38. lxml/includes/c14n.pxd +25 -0
  39. lxml/includes/config.pxd +3 -0
  40. lxml/includes/dtdvalid.pxd +18 -0
  41. lxml/includes/etree_defs.h +379 -0
  42. lxml/includes/etreepublic.pxd +237 -0
  43. lxml/includes/extlibs/__init__.py +0 -0
  44. lxml/includes/extlibs/libcharset.h +45 -0
  45. lxml/includes/extlibs/localcharset.h +137 -0
  46. lxml/includes/extlibs/zconf.h +543 -0
  47. lxml/includes/extlibs/zlib.h +1938 -0
  48. lxml/includes/htmlparser.pxd +56 -0
  49. lxml/includes/libexslt/__init__.py +0 -0
  50. lxml/includes/libexslt/exslt.h +108 -0
  51. lxml/includes/libexslt/exsltconfig.h +70 -0
  52. lxml/includes/libexslt/exsltexports.h +63 -0
  53. lxml/includes/libxml/HTMLparser.h +339 -0
  54. lxml/includes/libxml/HTMLtree.h +148 -0
  55. lxml/includes/libxml/SAX.h +18 -0
  56. lxml/includes/libxml/SAX2.h +170 -0
  57. lxml/includes/libxml/__init__.py +0 -0
  58. lxml/includes/libxml/c14n.h +115 -0
  59. lxml/includes/libxml/catalog.h +183 -0
  60. lxml/includes/libxml/chvalid.h +230 -0
  61. lxml/includes/libxml/debugXML.h +79 -0
  62. lxml/includes/libxml/dict.h +82 -0
  63. lxml/includes/libxml/encoding.h +307 -0
  64. lxml/includes/libxml/entities.h +147 -0
  65. lxml/includes/libxml/globals.h +25 -0
  66. lxml/includes/libxml/hash.h +251 -0
  67. lxml/includes/libxml/list.h +137 -0
  68. lxml/includes/libxml/nanoftp.h +16 -0
  69. lxml/includes/libxml/nanohttp.h +98 -0
  70. lxml/includes/libxml/parser.h +1633 -0
  71. lxml/includes/libxml/parserInternals.h +591 -0
  72. lxml/includes/libxml/relaxng.h +224 -0
  73. lxml/includes/libxml/schemasInternals.h +959 -0
  74. lxml/includes/libxml/schematron.h +143 -0
  75. lxml/includes/libxml/threads.h +81 -0
  76. lxml/includes/libxml/tree.h +1326 -0
  77. lxml/includes/libxml/uri.h +106 -0
  78. lxml/includes/libxml/valid.h +485 -0
  79. lxml/includes/libxml/xinclude.h +141 -0
  80. lxml/includes/libxml/xlink.h +193 -0
  81. lxml/includes/libxml/xmlIO.h +419 -0
  82. lxml/includes/libxml/xmlautomata.h +163 -0
  83. lxml/includes/libxml/xmlerror.h +962 -0
  84. lxml/includes/libxml/xmlexports.h +96 -0
  85. lxml/includes/libxml/xmlmemory.h +188 -0
  86. lxml/includes/libxml/xmlmodule.h +61 -0
  87. lxml/includes/libxml/xmlreader.h +444 -0
  88. lxml/includes/libxml/xmlregexp.h +116 -0
  89. lxml/includes/libxml/xmlsave.h +111 -0
  90. lxml/includes/libxml/xmlschemas.h +254 -0
  91. lxml/includes/libxml/xmlschemastypes.h +152 -0
  92. lxml/includes/libxml/xmlstring.h +140 -0
  93. lxml/includes/libxml/xmlunicode.h +15 -0
  94. lxml/includes/libxml/xmlversion.h +332 -0
  95. lxml/includes/libxml/xmlwriter.h +489 -0
  96. lxml/includes/libxml/xpath.h +569 -0
  97. lxml/includes/libxml/xpathInternals.h +639 -0
  98. lxml/includes/libxml/xpointer.h +48 -0
  99. lxml/includes/libxslt/__init__.py +0 -0
  100. lxml/includes/libxslt/attributes.h +39 -0
  101. lxml/includes/libxslt/documents.h +93 -0
  102. lxml/includes/libxslt/extensions.h +262 -0
  103. lxml/includes/libxslt/extra.h +72 -0
  104. lxml/includes/libxslt/functions.h +78 -0
  105. lxml/includes/libxslt/imports.h +75 -0
  106. lxml/includes/libxslt/keys.h +53 -0
  107. lxml/includes/libxslt/namespaces.h +68 -0
  108. lxml/includes/libxslt/numbersInternals.h +73 -0
  109. lxml/includes/libxslt/pattern.h +84 -0
  110. lxml/includes/libxslt/preproc.h +43 -0
  111. lxml/includes/libxslt/security.h +104 -0
  112. lxml/includes/libxslt/templates.h +77 -0
  113. lxml/includes/libxslt/transform.h +207 -0
  114. lxml/includes/libxslt/variables.h +118 -0
  115. lxml/includes/libxslt/xslt.h +110 -0
  116. lxml/includes/libxslt/xsltInternals.h +1995 -0
  117. lxml/includes/libxslt/xsltconfig.h +146 -0
  118. lxml/includes/libxslt/xsltexports.h +64 -0
  119. lxml/includes/libxslt/xsltlocale.h +44 -0
  120. lxml/includes/libxslt/xsltutils.h +343 -0
  121. lxml/includes/lxml-version.h +3 -0
  122. lxml/includes/relaxng.pxd +64 -0
  123. lxml/includes/schematron.pxd +34 -0
  124. lxml/includes/tree.pxd +492 -0
  125. lxml/includes/uri.pxd +5 -0
  126. lxml/includes/xinclude.pxd +22 -0
  127. lxml/includes/xmlerror.pxd +852 -0
  128. lxml/includes/xmlparser.pxd +303 -0
  129. lxml/includes/xmlschema.pxd +35 -0
  130. lxml/includes/xpath.pxd +136 -0
  131. lxml/includes/xslt.pxd +190 -0
  132. lxml/isoschematron/__init__.py +348 -0
  133. lxml/isoschematron/resources/rng/iso-schematron.rng +709 -0
  134. lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl +75 -0
  135. lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl +77 -0
  136. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl +313 -0
  137. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl +1160 -0
  138. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl +55 -0
  139. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl +1796 -0
  140. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl +588 -0
  141. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt +84 -0
  142. lxml/iterparse.pxi +438 -0
  143. lxml/lxml.etree.h +244 -0
  144. lxml/lxml.etree_api.h +204 -0
  145. lxml/nsclasses.pxi +281 -0
  146. lxml/objectify.cpython-39-arm-linux-gnueabihf.so +0 -0
  147. lxml/objectify.pyx +2149 -0
  148. lxml/objectpath.pxi +332 -0
  149. lxml/parser.pxi +2059 -0
  150. lxml/parsertarget.pxi +180 -0
  151. lxml/proxy.pxi +619 -0
  152. lxml/public-api.pxi +178 -0
  153. lxml/pyclasslookup.py +3 -0
  154. lxml/readonlytree.pxi +565 -0
  155. lxml/relaxng.pxi +165 -0
  156. lxml/sax.cpython-39-arm-linux-gnueabihf.so +0 -0
  157. lxml/sax.py +286 -0
  158. lxml/saxparser.pxi +875 -0
  159. lxml/schematron.pxi +173 -0
  160. lxml/serializer.pxi +1849 -0
  161. lxml/usedoctest.py +13 -0
  162. lxml/xinclude.pxi +67 -0
  163. lxml/xmlerror.pxi +1654 -0
  164. lxml/xmlid.pxi +179 -0
  165. lxml/xmlschema.pxi +215 -0
  166. lxml/xpath.pxi +487 -0
  167. lxml/xslt.pxi +957 -0
  168. lxml/xsltext.pxi +242 -0
  169. lxml-6.0.0.dist-info/METADATA +163 -0
  170. lxml-6.0.0.dist-info/RECORD +174 -0
  171. lxml-6.0.0.dist-info/WHEEL +5 -0
  172. lxml-6.0.0.dist-info/licenses/LICENSE.txt +31 -0
  173. lxml-6.0.0.dist-info/licenses/LICENSES.txt +29 -0
  174. lxml-6.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1633 @@
1
+ /*
2
+ * Summary: the core parser module
3
+ * Description: Interfaces, constants and types related to the XML parser
4
+ *
5
+ * Copy: See Copyright for the status of this software.
6
+ *
7
+ * Author: Daniel Veillard
8
+ */
9
+
10
+ #ifndef __XML_PARSER_H__
11
+ #define __XML_PARSER_H__
12
+
13
+ /** DOC_DISABLE */
14
+ #include <libxml/xmlversion.h>
15
+ #define XML_TREE_INTERNALS
16
+ #include <libxml/tree.h>
17
+ #undef XML_TREE_INTERNALS
18
+ #include <libxml/dict.h>
19
+ #include <libxml/hash.h>
20
+ #include <libxml/valid.h>
21
+ #include <libxml/entities.h>
22
+ #include <libxml/xmlerror.h>
23
+ #include <libxml/xmlstring.h>
24
+ #include <libxml/xmlmemory.h>
25
+ #include <libxml/encoding.h>
26
+ #include <libxml/xmlIO.h>
27
+ /* for compatibility */
28
+ #include <libxml/SAX2.h>
29
+ #include <libxml/threads.h>
30
+ /** DOC_ENABLE */
31
+
32
+ #ifdef __cplusplus
33
+ extern "C" {
34
+ #endif
35
+
36
+ /**
37
+ * XML_DEFAULT_VERSION:
38
+ *
39
+ * The default version of XML used: 1.0
40
+ */
41
+ #define XML_DEFAULT_VERSION "1.0"
42
+
43
+ typedef enum {
44
+ XML_STATUS_NOT_WELL_FORMED = (1 << 0),
45
+ XML_STATUS_NOT_NS_WELL_FORMED = (1 << 1),
46
+ XML_STATUS_DTD_VALIDATION_FAILED = (1 << 2),
47
+ XML_STATUS_CATASTROPHIC_ERROR = (1 << 3)
48
+ } xmlParserStatus;
49
+
50
+ typedef enum {
51
+ XML_RESOURCE_UNKNOWN = 0,
52
+ XML_RESOURCE_MAIN_DOCUMENT,
53
+ XML_RESOURCE_DTD,
54
+ XML_RESOURCE_GENERAL_ENTITY,
55
+ XML_RESOURCE_PARAMETER_ENTITY,
56
+ XML_RESOURCE_XINCLUDE,
57
+ XML_RESOURCE_XINCLUDE_TEXT
58
+ } xmlResourceType;
59
+
60
+ typedef enum {
61
+ XML_INPUT_BUF_STATIC = (1 << 1),
62
+ XML_INPUT_BUF_ZERO_TERMINATED = (1 << 2),
63
+ XML_INPUT_UNZIP = (1 << 3),
64
+ XML_INPUT_NETWORK = (1 << 4)
65
+ } xmlParserInputFlags;
66
+
67
+ /**
68
+ * xmlParserInput:
69
+ *
70
+ * An xmlParserInput is an input flow for the XML processor.
71
+ * Each entity parsed is associated an xmlParserInput (except the
72
+ * few predefined ones). This is the case both for internal entities
73
+ * - in which case the flow is already completely in memory - or
74
+ * external entities - in which case we use the buf structure for
75
+ * progressive reading and I18N conversions to the internal UTF-8 format.
76
+ */
77
+
78
+ /**
79
+ * xmlParserInputDeallocate:
80
+ * @str: the string to deallocate
81
+ *
82
+ * Callback for freeing some parser input allocations.
83
+ */
84
+ typedef void (* xmlParserInputDeallocate)(xmlChar *str);
85
+
86
+ struct _xmlParserInput {
87
+ /* Input buffer */
88
+ xmlParserInputBufferPtr buf;
89
+ /* The file analyzed, if any */
90
+ const char *filename;
91
+ /* unused */
92
+ const char *directory XML_DEPRECATED_MEMBER;
93
+ /* Base of the array to parse */
94
+ const xmlChar *base;
95
+ /* Current char being parsed */
96
+ const xmlChar *cur;
97
+ /* end of the array to parse */
98
+ const xmlChar *end;
99
+ /* unused */
100
+ int length XML_DEPRECATED_MEMBER;
101
+ /* Current line */
102
+ int line;
103
+ /* Current column */
104
+ int col;
105
+ /* How many xmlChars already consumed */
106
+ unsigned long consumed;
107
+ /* function to deallocate the base */
108
+ xmlParserInputDeallocate free XML_DEPRECATED_MEMBER;
109
+ /* unused */
110
+ const xmlChar *encoding XML_DEPRECATED_MEMBER;
111
+ /* the version string for entity */
112
+ const xmlChar *version XML_DEPRECATED_MEMBER;
113
+ /* Flags */
114
+ int flags XML_DEPRECATED_MEMBER;
115
+ /* an unique identifier for the entity */
116
+ int id XML_DEPRECATED_MEMBER;
117
+ /* unused */
118
+ unsigned long parentConsumed XML_DEPRECATED_MEMBER;
119
+ /* entity, if any */
120
+ xmlEntityPtr entity XML_DEPRECATED_MEMBER;
121
+ };
122
+
123
+ /**
124
+ * xmlParserNodeInfo:
125
+ *
126
+ * The parser can be asked to collect Node information, i.e. at what
127
+ * place in the file they were detected.
128
+ * NOTE: This is off by default and not very well tested.
129
+ */
130
+ typedef struct _xmlParserNodeInfo xmlParserNodeInfo;
131
+ typedef xmlParserNodeInfo *xmlParserNodeInfoPtr;
132
+
133
+ struct _xmlParserNodeInfo {
134
+ const struct _xmlNode* node;
135
+ /* Position & line # that text that created the node begins & ends on */
136
+ unsigned long begin_pos;
137
+ unsigned long begin_line;
138
+ unsigned long end_pos;
139
+ unsigned long end_line;
140
+ };
141
+
142
+ typedef struct _xmlParserNodeInfoSeq xmlParserNodeInfoSeq;
143
+ typedef xmlParserNodeInfoSeq *xmlParserNodeInfoSeqPtr;
144
+ struct _xmlParserNodeInfoSeq {
145
+ unsigned long maximum;
146
+ unsigned long length;
147
+ xmlParserNodeInfo* buffer;
148
+ };
149
+
150
+ /**
151
+ * xmlParserInputState:
152
+ *
153
+ * The parser is now working also as a state based parser.
154
+ * The recursive one use the state info for entities processing.
155
+ */
156
+ typedef enum {
157
+ XML_PARSER_EOF = -1, /* nothing is to be parsed */
158
+ XML_PARSER_START = 0, /* nothing has been parsed */
159
+ XML_PARSER_MISC, /* Misc* before int subset */
160
+ XML_PARSER_PI, /* Within a processing instruction */
161
+ XML_PARSER_DTD, /* within some DTD content */
162
+ XML_PARSER_PROLOG, /* Misc* after internal subset */
163
+ XML_PARSER_COMMENT, /* within a comment */
164
+ XML_PARSER_START_TAG, /* within a start tag */
165
+ XML_PARSER_CONTENT, /* within the content */
166
+ XML_PARSER_CDATA_SECTION, /* within a CDATA section */
167
+ XML_PARSER_END_TAG, /* within a closing tag */
168
+ XML_PARSER_ENTITY_DECL, /* within an entity declaration */
169
+ XML_PARSER_ENTITY_VALUE, /* within an entity value in a decl */
170
+ XML_PARSER_ATTRIBUTE_VALUE, /* within an attribute value */
171
+ XML_PARSER_SYSTEM_LITERAL, /* within a SYSTEM value */
172
+ XML_PARSER_EPILOG, /* the Misc* after the last end tag */
173
+ XML_PARSER_IGNORE, /* within an IGNORED section */
174
+ XML_PARSER_PUBLIC_LITERAL, /* within a PUBLIC value */
175
+ XML_PARSER_XML_DECL /* before XML decl (but after BOM) */
176
+ } xmlParserInputState;
177
+
178
+ /** DOC_DISABLE */
179
+ /*
180
+ * Internal bits in the 'loadsubset' context member
181
+ */
182
+ #define XML_DETECT_IDS 2
183
+ #define XML_COMPLETE_ATTRS 4
184
+ #define XML_SKIP_IDS 8
185
+ /** DOC_ENABLE */
186
+
187
+ /**
188
+ * xmlParserMode:
189
+ *
190
+ * A parser can operate in various modes
191
+ */
192
+ typedef enum {
193
+ XML_PARSE_UNKNOWN = 0,
194
+ XML_PARSE_DOM = 1,
195
+ XML_PARSE_SAX = 2,
196
+ XML_PARSE_PUSH_DOM = 3,
197
+ XML_PARSE_PUSH_SAX = 4,
198
+ XML_PARSE_READER = 5
199
+ } xmlParserMode;
200
+
201
+ typedef struct _xmlStartTag xmlStartTag;
202
+ typedef struct _xmlParserNsData xmlParserNsData;
203
+ typedef struct _xmlAttrHashBucket xmlAttrHashBucket;
204
+
205
+ /**
206
+ * xmlResourceLoader:
207
+ * @ctxt: parser context
208
+ * @url: URL to load
209
+ * @publicId: publid ID from DTD (optional)
210
+ * @type: resource type
211
+ * @flags: flags
212
+ * @out: result pointer
213
+ *
214
+ * Callback for custom resource loaders.
215
+ *
216
+ * @flags can contain XML_INPUT_UNZIP and XML_INPUT_NETWORK.
217
+ *
218
+ * On success, @out should be set to a new parser input object and
219
+ * XML_ERR_OK should be returned.
220
+ *
221
+ * Returns an xmlParserErrors code.
222
+ */
223
+ typedef xmlParserErrors
224
+ (*xmlResourceLoader)(void *ctxt, const char *url, const char *publicId,
225
+ xmlResourceType type, xmlParserInputFlags flags,
226
+ xmlParserInputPtr *out);
227
+
228
+ /**
229
+ * xmlParserCtxt:
230
+ *
231
+ * The parser context.
232
+ * NOTE This doesn't completely define the parser state, the (current ?)
233
+ * design of the parser uses recursive function calls since this allow
234
+ * and easy mapping from the production rules of the specification
235
+ * to the actual code. The drawback is that the actual function call
236
+ * also reflect the parser state. However most of the parsing routines
237
+ * takes as the only argument the parser context pointer, so migrating
238
+ * to a state based parser for progressive parsing shouldn't be too hard.
239
+ */
240
+ struct _xmlParserCtxt {
241
+ /* The SAX handler */
242
+ struct _xmlSAXHandler *sax;
243
+ /* For SAX interface only, used by DOM build */
244
+ void *userData;
245
+ /* the document being built */
246
+ xmlDocPtr myDoc;
247
+ /* is the document well formed */
248
+ int wellFormed;
249
+ /* shall we replace entities ? */
250
+ int replaceEntities XML_DEPRECATED_MEMBER;
251
+ /* the XML version string */
252
+ const xmlChar *version;
253
+ /* the declared encoding, if any */
254
+ const xmlChar *encoding;
255
+ /* standalone document */
256
+ int standalone;
257
+
258
+ /* an HTML(1) document
259
+ * 3 is HTML after <head>
260
+ * 10 is HTML after <body>
261
+ */
262
+ int html;
263
+
264
+ /* Input stream stack */
265
+
266
+ /* Current input stream */
267
+ xmlParserInputPtr input;
268
+ /* Number of current input streams */
269
+ int inputNr;
270
+ /* Max number of input streams */
271
+ int inputMax XML_DEPRECATED_MEMBER;
272
+ /* stack of inputs */
273
+ xmlParserInputPtr *inputTab;
274
+
275
+ /* Node analysis stack only used for DOM building */
276
+
277
+ /* Current parsed Node */
278
+ xmlNodePtr node;
279
+ /* Depth of the parsing stack */
280
+ int nodeNr XML_DEPRECATED_MEMBER;
281
+ /* Max depth of the parsing stack */
282
+ int nodeMax XML_DEPRECATED_MEMBER;
283
+ /* array of nodes */
284
+ xmlNodePtr *nodeTab XML_DEPRECATED_MEMBER;
285
+
286
+ /* Whether node info should be kept */
287
+ int record_info;
288
+ /* info about each node parsed */
289
+ xmlParserNodeInfoSeq node_seq XML_DEPRECATED_MEMBER;
290
+
291
+ /* error code */
292
+ int errNo;
293
+
294
+ /* reference and external subset */
295
+ int hasExternalSubset XML_DEPRECATED_MEMBER;
296
+ /* the internal subset has PE refs */
297
+ int hasPErefs XML_DEPRECATED_MEMBER;
298
+ /* unused */
299
+ int external XML_DEPRECATED_MEMBER;
300
+
301
+ /* is the document valid */
302
+ int valid;
303
+ /* shall we try to validate ? */
304
+ int validate XML_DEPRECATED_MEMBER;
305
+ /* The validity context */
306
+ xmlValidCtxt vctxt;
307
+
308
+ /* push parser state */
309
+ xmlParserInputState instate XML_DEPRECATED_MEMBER;
310
+ /* unused */
311
+ int token XML_DEPRECATED_MEMBER;
312
+
313
+ /* unused internally, still used downstream */
314
+ char *directory;
315
+
316
+ /* Node name stack */
317
+
318
+ /* Current parsed Node */
319
+ const xmlChar *name XML_DEPRECATED_MEMBER;
320
+ /* Depth of the parsing stack */
321
+ int nameNr XML_DEPRECATED_MEMBER;
322
+ /* Max depth of the parsing stack */
323
+ int nameMax XML_DEPRECATED_MEMBER;
324
+ /* array of nodes */
325
+ const xmlChar **nameTab XML_DEPRECATED_MEMBER;
326
+
327
+ /* unused */
328
+ long nbChars XML_DEPRECATED_MEMBER;
329
+ /* used by progressive parsing lookup */
330
+ long checkIndex XML_DEPRECATED_MEMBER;
331
+ /* ugly but ... */
332
+ int keepBlanks XML_DEPRECATED_MEMBER;
333
+ /* SAX callbacks are disabled */
334
+ int disableSAX;
335
+ /* Parsing is in int 1/ext 2 subset */
336
+ int inSubset;
337
+ /* name of subset */
338
+ const xmlChar *intSubName;
339
+ /* URI of external subset */
340
+ xmlChar *extSubURI;
341
+ /* SYSTEM ID of external subset */
342
+ xmlChar *extSubSystem;
343
+
344
+ /* xml:space values */
345
+
346
+ /* Should the parser preserve spaces */
347
+ int *space XML_DEPRECATED_MEMBER;
348
+ /* Depth of the parsing stack */
349
+ int spaceNr XML_DEPRECATED_MEMBER;
350
+ /* Max depth of the parsing stack */
351
+ int spaceMax XML_DEPRECATED_MEMBER;
352
+ /* array of space infos */
353
+ int *spaceTab XML_DEPRECATED_MEMBER;
354
+
355
+ /* to prevent entity substitution loops */
356
+ int depth XML_DEPRECATED_MEMBER;
357
+ /* unused */
358
+ xmlParserInputPtr entity XML_DEPRECATED_MEMBER;
359
+ /* unused */
360
+ int charset XML_DEPRECATED_MEMBER;
361
+ /* Those two fields are there to */
362
+ int nodelen XML_DEPRECATED_MEMBER;
363
+ /* Speed up large node parsing */
364
+ int nodemem XML_DEPRECATED_MEMBER;
365
+ /* signal pedantic warnings */
366
+ int pedantic XML_DEPRECATED_MEMBER;
367
+ /* For user data, libxml won't touch it */
368
+ void *_private;
369
+
370
+ /* should the external subset be loaded */
371
+ int loadsubset;
372
+ /* set line number in element content */
373
+ int linenumbers XML_DEPRECATED_MEMBER;
374
+ /* document's own catalog */
375
+ void *catalogs XML_DEPRECATED_MEMBER;
376
+ /* run in recovery mode */
377
+ int recovery XML_DEPRECATED_MEMBER;
378
+ /* unused */
379
+ int progressive XML_DEPRECATED_MEMBER;
380
+ /* dictionary for the parser */
381
+ xmlDictPtr dict;
382
+ /* array for the attributes callbacks */
383
+ const xmlChar **atts XML_DEPRECATED_MEMBER;
384
+ /* the size of the array */
385
+ int maxatts XML_DEPRECATED_MEMBER;
386
+ /* unused */
387
+ int docdict XML_DEPRECATED_MEMBER;
388
+
389
+ /*
390
+ * pre-interned strings
391
+ */
392
+ const xmlChar *str_xml XML_DEPRECATED_MEMBER;
393
+ const xmlChar *str_xmlns XML_DEPRECATED_MEMBER;
394
+ const xmlChar *str_xml_ns XML_DEPRECATED_MEMBER;
395
+
396
+ /*
397
+ * Everything below is used only by the new SAX mode
398
+ */
399
+
400
+ /* operating in the new SAX mode */
401
+ int sax2 XML_DEPRECATED_MEMBER;
402
+ /* the number of inherited namespaces */
403
+ int nsNr XML_DEPRECATED_MEMBER;
404
+ /* the size of the arrays */
405
+ int nsMax XML_DEPRECATED_MEMBER;
406
+ /* the array of prefix/namespace name */
407
+ const xmlChar **nsTab XML_DEPRECATED_MEMBER;
408
+ /* which attribute were allocated */
409
+ unsigned *attallocs XML_DEPRECATED_MEMBER;
410
+ /* array of data for push */
411
+ xmlStartTag *pushTab XML_DEPRECATED_MEMBER;
412
+ /* defaulted attributes if any */
413
+ xmlHashTablePtr attsDefault XML_DEPRECATED_MEMBER;
414
+ /* non-CDATA attributes if any */
415
+ xmlHashTablePtr attsSpecial XML_DEPRECATED_MEMBER;
416
+ /* is the document XML Namespace okay */
417
+ int nsWellFormed;
418
+ /* Extra options */
419
+ int options;
420
+
421
+ /*
422
+ * Those fields are needed only for streaming parsing so far
423
+ */
424
+
425
+ /* Use dictionary names for the tree */
426
+ int dictNames XML_DEPRECATED_MEMBER;
427
+ /* number of freed element nodes */
428
+ int freeElemsNr XML_DEPRECATED_MEMBER;
429
+ /* List of freed element nodes */
430
+ xmlNodePtr freeElems XML_DEPRECATED_MEMBER;
431
+ /* number of freed attributes nodes */
432
+ int freeAttrsNr XML_DEPRECATED_MEMBER;
433
+ /* List of freed attributes nodes */
434
+ xmlAttrPtr freeAttrs XML_DEPRECATED_MEMBER;
435
+
436
+ /*
437
+ * the complete error information for the last error.
438
+ */
439
+ xmlError lastError XML_DEPRECATED_MEMBER;
440
+ /* the parser mode */
441
+ xmlParserMode parseMode XML_DEPRECATED_MEMBER;
442
+ /* unused */
443
+ unsigned long nbentities XML_DEPRECATED_MEMBER;
444
+ /* size of external entities */
445
+ unsigned long sizeentities XML_DEPRECATED_MEMBER;
446
+
447
+ /* for use by HTML non-recursive parser */
448
+ /* Current NodeInfo */
449
+ xmlParserNodeInfo *nodeInfo XML_DEPRECATED_MEMBER;
450
+ /* Depth of the parsing stack */
451
+ int nodeInfoNr XML_DEPRECATED_MEMBER;
452
+ /* Max depth of the parsing stack */
453
+ int nodeInfoMax XML_DEPRECATED_MEMBER;
454
+ /* array of nodeInfos */
455
+ xmlParserNodeInfo *nodeInfoTab XML_DEPRECATED_MEMBER;
456
+
457
+ /* we need to label inputs */
458
+ int input_id XML_DEPRECATED_MEMBER;
459
+ /* volume of entity copy */
460
+ unsigned long sizeentcopy XML_DEPRECATED_MEMBER;
461
+
462
+ /* quote state for push parser */
463
+ int endCheckState XML_DEPRECATED_MEMBER;
464
+ /* number of errors */
465
+ unsigned short nbErrors XML_DEPRECATED_MEMBER;
466
+ /* number of warnings */
467
+ unsigned short nbWarnings XML_DEPRECATED_MEMBER;
468
+ /* maximum amplification factor */
469
+ unsigned maxAmpl XML_DEPRECATED_MEMBER;
470
+
471
+ /* namespace database */
472
+ xmlParserNsData *nsdb XML_DEPRECATED_MEMBER;
473
+ /* allocated size */
474
+ unsigned attrHashMax XML_DEPRECATED_MEMBER;
475
+ /* atttribute hash table */
476
+ xmlAttrHashBucket *attrHash XML_DEPRECATED_MEMBER;
477
+
478
+ xmlStructuredErrorFunc errorHandler XML_DEPRECATED_MEMBER;
479
+ void *errorCtxt XML_DEPRECATED_MEMBER;
480
+
481
+ xmlResourceLoader resourceLoader XML_DEPRECATED_MEMBER;
482
+ void *resourceCtxt XML_DEPRECATED_MEMBER;
483
+
484
+ xmlCharEncConvImpl convImpl XML_DEPRECATED_MEMBER;
485
+ void *convCtxt XML_DEPRECATED_MEMBER;
486
+ };
487
+
488
+ /**
489
+ * xmlSAXLocator:
490
+ *
491
+ * A SAX Locator.
492
+ */
493
+ struct _xmlSAXLocator {
494
+ const xmlChar *(*getPublicId)(void *ctx);
495
+ const xmlChar *(*getSystemId)(void *ctx);
496
+ int (*getLineNumber)(void *ctx);
497
+ int (*getColumnNumber)(void *ctx);
498
+ };
499
+
500
+ /**
501
+ * xmlSAXHandler:
502
+ *
503
+ * A SAX handler is bunch of callbacks called by the parser when processing
504
+ * of the input generate data or structure information.
505
+ */
506
+
507
+ /**
508
+ * resolveEntitySAXFunc:
509
+ * @ctx: the user data (XML parser context)
510
+ * @publicId: The public ID of the entity
511
+ * @systemId: The system ID of the entity
512
+ *
513
+ * Callback:
514
+ * The entity loader, to control the loading of external entities,
515
+ * the application can either:
516
+ * - override this resolveEntity() callback in the SAX block
517
+ * - or better use the xmlSetExternalEntityLoader() function to
518
+ * set up it's own entity resolution routine
519
+ *
520
+ * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
521
+ */
522
+ typedef xmlParserInputPtr (*resolveEntitySAXFunc) (void *ctx,
523
+ const xmlChar *publicId,
524
+ const xmlChar *systemId);
525
+ /**
526
+ * internalSubsetSAXFunc:
527
+ * @ctx: the user data (XML parser context)
528
+ * @name: the root element name
529
+ * @ExternalID: the external ID
530
+ * @SystemID: the SYSTEM ID (e.g. filename or URL)
531
+ *
532
+ * Callback on internal subset declaration.
533
+ */
534
+ typedef void (*internalSubsetSAXFunc) (void *ctx,
535
+ const xmlChar *name,
536
+ const xmlChar *ExternalID,
537
+ const xmlChar *SystemID);
538
+ /**
539
+ * externalSubsetSAXFunc:
540
+ * @ctx: the user data (XML parser context)
541
+ * @name: the root element name
542
+ * @ExternalID: the external ID
543
+ * @SystemID: the SYSTEM ID (e.g. filename or URL)
544
+ *
545
+ * Callback on external subset declaration.
546
+ */
547
+ typedef void (*externalSubsetSAXFunc) (void *ctx,
548
+ const xmlChar *name,
549
+ const xmlChar *ExternalID,
550
+ const xmlChar *SystemID);
551
+ /**
552
+ * getEntitySAXFunc:
553
+ * @ctx: the user data (XML parser context)
554
+ * @name: The entity name
555
+ *
556
+ * Get an entity by name.
557
+ *
558
+ * Returns the xmlEntityPtr if found.
559
+ */
560
+ typedef xmlEntityPtr (*getEntitySAXFunc) (void *ctx,
561
+ const xmlChar *name);
562
+ /**
563
+ * getParameterEntitySAXFunc:
564
+ * @ctx: the user data (XML parser context)
565
+ * @name: The entity name
566
+ *
567
+ * Get a parameter entity by name.
568
+ *
569
+ * Returns the xmlEntityPtr if found.
570
+ */
571
+ typedef xmlEntityPtr (*getParameterEntitySAXFunc) (void *ctx,
572
+ const xmlChar *name);
573
+ /**
574
+ * entityDeclSAXFunc:
575
+ * @ctx: the user data (XML parser context)
576
+ * @name: the entity name
577
+ * @type: the entity type
578
+ * @publicId: The public ID of the entity
579
+ * @systemId: The system ID of the entity
580
+ * @content: the entity value (without processing).
581
+ *
582
+ * An entity definition has been parsed.
583
+ */
584
+ typedef void (*entityDeclSAXFunc) (void *ctx,
585
+ const xmlChar *name,
586
+ int type,
587
+ const xmlChar *publicId,
588
+ const xmlChar *systemId,
589
+ xmlChar *content);
590
+ /**
591
+ * notationDeclSAXFunc:
592
+ * @ctx: the user data (XML parser context)
593
+ * @name: The name of the notation
594
+ * @publicId: The public ID of the entity
595
+ * @systemId: The system ID of the entity
596
+ *
597
+ * What to do when a notation declaration has been parsed.
598
+ */
599
+ typedef void (*notationDeclSAXFunc)(void *ctx,
600
+ const xmlChar *name,
601
+ const xmlChar *publicId,
602
+ const xmlChar *systemId);
603
+ /**
604
+ * attributeDeclSAXFunc:
605
+ * @ctx: the user data (XML parser context)
606
+ * @elem: the name of the element
607
+ * @fullname: the attribute name
608
+ * @type: the attribute type
609
+ * @def: the type of default value
610
+ * @defaultValue: the attribute default value
611
+ * @tree: the tree of enumerated value set
612
+ *
613
+ * An attribute definition has been parsed.
614
+ */
615
+ typedef void (*attributeDeclSAXFunc)(void *ctx,
616
+ const xmlChar *elem,
617
+ const xmlChar *fullname,
618
+ int type,
619
+ int def,
620
+ const xmlChar *defaultValue,
621
+ xmlEnumerationPtr tree);
622
+ /**
623
+ * elementDeclSAXFunc:
624
+ * @ctx: the user data (XML parser context)
625
+ * @name: the element name
626
+ * @type: the element type
627
+ * @content: the element value tree
628
+ *
629
+ * An element definition has been parsed.
630
+ */
631
+ typedef void (*elementDeclSAXFunc)(void *ctx,
632
+ const xmlChar *name,
633
+ int type,
634
+ xmlElementContentPtr content);
635
+ /**
636
+ * unparsedEntityDeclSAXFunc:
637
+ * @ctx: the user data (XML parser context)
638
+ * @name: The name of the entity
639
+ * @publicId: The public ID of the entity
640
+ * @systemId: The system ID of the entity
641
+ * @notationName: the name of the notation
642
+ *
643
+ * What to do when an unparsed entity declaration is parsed.
644
+ */
645
+ typedef void (*unparsedEntityDeclSAXFunc)(void *ctx,
646
+ const xmlChar *name,
647
+ const xmlChar *publicId,
648
+ const xmlChar *systemId,
649
+ const xmlChar *notationName);
650
+ /**
651
+ * setDocumentLocatorSAXFunc:
652
+ * @ctx: the user data (XML parser context)
653
+ * @loc: A SAX Locator
654
+ *
655
+ * Receive the document locator at startup, actually xmlDefaultSAXLocator.
656
+ * Everything is available on the context, so this is useless in our case.
657
+ */
658
+ typedef void (*setDocumentLocatorSAXFunc) (void *ctx,
659
+ xmlSAXLocatorPtr loc);
660
+ /**
661
+ * startDocumentSAXFunc:
662
+ * @ctx: the user data (XML parser context)
663
+ *
664
+ * Called when the document start being processed.
665
+ */
666
+ typedef void (*startDocumentSAXFunc) (void *ctx);
667
+ /**
668
+ * endDocumentSAXFunc:
669
+ * @ctx: the user data (XML parser context)
670
+ *
671
+ * Called when the document end has been detected.
672
+ */
673
+ typedef void (*endDocumentSAXFunc) (void *ctx);
674
+ /**
675
+ * startElementSAXFunc:
676
+ * @ctx: the user data (XML parser context)
677
+ * @name: The element name, including namespace prefix
678
+ * @atts: An array of name/value attributes pairs, NULL terminated
679
+ *
680
+ * Called when an opening tag has been processed.
681
+ */
682
+ typedef void (*startElementSAXFunc) (void *ctx,
683
+ const xmlChar *name,
684
+ const xmlChar **atts);
685
+ /**
686
+ * endElementSAXFunc:
687
+ * @ctx: the user data (XML parser context)
688
+ * @name: The element name
689
+ *
690
+ * Called when the end of an element has been detected.
691
+ */
692
+ typedef void (*endElementSAXFunc) (void *ctx,
693
+ const xmlChar *name);
694
+ /**
695
+ * attributeSAXFunc:
696
+ * @ctx: the user data (XML parser context)
697
+ * @name: The attribute name, including namespace prefix
698
+ * @value: The attribute value
699
+ *
700
+ * Handle an attribute that has been read by the parser.
701
+ * The default handling is to convert the attribute into an
702
+ * DOM subtree and past it in a new xmlAttr element added to
703
+ * the element.
704
+ */
705
+ typedef void (*attributeSAXFunc) (void *ctx,
706
+ const xmlChar *name,
707
+ const xmlChar *value);
708
+ /**
709
+ * referenceSAXFunc:
710
+ * @ctx: the user data (XML parser context)
711
+ * @name: The entity name
712
+ *
713
+ * Called when an entity reference is detected.
714
+ */
715
+ typedef void (*referenceSAXFunc) (void *ctx,
716
+ const xmlChar *name);
717
+ /**
718
+ * charactersSAXFunc:
719
+ * @ctx: the user data (XML parser context)
720
+ * @ch: a xmlChar string
721
+ * @len: the number of xmlChar
722
+ *
723
+ * Receiving some chars from the parser.
724
+ */
725
+ typedef void (*charactersSAXFunc) (void *ctx,
726
+ const xmlChar *ch,
727
+ int len);
728
+ /**
729
+ * ignorableWhitespaceSAXFunc:
730
+ * @ctx: the user data (XML parser context)
731
+ * @ch: a xmlChar string
732
+ * @len: the number of xmlChar
733
+ *
734
+ * Receiving some ignorable whitespaces from the parser.
735
+ * UNUSED: by default the DOM building will use characters.
736
+ */
737
+ typedef void (*ignorableWhitespaceSAXFunc) (void *ctx,
738
+ const xmlChar *ch,
739
+ int len);
740
+ /**
741
+ * processingInstructionSAXFunc:
742
+ * @ctx: the user data (XML parser context)
743
+ * @target: the target name
744
+ * @data: the PI data's
745
+ *
746
+ * A processing instruction has been parsed.
747
+ */
748
+ typedef void (*processingInstructionSAXFunc) (void *ctx,
749
+ const xmlChar *target,
750
+ const xmlChar *data);
751
+ /**
752
+ * commentSAXFunc:
753
+ * @ctx: the user data (XML parser context)
754
+ * @value: the comment content
755
+ *
756
+ * A comment has been parsed.
757
+ */
758
+ typedef void (*commentSAXFunc) (void *ctx,
759
+ const xmlChar *value);
760
+ /**
761
+ * cdataBlockSAXFunc:
762
+ * @ctx: the user data (XML parser context)
763
+ * @value: The pcdata content
764
+ * @len: the block length
765
+ *
766
+ * Called when a pcdata block has been parsed.
767
+ */
768
+ typedef void (*cdataBlockSAXFunc) (
769
+ void *ctx,
770
+ const xmlChar *value,
771
+ int len);
772
+ /**
773
+ * warningSAXFunc:
774
+ * @ctx: an XML parser context
775
+ * @msg: the message to display/transmit
776
+ * @...: extra parameters for the message display
777
+ *
778
+ * Display and format a warning messages, callback.
779
+ */
780
+ typedef void (*warningSAXFunc) (void *ctx,
781
+ const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
782
+ /**
783
+ * errorSAXFunc:
784
+ * @ctx: an XML parser context
785
+ * @msg: the message to display/transmit
786
+ * @...: extra parameters for the message display
787
+ *
788
+ * Display and format an error messages, callback.
789
+ */
790
+ typedef void (*errorSAXFunc) (void *ctx,
791
+ const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
792
+ /**
793
+ * fatalErrorSAXFunc:
794
+ * @ctx: an XML parser context
795
+ * @msg: the message to display/transmit
796
+ * @...: extra parameters for the message display
797
+ *
798
+ * Display and format fatal error messages, callback.
799
+ * Note: so far fatalError() SAX callbacks are not used, error()
800
+ * get all the callbacks for errors.
801
+ */
802
+ typedef void (*fatalErrorSAXFunc) (void *ctx,
803
+ const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
804
+ /**
805
+ * isStandaloneSAXFunc:
806
+ * @ctx: the user data (XML parser context)
807
+ *
808
+ * Is this document tagged standalone?
809
+ *
810
+ * Returns 1 if true
811
+ */
812
+ typedef int (*isStandaloneSAXFunc) (void *ctx);
813
+ /**
814
+ * hasInternalSubsetSAXFunc:
815
+ * @ctx: the user data (XML parser context)
816
+ *
817
+ * Does this document has an internal subset.
818
+ *
819
+ * Returns 1 if true
820
+ */
821
+ typedef int (*hasInternalSubsetSAXFunc) (void *ctx);
822
+
823
+ /**
824
+ * hasExternalSubsetSAXFunc:
825
+ * @ctx: the user data (XML parser context)
826
+ *
827
+ * Does this document has an external subset?
828
+ *
829
+ * Returns 1 if true
830
+ */
831
+ typedef int (*hasExternalSubsetSAXFunc) (void *ctx);
832
+
833
+ /************************************************************************
834
+ * *
835
+ * The SAX version 2 API extensions *
836
+ * *
837
+ ************************************************************************/
838
+ /**
839
+ * XML_SAX2_MAGIC:
840
+ *
841
+ * Special constant found in SAX2 blocks initialized fields
842
+ */
843
+ #define XML_SAX2_MAGIC 0xDEEDBEAF
844
+
845
+ /**
846
+ * startElementNsSAX2Func:
847
+ * @ctx: the user data (XML parser context)
848
+ * @localname: the local name of the element
849
+ * @prefix: the element namespace prefix if available
850
+ * @URI: the element namespace name if available
851
+ * @nb_namespaces: number of namespace definitions on that node
852
+ * @namespaces: pointer to the array of prefix/URI pairs namespace definitions
853
+ * @nb_attributes: the number of attributes on that node
854
+ * @nb_defaulted: the number of defaulted attributes. The defaulted
855
+ * ones are at the end of the array
856
+ * @attributes: pointer to the array of (localname/prefix/URI/value/end)
857
+ * attribute values.
858
+ *
859
+ * SAX2 callback when an element start has been detected by the parser.
860
+ * It provides the namespace information for the element, as well as
861
+ * the new namespace declarations on the element.
862
+ */
863
+
864
+ typedef void (*startElementNsSAX2Func) (void *ctx,
865
+ const xmlChar *localname,
866
+ const xmlChar *prefix,
867
+ const xmlChar *URI,
868
+ int nb_namespaces,
869
+ const xmlChar **namespaces,
870
+ int nb_attributes,
871
+ int nb_defaulted,
872
+ const xmlChar **attributes);
873
+
874
+ /**
875
+ * endElementNsSAX2Func:
876
+ * @ctx: the user data (XML parser context)
877
+ * @localname: the local name of the element
878
+ * @prefix: the element namespace prefix if available
879
+ * @URI: the element namespace name if available
880
+ *
881
+ * SAX2 callback when an element end has been detected by the parser.
882
+ * It provides the namespace information for the element.
883
+ */
884
+
885
+ typedef void (*endElementNsSAX2Func) (void *ctx,
886
+ const xmlChar *localname,
887
+ const xmlChar *prefix,
888
+ const xmlChar *URI);
889
+
890
+
891
+ struct _xmlSAXHandler {
892
+ /*
893
+ * For DTD-related handlers, it's recommended to either use the
894
+ * original libxml2 handler or set them to NULL if DTDs can be
895
+ * ignored.
896
+ */
897
+ internalSubsetSAXFunc internalSubset; /* DTD */
898
+ isStandaloneSAXFunc isStandalone; /* unused */
899
+ hasInternalSubsetSAXFunc hasInternalSubset; /* DTD */
900
+ hasExternalSubsetSAXFunc hasExternalSubset; /* DTD */
901
+ resolveEntitySAXFunc resolveEntity; /* DTD */
902
+ getEntitySAXFunc getEntity; /* DTD */
903
+ entityDeclSAXFunc entityDecl; /* DTD */
904
+ notationDeclSAXFunc notationDecl; /* DTD */
905
+ attributeDeclSAXFunc attributeDecl; /* DTD */
906
+ elementDeclSAXFunc elementDecl; /* DTD */
907
+ unparsedEntityDeclSAXFunc unparsedEntityDecl; /* DTD */
908
+ setDocumentLocatorSAXFunc setDocumentLocator; /* deprecated */
909
+ startDocumentSAXFunc startDocument;
910
+ endDocumentSAXFunc endDocument;
911
+ /*
912
+ * `startElement` and `endElement` are only used by the legacy SAX1
913
+ * interface and should not be used in new software. If you really
914
+ * have to enable SAX1, the preferred way is set the `initialized`
915
+ * member to 1 instead of XML_SAX2_MAGIC.
916
+ *
917
+ * For backward compatibility, it's also possible to set the
918
+ * `startElementNs` and `endElementNs` handlers to NULL.
919
+ *
920
+ * You can also set the XML_PARSE_SAX1 parser option, but versions
921
+ * older than 2.12.0 will probably crash if this option is provided
922
+ * together with custom SAX callbacks.
923
+ */
924
+ startElementSAXFunc startElement;
925
+ endElementSAXFunc endElement;
926
+ referenceSAXFunc reference;
927
+ charactersSAXFunc characters;
928
+ /*
929
+ * `ignorableWhitespace` should always be set to the same value
930
+ * as `characters`. Otherwise, the parser will try to detect
931
+ * whitespace which is unreliable.
932
+ */
933
+ ignorableWhitespaceSAXFunc ignorableWhitespace;
934
+ processingInstructionSAXFunc processingInstruction;
935
+ commentSAXFunc comment;
936
+ warningSAXFunc warning;
937
+ errorSAXFunc error;
938
+ fatalErrorSAXFunc fatalError; /* unused, `error` gets all the errors */
939
+ getParameterEntitySAXFunc getParameterEntity; /* DTD */
940
+ cdataBlockSAXFunc cdataBlock;
941
+ externalSubsetSAXFunc externalSubset; /* DTD */
942
+ /*
943
+ * `initialized` should always be set to XML_SAX2_MAGIC to enable the
944
+ * modern SAX2 interface.
945
+ */
946
+ unsigned int initialized;
947
+ /*
948
+ * The following members are only used by the SAX2 interface.
949
+ */
950
+ void *_private;
951
+ startElementNsSAX2Func startElementNs;
952
+ endElementNsSAX2Func endElementNs;
953
+ /*
954
+ * Takes precedence over `error` or `warning`, but modern code
955
+ * should use xmlCtxtSetErrorHandler.
956
+ */
957
+ xmlStructuredErrorFunc serror;
958
+ };
959
+
960
+ /*
961
+ * SAX Version 1
962
+ */
963
+ typedef struct _xmlSAXHandlerV1 xmlSAXHandlerV1;
964
+ typedef xmlSAXHandlerV1 *xmlSAXHandlerV1Ptr;
965
+ struct _xmlSAXHandlerV1 {
966
+ internalSubsetSAXFunc internalSubset;
967
+ isStandaloneSAXFunc isStandalone;
968
+ hasInternalSubsetSAXFunc hasInternalSubset;
969
+ hasExternalSubsetSAXFunc hasExternalSubset;
970
+ resolveEntitySAXFunc resolveEntity;
971
+ getEntitySAXFunc getEntity;
972
+ entityDeclSAXFunc entityDecl;
973
+ notationDeclSAXFunc notationDecl;
974
+ attributeDeclSAXFunc attributeDecl;
975
+ elementDeclSAXFunc elementDecl;
976
+ unparsedEntityDeclSAXFunc unparsedEntityDecl;
977
+ setDocumentLocatorSAXFunc setDocumentLocator;
978
+ startDocumentSAXFunc startDocument;
979
+ endDocumentSAXFunc endDocument;
980
+ startElementSAXFunc startElement;
981
+ endElementSAXFunc endElement;
982
+ referenceSAXFunc reference;
983
+ charactersSAXFunc characters;
984
+ ignorableWhitespaceSAXFunc ignorableWhitespace;
985
+ processingInstructionSAXFunc processingInstruction;
986
+ commentSAXFunc comment;
987
+ warningSAXFunc warning;
988
+ errorSAXFunc error;
989
+ fatalErrorSAXFunc fatalError; /* unused error() get all the errors */
990
+ getParameterEntitySAXFunc getParameterEntity;
991
+ cdataBlockSAXFunc cdataBlock;
992
+ externalSubsetSAXFunc externalSubset;
993
+ unsigned int initialized;
994
+ };
995
+
996
+
997
+ /**
998
+ * xmlExternalEntityLoader:
999
+ * @URL: The System ID of the resource requested
1000
+ * @ID: The Public ID of the resource requested
1001
+ * @context: the XML parser context
1002
+ *
1003
+ * External entity loaders types.
1004
+ *
1005
+ * Returns the entity input parser.
1006
+ */
1007
+ typedef xmlParserInputPtr (*xmlExternalEntityLoader) (const char *URL,
1008
+ const char *ID,
1009
+ xmlParserCtxtPtr context);
1010
+
1011
+ /*
1012
+ * Variables
1013
+ */
1014
+
1015
+ XMLPUBVAR const char *const xmlParserVersion;
1016
+
1017
+ /** DOC_DISABLE */
1018
+ XML_DEPRECATED
1019
+ XMLPUBVAR const xmlSAXLocator xmlDefaultSAXLocator;
1020
+ #ifdef LIBXML_SAX1_ENABLED
1021
+ XML_DEPRECATED
1022
+ XMLPUBVAR const xmlSAXHandlerV1 xmlDefaultSAXHandler;
1023
+ #endif
1024
+
1025
+ XML_DEPRECATED
1026
+ XMLPUBFUN int *__xmlDoValidityCheckingDefaultValue(void);
1027
+ XML_DEPRECATED
1028
+ XMLPUBFUN int *__xmlGetWarningsDefaultValue(void);
1029
+ XML_DEPRECATED
1030
+ XMLPUBFUN int *__xmlKeepBlanksDefaultValue(void);
1031
+ XML_DEPRECATED
1032
+ XMLPUBFUN int *__xmlLineNumbersDefaultValue(void);
1033
+ XML_DEPRECATED
1034
+ XMLPUBFUN int *__xmlLoadExtDtdDefaultValue(void);
1035
+ XML_DEPRECATED
1036
+ XMLPUBFUN int *__xmlPedanticParserDefaultValue(void);
1037
+ XML_DEPRECATED
1038
+ XMLPUBFUN int *__xmlSubstituteEntitiesDefaultValue(void);
1039
+
1040
+ #ifdef LIBXML_OUTPUT_ENABLED
1041
+ XMLPUBFUN int *__xmlIndentTreeOutput(void);
1042
+ XMLPUBFUN const char **__xmlTreeIndentString(void);
1043
+ XMLPUBFUN int *__xmlSaveNoEmptyTags(void);
1044
+ #endif
1045
+
1046
+ #ifndef XML_GLOBALS_NO_REDEFINITION
1047
+ #define xmlDoValidityCheckingDefaultValue \
1048
+ (*__xmlDoValidityCheckingDefaultValue())
1049
+ #define xmlGetWarningsDefaultValue \
1050
+ (*__xmlGetWarningsDefaultValue())
1051
+ #define xmlKeepBlanksDefaultValue (*__xmlKeepBlanksDefaultValue())
1052
+ #define xmlLineNumbersDefaultValue \
1053
+ (*__xmlLineNumbersDefaultValue())
1054
+ #define xmlLoadExtDtdDefaultValue (*__xmlLoadExtDtdDefaultValue())
1055
+ #define xmlPedanticParserDefaultValue \
1056
+ (*__xmlPedanticParserDefaultValue())
1057
+ #define xmlSubstituteEntitiesDefaultValue \
1058
+ (*__xmlSubstituteEntitiesDefaultValue())
1059
+ #ifdef LIBXML_OUTPUT_ENABLED
1060
+ #define xmlIndentTreeOutput (*__xmlIndentTreeOutput())
1061
+ #define xmlTreeIndentString (*__xmlTreeIndentString())
1062
+ #define xmlSaveNoEmptyTags (*__xmlSaveNoEmptyTags())
1063
+ #endif
1064
+ #endif
1065
+ /** DOC_ENABLE */
1066
+
1067
+ /*
1068
+ * Init/Cleanup
1069
+ */
1070
+ XMLPUBFUN void
1071
+ xmlInitParser (void);
1072
+ XMLPUBFUN void
1073
+ xmlCleanupParser (void);
1074
+ XML_DEPRECATED
1075
+ XMLPUBFUN void
1076
+ xmlInitGlobals (void);
1077
+ XML_DEPRECATED
1078
+ XMLPUBFUN void
1079
+ xmlCleanupGlobals (void);
1080
+
1081
+ /*
1082
+ * Input functions
1083
+ */
1084
+ XML_DEPRECATED
1085
+ XMLPUBFUN int
1086
+ xmlParserInputRead (xmlParserInputPtr in,
1087
+ int len);
1088
+ XMLPUBFUN int
1089
+ xmlParserInputGrow (xmlParserInputPtr in,
1090
+ int len);
1091
+
1092
+ /*
1093
+ * Basic parsing Interfaces
1094
+ */
1095
+ #ifdef LIBXML_SAX1_ENABLED
1096
+ XMLPUBFUN xmlDocPtr
1097
+ xmlParseDoc (const xmlChar *cur);
1098
+ XMLPUBFUN xmlDocPtr
1099
+ xmlParseFile (const char *filename);
1100
+ XMLPUBFUN xmlDocPtr
1101
+ xmlParseMemory (const char *buffer,
1102
+ int size);
1103
+ #endif /* LIBXML_SAX1_ENABLED */
1104
+ XML_DEPRECATED
1105
+ XMLPUBFUN int
1106
+ xmlSubstituteEntitiesDefault(int val);
1107
+ XML_DEPRECATED
1108
+ XMLPUBFUN int
1109
+ xmlThrDefSubstituteEntitiesDefaultValue(int v);
1110
+ XMLPUBFUN int
1111
+ xmlKeepBlanksDefault (int val);
1112
+ XML_DEPRECATED
1113
+ XMLPUBFUN int
1114
+ xmlThrDefKeepBlanksDefaultValue(int v);
1115
+ XMLPUBFUN void
1116
+ xmlStopParser (xmlParserCtxtPtr ctxt);
1117
+ XML_DEPRECATED
1118
+ XMLPUBFUN int
1119
+ xmlPedanticParserDefault(int val);
1120
+ XML_DEPRECATED
1121
+ XMLPUBFUN int
1122
+ xmlThrDefPedanticParserDefaultValue(int v);
1123
+ XML_DEPRECATED
1124
+ XMLPUBFUN int
1125
+ xmlLineNumbersDefault (int val);
1126
+ XML_DEPRECATED
1127
+ XMLPUBFUN int
1128
+ xmlThrDefLineNumbersDefaultValue(int v);
1129
+ XML_DEPRECATED
1130
+ XMLPUBFUN int
1131
+ xmlThrDefDoValidityCheckingDefaultValue(int v);
1132
+ XML_DEPRECATED
1133
+ XMLPUBFUN int
1134
+ xmlThrDefGetWarningsDefaultValue(int v);
1135
+ XML_DEPRECATED
1136
+ XMLPUBFUN int
1137
+ xmlThrDefLoadExtDtdDefaultValue(int v);
1138
+
1139
+ #ifdef LIBXML_SAX1_ENABLED
1140
+ /*
1141
+ * Recovery mode
1142
+ */
1143
+ XML_DEPRECATED
1144
+ XMLPUBFUN xmlDocPtr
1145
+ xmlRecoverDoc (const xmlChar *cur);
1146
+ XML_DEPRECATED
1147
+ XMLPUBFUN xmlDocPtr
1148
+ xmlRecoverMemory (const char *buffer,
1149
+ int size);
1150
+ XML_DEPRECATED
1151
+ XMLPUBFUN xmlDocPtr
1152
+ xmlRecoverFile (const char *filename);
1153
+ #endif /* LIBXML_SAX1_ENABLED */
1154
+
1155
+ /*
1156
+ * Less common routines and SAX interfaces
1157
+ */
1158
+ XMLPUBFUN int
1159
+ xmlParseDocument (xmlParserCtxtPtr ctxt);
1160
+ XML_DEPRECATED
1161
+ XMLPUBFUN int
1162
+ xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt);
1163
+ #ifdef LIBXML_SAX1_ENABLED
1164
+ XML_DEPRECATED
1165
+ XMLPUBFUN int
1166
+ xmlSAXUserParseFile (xmlSAXHandlerPtr sax,
1167
+ void *user_data,
1168
+ const char *filename);
1169
+ XML_DEPRECATED
1170
+ XMLPUBFUN int
1171
+ xmlSAXUserParseMemory (xmlSAXHandlerPtr sax,
1172
+ void *user_data,
1173
+ const char *buffer,
1174
+ int size);
1175
+ XML_DEPRECATED
1176
+ XMLPUBFUN xmlDocPtr
1177
+ xmlSAXParseDoc (xmlSAXHandlerPtr sax,
1178
+ const xmlChar *cur,
1179
+ int recovery);
1180
+ XML_DEPRECATED
1181
+ XMLPUBFUN xmlDocPtr
1182
+ xmlSAXParseMemory (xmlSAXHandlerPtr sax,
1183
+ const char *buffer,
1184
+ int size,
1185
+ int recovery);
1186
+ XML_DEPRECATED
1187
+ XMLPUBFUN xmlDocPtr
1188
+ xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax,
1189
+ const char *buffer,
1190
+ int size,
1191
+ int recovery,
1192
+ void *data);
1193
+ XML_DEPRECATED
1194
+ XMLPUBFUN xmlDocPtr
1195
+ xmlSAXParseFile (xmlSAXHandlerPtr sax,
1196
+ const char *filename,
1197
+ int recovery);
1198
+ XML_DEPRECATED
1199
+ XMLPUBFUN xmlDocPtr
1200
+ xmlSAXParseFileWithData (xmlSAXHandlerPtr sax,
1201
+ const char *filename,
1202
+ int recovery,
1203
+ void *data);
1204
+ XML_DEPRECATED
1205
+ XMLPUBFUN xmlDocPtr
1206
+ xmlSAXParseEntity (xmlSAXHandlerPtr sax,
1207
+ const char *filename);
1208
+ XML_DEPRECATED
1209
+ XMLPUBFUN xmlDocPtr
1210
+ xmlParseEntity (const char *filename);
1211
+ #endif /* LIBXML_SAX1_ENABLED */
1212
+
1213
+ #ifdef LIBXML_VALID_ENABLED
1214
+ XMLPUBFUN xmlDtdPtr
1215
+ xmlCtxtParseDtd (xmlParserCtxtPtr ctxt,
1216
+ xmlParserInputPtr input,
1217
+ const xmlChar *ExternalID,
1218
+ const xmlChar *SystemID);
1219
+ XMLPUBFUN int
1220
+ xmlCtxtValidateDocument (xmlParserCtxtPtr ctxt,
1221
+ xmlDocPtr doc);
1222
+ XMLPUBFUN int
1223
+ xmlCtxtValidateDtd (xmlParserCtxtPtr ctxt,
1224
+ xmlDocPtr doc,
1225
+ xmlDtdPtr dtd);
1226
+ XML_DEPRECATED
1227
+ XMLPUBFUN xmlDtdPtr
1228
+ xmlSAXParseDTD (xmlSAXHandlerPtr sax,
1229
+ const xmlChar *ExternalID,
1230
+ const xmlChar *SystemID);
1231
+ XMLPUBFUN xmlDtdPtr
1232
+ xmlParseDTD (const xmlChar *ExternalID,
1233
+ const xmlChar *SystemID);
1234
+ XMLPUBFUN xmlDtdPtr
1235
+ xmlIOParseDTD (xmlSAXHandlerPtr sax,
1236
+ xmlParserInputBufferPtr input,
1237
+ xmlCharEncoding enc);
1238
+ #endif /* LIBXML_VALID_ENABLE */
1239
+ #ifdef LIBXML_SAX1_ENABLED
1240
+ XMLPUBFUN int
1241
+ xmlParseBalancedChunkMemory(xmlDocPtr doc,
1242
+ xmlSAXHandlerPtr sax,
1243
+ void *user_data,
1244
+ int depth,
1245
+ const xmlChar *string,
1246
+ xmlNodePtr *lst);
1247
+ #endif /* LIBXML_SAX1_ENABLED */
1248
+ XMLPUBFUN xmlParserErrors
1249
+ xmlParseInNodeContext (xmlNodePtr node,
1250
+ const char *data,
1251
+ int datalen,
1252
+ int options,
1253
+ xmlNodePtr *lst);
1254
+ #ifdef LIBXML_SAX1_ENABLED
1255
+ XMLPUBFUN int
1256
+ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc,
1257
+ xmlSAXHandlerPtr sax,
1258
+ void *user_data,
1259
+ int depth,
1260
+ const xmlChar *string,
1261
+ xmlNodePtr *lst,
1262
+ int recover);
1263
+ XML_DEPRECATED
1264
+ XMLPUBFUN int
1265
+ xmlParseExternalEntity (xmlDocPtr doc,
1266
+ xmlSAXHandlerPtr sax,
1267
+ void *user_data,
1268
+ int depth,
1269
+ const xmlChar *URL,
1270
+ const xmlChar *ID,
1271
+ xmlNodePtr *lst);
1272
+ #endif /* LIBXML_SAX1_ENABLED */
1273
+ XMLPUBFUN int
1274
+ xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx,
1275
+ const xmlChar *URL,
1276
+ const xmlChar *ID,
1277
+ xmlNodePtr *lst);
1278
+
1279
+ /*
1280
+ * Parser contexts handling.
1281
+ */
1282
+ XMLPUBFUN xmlParserCtxtPtr
1283
+ xmlNewParserCtxt (void);
1284
+ XMLPUBFUN xmlParserCtxtPtr
1285
+ xmlNewSAXParserCtxt (const xmlSAXHandler *sax,
1286
+ void *userData);
1287
+ XMLPUBFUN int
1288
+ xmlInitParserCtxt (xmlParserCtxtPtr ctxt);
1289
+ XMLPUBFUN void
1290
+ xmlClearParserCtxt (xmlParserCtxtPtr ctxt);
1291
+ XMLPUBFUN void
1292
+ xmlFreeParserCtxt (xmlParserCtxtPtr ctxt);
1293
+ #ifdef LIBXML_SAX1_ENABLED
1294
+ XML_DEPRECATED
1295
+ XMLPUBFUN void
1296
+ xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt,
1297
+ const xmlChar* buffer,
1298
+ const char *filename);
1299
+ #endif /* LIBXML_SAX1_ENABLED */
1300
+ XMLPUBFUN xmlParserCtxtPtr
1301
+ xmlCreateDocParserCtxt (const xmlChar *cur);
1302
+
1303
+ #ifdef LIBXML_PUSH_ENABLED
1304
+ /*
1305
+ * Interfaces for the Push mode.
1306
+ */
1307
+ XMLPUBFUN xmlParserCtxtPtr
1308
+ xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax,
1309
+ void *user_data,
1310
+ const char *chunk,
1311
+ int size,
1312
+ const char *filename);
1313
+ XMLPUBFUN int
1314
+ xmlParseChunk (xmlParserCtxtPtr ctxt,
1315
+ const char *chunk,
1316
+ int size,
1317
+ int terminate);
1318
+ #endif /* LIBXML_PUSH_ENABLED */
1319
+
1320
+ /*
1321
+ * Special I/O mode.
1322
+ */
1323
+
1324
+ XMLPUBFUN xmlParserCtxtPtr
1325
+ xmlCreateIOParserCtxt (xmlSAXHandlerPtr sax,
1326
+ void *user_data,
1327
+ xmlInputReadCallback ioread,
1328
+ xmlInputCloseCallback ioclose,
1329
+ void *ioctx,
1330
+ xmlCharEncoding enc);
1331
+
1332
+ XMLPUBFUN xmlParserInputPtr
1333
+ xmlNewIOInputStream (xmlParserCtxtPtr ctxt,
1334
+ xmlParserInputBufferPtr input,
1335
+ xmlCharEncoding enc);
1336
+
1337
+ /*
1338
+ * Node infos.
1339
+ */
1340
+ XML_DEPRECATED
1341
+ XMLPUBFUN const xmlParserNodeInfo*
1342
+ xmlParserFindNodeInfo (xmlParserCtxtPtr ctxt,
1343
+ xmlNodePtr node);
1344
+ XML_DEPRECATED
1345
+ XMLPUBFUN void
1346
+ xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
1347
+ XML_DEPRECATED
1348
+ XMLPUBFUN void
1349
+ xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
1350
+ XML_DEPRECATED
1351
+ XMLPUBFUN unsigned long
1352
+ xmlParserFindNodeInfoIndex(xmlParserNodeInfoSeqPtr seq,
1353
+ xmlNodePtr node);
1354
+ XML_DEPRECATED
1355
+ XMLPUBFUN void
1356
+ xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt,
1357
+ xmlParserNodeInfoPtr info);
1358
+
1359
+ /*
1360
+ * External entities handling actually implemented in xmlIO.
1361
+ */
1362
+
1363
+ XMLPUBFUN void
1364
+ xmlSetExternalEntityLoader(xmlExternalEntityLoader f);
1365
+ XMLPUBFUN xmlExternalEntityLoader
1366
+ xmlGetExternalEntityLoader(void);
1367
+ XMLPUBFUN xmlParserInputPtr
1368
+ xmlLoadExternalEntity (const char *URL,
1369
+ const char *ID,
1370
+ xmlParserCtxtPtr ctxt);
1371
+
1372
+ XML_DEPRECATED
1373
+ XMLPUBFUN long
1374
+ xmlByteConsumed (xmlParserCtxtPtr ctxt);
1375
+
1376
+ /*
1377
+ * New set of simpler/more flexible APIs
1378
+ */
1379
+ /**
1380
+ * xmlParserOption:
1381
+ *
1382
+ * This is the set of XML parser options that can be passed down
1383
+ * to the xmlReadDoc() and similar calls.
1384
+ */
1385
+ typedef enum {
1386
+ XML_PARSE_RECOVER = 1<<0, /* recover on errors */
1387
+ XML_PARSE_NOENT = 1<<1, /* substitute entities */
1388
+ XML_PARSE_DTDLOAD = 1<<2, /* load the external subset */
1389
+ XML_PARSE_DTDATTR = 1<<3, /* default DTD attributes */
1390
+ XML_PARSE_DTDVALID = 1<<4, /* validate with the DTD */
1391
+ XML_PARSE_NOERROR = 1<<5, /* suppress error reports */
1392
+ XML_PARSE_NOWARNING = 1<<6, /* suppress warning reports */
1393
+ XML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */
1394
+ XML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */
1395
+ XML_PARSE_SAX1 = 1<<9, /* use the SAX1 interface internally */
1396
+ XML_PARSE_XINCLUDE = 1<<10,/* Implement XInclude substitution */
1397
+ XML_PARSE_NONET = 1<<11,/* Forbid network access */
1398
+ XML_PARSE_NODICT = 1<<12,/* Do not reuse the context dictionary */
1399
+ XML_PARSE_NSCLEAN = 1<<13,/* remove redundant namespaces declarations */
1400
+ XML_PARSE_NOCDATA = 1<<14,/* merge CDATA as text nodes */
1401
+ XML_PARSE_NOXINCNODE= 1<<15,/* do not generate XINCLUDE START/END nodes */
1402
+ XML_PARSE_COMPACT = 1<<16,/* compact small text nodes; no modification of
1403
+ the tree allowed afterwards (will possibly
1404
+ crash if you try to modify the tree) */
1405
+ XML_PARSE_OLD10 = 1<<17,/* parse using XML-1.0 before update 5 */
1406
+ XML_PARSE_NOBASEFIX = 1<<18,/* do not fixup XINCLUDE xml:base uris */
1407
+ XML_PARSE_HUGE = 1<<19,/* relax any hardcoded limit from the parser */
1408
+ XML_PARSE_OLDSAX = 1<<20,/* parse using SAX2 interface before 2.7.0 */
1409
+ XML_PARSE_IGNORE_ENC= 1<<21,/* ignore internal document encoding hint */
1410
+ XML_PARSE_BIG_LINES = 1<<22,/* Store big lines numbers in text PSVI field */
1411
+ /* since 2.13.0 */
1412
+ XML_PARSE_NO_XXE = 1<<23,/* disable loading of external content */
1413
+ /* since 2.14.0 */
1414
+ XML_PARSE_UNZIP = 1<<24,/* allow compressed content */
1415
+ XML_PARSE_NO_SYS_CATALOG = 1<<25,/* disable global system catalog */
1416
+ XML_PARSE_CATALOG_PI = 1<<26 /* allow catalog PIs */
1417
+ } xmlParserOption;
1418
+
1419
+ XMLPUBFUN void
1420
+ xmlCtxtReset (xmlParserCtxtPtr ctxt);
1421
+ XMLPUBFUN int
1422
+ xmlCtxtResetPush (xmlParserCtxtPtr ctxt,
1423
+ const char *chunk,
1424
+ int size,
1425
+ const char *filename,
1426
+ const char *encoding);
1427
+ XMLPUBFUN int
1428
+ xmlCtxtGetOptions (xmlParserCtxtPtr ctxt);
1429
+ XMLPUBFUN int
1430
+ xmlCtxtSetOptions (xmlParserCtxtPtr ctxt,
1431
+ int options);
1432
+ XMLPUBFUN int
1433
+ xmlCtxtUseOptions (xmlParserCtxtPtr ctxt,
1434
+ int options);
1435
+ XMLPUBFUN void *
1436
+ xmlCtxtGetPrivate (xmlParserCtxtPtr ctxt);
1437
+ XMLPUBFUN void
1438
+ xmlCtxtSetPrivate (xmlParserCtxtPtr ctxt,
1439
+ void *priv);
1440
+ XMLPUBFUN void *
1441
+ xmlCtxtGetCatalogs (xmlParserCtxtPtr ctxt);
1442
+ XMLPUBFUN void
1443
+ xmlCtxtSetCatalogs (xmlParserCtxtPtr ctxt,
1444
+ void *catalogs);
1445
+ XMLPUBFUN xmlDictPtr
1446
+ xmlCtxtGetDict (xmlParserCtxtPtr ctxt);
1447
+ XMLPUBFUN void
1448
+ xmlCtxtSetDict (xmlParserCtxtPtr ctxt,
1449
+ xmlDictPtr);
1450
+ XMLPUBFUN xmlSAXHandler *
1451
+ xmlCtxtGetSaxHandler (xmlParserCtxtPtr ctxt);
1452
+ XMLPUBFUN int
1453
+ xmlCtxtSetSaxHandler (xmlParserCtxtPtr ctxt,
1454
+ const xmlSAXHandler *sax);
1455
+ XMLPUBFUN xmlDocPtr
1456
+ xmlCtxtGetDocument (xmlParserCtxtPtr ctxt);
1457
+ XMLPUBFUN int
1458
+ xmlCtxtIsHtml (xmlParserCtxtPtr ctxt);
1459
+ XMLPUBFUN int
1460
+ xmlCtxtIsStopped (xmlParserCtxtPtr ctxt);
1461
+ #ifdef LIBXML_VALID_ENABLED
1462
+ XMLPUBFUN xmlValidCtxtPtr
1463
+ xmlCtxtGetValidCtxt (xmlParserCtxtPtr ctxt);
1464
+ #endif
1465
+ XMLPUBFUN const xmlChar *
1466
+ xmlCtxtGetVersion (xmlParserCtxtPtr ctxt);
1467
+ XMLPUBFUN const xmlChar *
1468
+ xmlCtxtGetDeclaredEncoding(xmlParserCtxtPtr ctxt);
1469
+ XMLPUBFUN int
1470
+ xmlCtxtGetStandalone (xmlParserCtxtPtr ctxt);
1471
+ XMLPUBFUN xmlParserStatus
1472
+ xmlCtxtGetStatus (xmlParserCtxtPtr ctxt);
1473
+ XMLPUBFUN void
1474
+ xmlCtxtSetErrorHandler (xmlParserCtxtPtr ctxt,
1475
+ xmlStructuredErrorFunc handler,
1476
+ void *data);
1477
+ XMLPUBFUN void
1478
+ xmlCtxtSetResourceLoader(xmlParserCtxtPtr ctxt,
1479
+ xmlResourceLoader loader,
1480
+ void *vctxt);
1481
+ XMLPUBFUN void
1482
+ xmlCtxtSetCharEncConvImpl(xmlParserCtxtPtr ctxt,
1483
+ xmlCharEncConvImpl impl,
1484
+ void *vctxt);
1485
+ XMLPUBFUN void
1486
+ xmlCtxtSetMaxAmplification(xmlParserCtxtPtr ctxt,
1487
+ unsigned maxAmpl);
1488
+ XMLPUBFUN xmlDocPtr
1489
+ xmlReadDoc (const xmlChar *cur,
1490
+ const char *URL,
1491
+ const char *encoding,
1492
+ int options);
1493
+ XMLPUBFUN xmlDocPtr
1494
+ xmlReadFile (const char *URL,
1495
+ const char *encoding,
1496
+ int options);
1497
+ XMLPUBFUN xmlDocPtr
1498
+ xmlReadMemory (const char *buffer,
1499
+ int size,
1500
+ const char *URL,
1501
+ const char *encoding,
1502
+ int options);
1503
+ XMLPUBFUN xmlDocPtr
1504
+ xmlReadFd (int fd,
1505
+ const char *URL,
1506
+ const char *encoding,
1507
+ int options);
1508
+ XMLPUBFUN xmlDocPtr
1509
+ xmlReadIO (xmlInputReadCallback ioread,
1510
+ xmlInputCloseCallback ioclose,
1511
+ void *ioctx,
1512
+ const char *URL,
1513
+ const char *encoding,
1514
+ int options);
1515
+ XMLPUBFUN xmlDocPtr
1516
+ xmlCtxtParseDocument (xmlParserCtxtPtr ctxt,
1517
+ xmlParserInputPtr input);
1518
+ XMLPUBFUN xmlNodePtr
1519
+ xmlCtxtParseContent (xmlParserCtxtPtr ctxt,
1520
+ xmlParserInputPtr input,
1521
+ xmlNodePtr node,
1522
+ int hasTextDecl);
1523
+ XMLPUBFUN xmlDocPtr
1524
+ xmlCtxtReadDoc (xmlParserCtxtPtr ctxt,
1525
+ const xmlChar *cur,
1526
+ const char *URL,
1527
+ const char *encoding,
1528
+ int options);
1529
+ XMLPUBFUN xmlDocPtr
1530
+ xmlCtxtReadFile (xmlParserCtxtPtr ctxt,
1531
+ const char *filename,
1532
+ const char *encoding,
1533
+ int options);
1534
+ XMLPUBFUN xmlDocPtr
1535
+ xmlCtxtReadMemory (xmlParserCtxtPtr ctxt,
1536
+ const char *buffer,
1537
+ int size,
1538
+ const char *URL,
1539
+ const char *encoding,
1540
+ int options);
1541
+ XMLPUBFUN xmlDocPtr
1542
+ xmlCtxtReadFd (xmlParserCtxtPtr ctxt,
1543
+ int fd,
1544
+ const char *URL,
1545
+ const char *encoding,
1546
+ int options);
1547
+ XMLPUBFUN xmlDocPtr
1548
+ xmlCtxtReadIO (xmlParserCtxtPtr ctxt,
1549
+ xmlInputReadCallback ioread,
1550
+ xmlInputCloseCallback ioclose,
1551
+ void *ioctx,
1552
+ const char *URL,
1553
+ const char *encoding,
1554
+ int options);
1555
+
1556
+ /**
1557
+ * New input API
1558
+ */
1559
+
1560
+ XMLPUBFUN xmlParserErrors
1561
+ xmlNewInputFromUrl(const char *url, xmlParserInputFlags flags,
1562
+ xmlParserInputPtr *out);
1563
+ XMLPUBFUN xmlParserInputPtr
1564
+ xmlNewInputFromMemory(const char *url, const void *mem, size_t size,
1565
+ xmlParserInputFlags flags);
1566
+ XMLPUBFUN xmlParserInputPtr
1567
+ xmlNewInputFromString(const char *url, const char *str,
1568
+ xmlParserInputFlags flags);
1569
+ XMLPUBFUN xmlParserInputPtr
1570
+ xmlNewInputFromFd(const char *url, int fd, xmlParserInputFlags flags);
1571
+ XMLPUBFUN xmlParserInputPtr
1572
+ xmlNewInputFromIO(const char *url, xmlInputReadCallback ioRead,
1573
+ xmlInputCloseCallback ioClose, void *ioCtxt,
1574
+ xmlParserInputFlags flags);
1575
+ XMLPUBFUN xmlParserErrors
1576
+ xmlInputSetEncodingHandler(xmlParserInputPtr input,
1577
+ xmlCharEncodingHandlerPtr handler);
1578
+
1579
+ /*
1580
+ * Library wide options
1581
+ */
1582
+ /**
1583
+ * xmlFeature:
1584
+ *
1585
+ * Used to examine the existence of features that can be enabled
1586
+ * or disabled at compile-time.
1587
+ * They used to be called XML_FEATURE_xxx but this clashed with Expat
1588
+ */
1589
+ typedef enum {
1590
+ XML_WITH_THREAD = 1,
1591
+ XML_WITH_TREE = 2,
1592
+ XML_WITH_OUTPUT = 3,
1593
+ XML_WITH_PUSH = 4,
1594
+ XML_WITH_READER = 5,
1595
+ XML_WITH_PATTERN = 6,
1596
+ XML_WITH_WRITER = 7,
1597
+ XML_WITH_SAX1 = 8,
1598
+ XML_WITH_FTP = 9,
1599
+ XML_WITH_HTTP = 10,
1600
+ XML_WITH_VALID = 11,
1601
+ XML_WITH_HTML = 12,
1602
+ XML_WITH_LEGACY = 13,
1603
+ XML_WITH_C14N = 14,
1604
+ XML_WITH_CATALOG = 15,
1605
+ XML_WITH_XPATH = 16,
1606
+ XML_WITH_XPTR = 17,
1607
+ XML_WITH_XINCLUDE = 18,
1608
+ XML_WITH_ICONV = 19,
1609
+ XML_WITH_ISO8859X = 20,
1610
+ XML_WITH_UNICODE = 21,
1611
+ XML_WITH_REGEXP = 22,
1612
+ XML_WITH_AUTOMATA = 23,
1613
+ XML_WITH_EXPR = 24,
1614
+ XML_WITH_SCHEMAS = 25,
1615
+ XML_WITH_SCHEMATRON = 26,
1616
+ XML_WITH_MODULES = 27,
1617
+ XML_WITH_DEBUG = 28,
1618
+ XML_WITH_DEBUG_MEM = 29,
1619
+ XML_WITH_DEBUG_RUN = 30, /* unused */
1620
+ XML_WITH_ZLIB = 31,
1621
+ XML_WITH_ICU = 32,
1622
+ XML_WITH_LZMA = 33,
1623
+ XML_WITH_RELAXNG = 34, /* since 2.14.0 */
1624
+ XML_WITH_NONE = 99999 /* just to be sure of allocation size */
1625
+ } xmlFeature;
1626
+
1627
+ XMLPUBFUN int
1628
+ xmlHasFeature (xmlFeature feature);
1629
+
1630
+ #ifdef __cplusplus
1631
+ }
1632
+ #endif
1633
+ #endif /* __XML_PARSER_H__ */