lxml 5.4.0__cp310-cp310-macosx_10_9_universal2.whl → 6.0.0__cp310-cp310-macosx_10_9_universal2.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 (74) hide show
  1. lxml/__init__.py +1 -1
  2. lxml/_elementpath.cpython-310-darwin.so +0 -0
  3. lxml/_elementpath.py +3 -1
  4. lxml/apihelpers.pxi +25 -17
  5. lxml/builder.cpython-310-darwin.so +0 -0
  6. lxml/builder.py +11 -0
  7. lxml/debug.pxi +0 -54
  8. lxml/etree.cpython-310-darwin.so +0 -0
  9. lxml/etree.h +24 -28
  10. lxml/etree.pyx +154 -33
  11. lxml/etree_api.h +59 -50
  12. lxml/extensions.pxi +3 -6
  13. lxml/html/__init__.py +7 -3
  14. lxml/html/_difflib.cpython-310-darwin.so +0 -0
  15. lxml/html/_difflib.py +2106 -0
  16. lxml/html/builder.py +40 -0
  17. lxml/html/defs.py +3 -3
  18. lxml/html/diff.cpython-310-darwin.so +0 -0
  19. lxml/html/diff.py +406 -312
  20. lxml/includes/etree_defs.h +6 -6
  21. lxml/includes/libxml/HTMLparser.h +33 -30
  22. lxml/includes/libxml/HTMLtree.h +1 -0
  23. lxml/includes/libxml/SAX.h +2 -186
  24. lxml/includes/libxml/SAX2.h +2 -3
  25. lxml/includes/libxml/catalog.h +1 -0
  26. lxml/includes/libxml/debugXML.h +0 -138
  27. lxml/includes/libxml/encoding.h +124 -61
  28. lxml/includes/libxml/entities.h +0 -19
  29. lxml/includes/libxml/globals.h +0 -16
  30. lxml/includes/libxml/nanoftp.h +3 -173
  31. lxml/includes/libxml/parser.h +474 -231
  32. lxml/includes/libxml/parserInternals.h +21 -101
  33. lxml/includes/libxml/relaxng.h +7 -2
  34. lxml/includes/libxml/threads.h +0 -6
  35. lxml/includes/libxml/tree.h +29 -85
  36. lxml/includes/libxml/valid.h +20 -12
  37. lxml/includes/libxml/xinclude.h +5 -0
  38. lxml/includes/libxml/xlink.h +4 -0
  39. lxml/includes/libxml/xmlIO.h +15 -34
  40. lxml/includes/libxml/xmlautomata.h +19 -2
  41. lxml/includes/libxml/xmlerror.h +18 -18
  42. lxml/includes/libxml/xmlexports.h +6 -56
  43. lxml/includes/libxml/xmlmemory.h +19 -19
  44. lxml/includes/libxml/xmlmodule.h +4 -0
  45. lxml/includes/libxml/xmlreader.h +11 -3
  46. lxml/includes/libxml/xmlregexp.h +7 -106
  47. lxml/includes/libxml/xmlsave.h +11 -2
  48. lxml/includes/libxml/xmlschemas.h +10 -5
  49. lxml/includes/libxml/xmlunicode.h +3 -354
  50. lxml/includes/libxml/xmlversion.h +19 -34
  51. lxml/includes/libxml/xpath.h +5 -15
  52. lxml/includes/libxml/xpathInternals.h +9 -3
  53. lxml/includes/libxml/xpointer.h +1 -91
  54. lxml/includes/lxml-version.h +1 -1
  55. lxml/includes/tree.pxd +10 -12
  56. lxml/includes/xmlparser.pxd +46 -8
  57. lxml/lxml.etree.h +24 -28
  58. lxml/lxml.etree_api.h +59 -50
  59. lxml/objectify.cpython-310-darwin.so +0 -0
  60. lxml/objectify.pyx +11 -7
  61. lxml/parser.pxi +106 -47
  62. lxml/sax.cpython-310-darwin.so +0 -0
  63. lxml/sax.py +11 -0
  64. lxml/saxparser.pxi +14 -14
  65. lxml/schematron.pxi +8 -3
  66. lxml/serializer.pxi +71 -3
  67. lxml/xslt.pxi +10 -3
  68. lxml-6.0.0.dist-info/METADATA +163 -0
  69. {lxml-5.4.0.dist-info → lxml-6.0.0.dist-info}/RECORD +73 -71
  70. {lxml-5.4.0.dist-info → lxml-6.0.0.dist-info}/WHEEL +2 -1
  71. {lxml-5.4.0.dist-info → lxml-6.0.0.dist-info}/licenses/LICENSE.txt +3 -1
  72. lxml-5.4.0.dist-info/METADATA +0 -96
  73. {lxml-5.4.0.dist-info → lxml-6.0.0.dist-info}/licenses/LICENSES.txt +0 -0
  74. {lxml-5.4.0.dist-info → lxml-6.0.0.dist-info}/top_level.txt +0 -0
@@ -40,6 +40,30 @@ extern "C" {
40
40
  */
41
41
  #define XML_DEFAULT_VERSION "1.0"
42
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
+
43
67
  /**
44
68
  * xmlParserInput:
45
69
  *
@@ -61,24 +85,39 @@ typedef void (* xmlParserInputDeallocate)(xmlChar *str);
61
85
 
62
86
  struct _xmlParserInput {
63
87
  /* Input buffer */
64
- xmlParserInputBufferPtr buf; /* UTF-8 encoded buffer */
65
-
66
- const char *filename; /* The file analyzed, if any */
67
- const char *directory; /* unused */
68
- const xmlChar *base; /* Base of the array to parse */
69
- const xmlChar *cur; /* Current char being parsed */
70
- const xmlChar *end; /* end of the array to parse */
71
- int length; /* unused */
72
- int line; /* Current line */
73
- int col; /* Current column */
74
- unsigned long consumed; /* How many xmlChars already consumed */
75
- xmlParserInputDeallocate free; /* function to deallocate the base */
76
- const xmlChar *encoding; /* unused */
77
- const xmlChar *version; /* the version string for entity */
78
- int flags; /* Flags */
79
- int id; /* an unique identifier for the entity */
80
- unsigned long parentConsumed; /* unused */
81
- xmlEntityPtr entity; /* entity, if any */
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;
82
121
  };
83
122
 
84
123
  /**
@@ -163,6 +202,29 @@ typedef struct _xmlStartTag xmlStartTag;
163
202
  typedef struct _xmlParserNsData xmlParserNsData;
164
203
  typedef struct _xmlAttrHashBucket xmlAttrHashBucket;
165
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
+
166
228
  /**
167
229
  * xmlParserCtxt:
168
230
  *
@@ -176,146 +238,251 @@ typedef struct _xmlAttrHashBucket xmlAttrHashBucket;
176
238
  * to a state based parser for progressive parsing shouldn't be too hard.
177
239
  */
178
240
  struct _xmlParserCtxt {
179
- struct _xmlSAXHandler *sax; /* The SAX handler */
180
- void *userData; /* For SAX interface only, used by DOM build */
181
- xmlDocPtr myDoc; /* the document being built */
182
- int wellFormed; /* is the document well formed */
183
- int replaceEntities; /* shall we replace entities ? */
184
- const xmlChar *version; /* the XML version string */
185
- const xmlChar *encoding; /* the declared encoding, if any */
186
- int standalone; /* standalone document */
187
- int html; /* an HTML(1) document
188
- * 3 is HTML after <head>
189
- * 10 is HTML after <body>
190
- */
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;
191
263
 
192
264
  /* Input stream stack */
193
- xmlParserInputPtr input; /* Current input stream */
194
- int inputNr; /* Number of current input streams */
195
- int inputMax; /* Max number of input streams */
196
- xmlParserInputPtr *inputTab; /* stack of inputs */
197
-
198
- /* Node analysis stack only used for DOM building */
199
- xmlNodePtr node; /* Current parsed Node */
200
- int nodeNr; /* Depth of the parsing stack */
201
- int nodeMax; /* Max depth of the parsing stack */
202
- xmlNodePtr *nodeTab; /* array of nodes */
203
265
 
204
- int record_info; /* Whether node info should be kept */
205
- xmlParserNodeInfoSeq node_seq; /* info about each node parsed */
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;
206
274
 
207
- int errNo; /* error code */
275
+ /* Node analysis stack only used for DOM building */
208
276
 
209
- int hasExternalSubset; /* reference and external subset */
210
- int hasPErefs; /* the internal subset has PE refs */
211
- int external; /* unused */
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;
212
315
 
213
- int valid; /* is the document valid */
214
- int validate; /* shall we try to validate ? */
215
- xmlValidCtxt vctxt; /* The validity context */
316
+ /* Node name stack */
216
317
 
217
- xmlParserInputState instate; /* push parser state */
218
- int token; /* unused */
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;
219
343
 
220
- char *directory; /* unused */
344
+ /* xml:space values */
221
345
 
222
- /* Node name stack */
223
- const xmlChar *name; /* Current parsed Node */
224
- int nameNr; /* Depth of the parsing stack */
225
- int nameMax; /* Max depth of the parsing stack */
226
- const xmlChar * *nameTab; /* array of nodes */
227
-
228
- long nbChars; /* unused */
229
- long checkIndex; /* used by progressive parsing lookup */
230
- int keepBlanks; /* ugly but ... */
231
- int disableSAX; /* SAX callbacks are disabled */
232
- int inSubset; /* Parsing is in int 1/ext 2 subset */
233
- const xmlChar * intSubName; /* name of subset */
234
- xmlChar * extSubURI; /* URI of external subset */
235
- xmlChar * extSubSystem; /* SYSTEM ID of external subset */
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;
236
369
 
237
- /* xml:space values */
238
- int * space; /* Should the parser preserve spaces */
239
- int spaceNr; /* Depth of the parsing stack */
240
- int spaceMax; /* Max depth of the parsing stack */
241
- int * spaceTab; /* array of space infos */
242
-
243
- int depth; /* to prevent entity substitution loops */
244
- xmlParserInputPtr entity; /* unused */
245
- int charset; /* unused */
246
- int nodelen; /* Those two fields are there to */
247
- int nodemem; /* Speed up large node parsing */
248
- int pedantic; /* signal pedantic warnings */
249
- void *_private; /* For user data, libxml won't touch it */
250
-
251
- int loadsubset; /* should the external subset be loaded */
252
- int linenumbers; /* set line number in element content */
253
- void *catalogs; /* document's own catalog */
254
- int recovery; /* run in recovery mode */
255
- int progressive; /* unused */
256
- xmlDictPtr dict; /* dictionary for the parser */
257
- const xmlChar * *atts; /* array for the attributes callbacks */
258
- int maxatts; /* the size of the array */
259
- int docdict; /* unused */
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;
260
388
 
261
389
  /*
262
390
  * pre-interned strings
263
391
  */
264
- const xmlChar *str_xml;
265
- const xmlChar *str_xmlns;
266
- const xmlChar *str_xml_ns;
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;
267
395
 
268
396
  /*
269
397
  * Everything below is used only by the new SAX mode
270
398
  */
271
- int sax2; /* operating in the new SAX mode */
272
- int nsNr; /* the number of inherited namespaces */
273
- int nsMax; /* the size of the arrays */
274
- const xmlChar * *nsTab; /* the array of prefix/namespace name */
275
- unsigned *attallocs; /* which attribute were allocated */
276
- xmlStartTag *pushTab; /* array of data for push */
277
- xmlHashTablePtr attsDefault; /* defaulted attributes if any */
278
- xmlHashTablePtr attsSpecial; /* non-CDATA attributes if any */
279
- int nsWellFormed; /* is the document XML Namespace okay */
280
- int options; /* Extra options */
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;
281
420
 
282
421
  /*
283
422
  * Those fields are needed only for streaming parsing so far
284
423
  */
285
- int dictNames; /* Use dictionary names for the tree */
286
- int freeElemsNr; /* number of freed element nodes */
287
- xmlNodePtr freeElems; /* List of freed element nodes */
288
- int freeAttrsNr; /* number of freed attributes nodes */
289
- xmlAttrPtr freeAttrs; /* List of freed attributes nodes */
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;
290
435
 
291
436
  /*
292
437
  * the complete error information for the last error.
293
438
  */
294
- xmlError lastError;
295
- xmlParserMode parseMode; /* the parser mode */
296
- unsigned long nbentities; /* unused */
297
- unsigned long sizeentities; /* size of external entities */
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;
298
446
 
299
447
  /* for use by HTML non-recursive parser */
300
- xmlParserNodeInfo *nodeInfo; /* Current NodeInfo */
301
- int nodeInfoNr; /* Depth of the parsing stack */
302
- int nodeInfoMax; /* Max depth of the parsing stack */
303
- xmlParserNodeInfo *nodeInfoTab; /* array of nodeInfos */
304
-
305
- int input_id; /* we need to label inputs */
306
- unsigned long sizeentcopy; /* volume of entity copy */
307
-
308
- int endCheckState; /* quote state for push parser */
309
- unsigned short nbErrors; /* number of errors */
310
- unsigned short nbWarnings; /* number of warnings */
311
- unsigned maxAmpl; /* maximum amplification factor */
312
-
313
- xmlParserNsData *nsdb; /* namespace database */
314
- unsigned attrHashMax; /* allocated size */
315
- xmlAttrHashBucket *attrHash; /* atttribute hash table */
316
-
317
- xmlStructuredErrorFunc errorHandler;
318
- void *errorCtxt;
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;
319
486
  };
320
487
 
321
488
  /**
@@ -722,18 +889,23 @@ typedef void (*endElementNsSAX2Func) (void *ctx,
722
889
 
723
890
 
724
891
  struct _xmlSAXHandler {
725
- internalSubsetSAXFunc internalSubset;
726
- isStandaloneSAXFunc isStandalone;
727
- hasInternalSubsetSAXFunc hasInternalSubset;
728
- hasExternalSubsetSAXFunc hasExternalSubset;
729
- resolveEntitySAXFunc resolveEntity;
730
- getEntitySAXFunc getEntity;
731
- entityDeclSAXFunc entityDecl;
732
- notationDeclSAXFunc notationDecl;
733
- attributeDeclSAXFunc attributeDecl;
734
- elementDeclSAXFunc elementDecl;
735
- unparsedEntityDeclSAXFunc unparsedEntityDecl;
736
- setDocumentLocatorSAXFunc setDocumentLocator;
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 */
737
909
  startDocumentSAXFunc startDocument;
738
910
  endDocumentSAXFunc endDocument;
739
911
  /*
@@ -753,15 +925,20 @@ struct _xmlSAXHandler {
753
925
  endElementSAXFunc endElement;
754
926
  referenceSAXFunc reference;
755
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
+ */
756
933
  ignorableWhitespaceSAXFunc ignorableWhitespace;
757
934
  processingInstructionSAXFunc processingInstruction;
758
935
  commentSAXFunc comment;
759
936
  warningSAXFunc warning;
760
937
  errorSAXFunc error;
761
- fatalErrorSAXFunc fatalError; /* unused error() get all the errors */
762
- getParameterEntitySAXFunc getParameterEntity;
938
+ fatalErrorSAXFunc fatalError; /* unused, `error` gets all the errors */
939
+ getParameterEntitySAXFunc getParameterEntity; /* DTD */
763
940
  cdataBlockSAXFunc cdataBlock;
764
- externalSubsetSAXFunc externalSubset;
941
+ externalSubsetSAXFunc externalSubset; /* DTD */
765
942
  /*
766
943
  * `initialized` should always be set to XML_SAX2_MAGIC to enable the
767
944
  * modern SAX2 interface.
@@ -773,6 +950,10 @@ struct _xmlSAXHandler {
773
950
  void *_private;
774
951
  startElementNsSAX2Func startElementNs;
775
952
  endElementNsSAX2Func endElementNs;
953
+ /*
954
+ * Takes precedence over `error` or `warning`, but modern code
955
+ * should use xmlCtxtSetErrorHandler.
956
+ */
776
957
  xmlStructuredErrorFunc serror;
777
958
  };
778
959
 
@@ -832,10 +1013,8 @@ typedef xmlParserInputPtr (*xmlExternalEntityLoader) (const char *URL,
832
1013
  */
833
1014
 
834
1015
  XMLPUBVAR const char *const xmlParserVersion;
835
- XML_DEPRECATED
836
- XMLPUBVAR const int oldXMLWDcompatibility;
837
- XML_DEPRECATED
838
- XMLPUBVAR const int xmlParserDebugEntities;
1016
+
1017
+ /** DOC_DISABLE */
839
1018
  XML_DEPRECATED
840
1019
  XMLPUBVAR const xmlSAXLocator xmlDefaultSAXLocator;
841
1020
  #ifdef LIBXML_SAX1_ENABLED
@@ -843,65 +1022,44 @@ XML_DEPRECATED
843
1022
  XMLPUBVAR const xmlSAXHandlerV1 xmlDefaultSAXHandler;
844
1023
  #endif
845
1024
 
846
- #ifdef LIBXML_THREAD_ENABLED
847
- /* backward compatibility */
848
- XMLPUBFUN const char *const *__xmlParserVersion(void);
849
1025
  XML_DEPRECATED
850
- XMLPUBFUN const int *__oldXMLWDcompatibility(void);
1026
+ XMLPUBFUN int *__xmlDoValidityCheckingDefaultValue(void);
851
1027
  XML_DEPRECATED
852
- XMLPUBFUN const int *__xmlParserDebugEntities(void);
1028
+ XMLPUBFUN int *__xmlGetWarningsDefaultValue(void);
853
1029
  XML_DEPRECATED
854
- XMLPUBFUN const xmlSAXLocator *__xmlDefaultSAXLocator(void);
855
- #ifdef LIBXML_SAX1_ENABLED
1030
+ XMLPUBFUN int *__xmlKeepBlanksDefaultValue(void);
856
1031
  XML_DEPRECATED
857
- XMLPUBFUN const xmlSAXHandlerV1 *__xmlDefaultSAXHandler(void);
858
- #endif
859
- #endif
860
-
861
- /** DOC_DISABLE */
862
- #define XML_GLOBALS_PARSER_CORE \
863
- XML_OP(xmlDoValidityCheckingDefaultValue, int, XML_DEPRECATED) \
864
- XML_OP(xmlGetWarningsDefaultValue, int, XML_DEPRECATED) \
865
- XML_OP(xmlKeepBlanksDefaultValue, int, XML_DEPRECATED) \
866
- XML_OP(xmlLineNumbersDefaultValue, int, XML_DEPRECATED) \
867
- XML_OP(xmlLoadExtDtdDefaultValue, int, XML_DEPRECATED) \
868
- XML_OP(xmlPedanticParserDefaultValue, int, XML_DEPRECATED) \
869
- XML_OP(xmlSubstituteEntitiesDefaultValue, int, 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);
870
1039
 
871
1040
  #ifdef LIBXML_OUTPUT_ENABLED
872
- #define XML_GLOBALS_PARSER_OUTPUT \
873
- XML_OP(xmlIndentTreeOutput, int, XML_NO_ATTR) \
874
- XML_OP(xmlTreeIndentString, const char *, XML_NO_ATTR) \
875
- XML_OP(xmlSaveNoEmptyTags, int, XML_NO_ATTR)
876
- #else
877
- #define XML_GLOBALS_PARSER_OUTPUT
1041
+ XMLPUBFUN int *__xmlIndentTreeOutput(void);
1042
+ XMLPUBFUN const char **__xmlTreeIndentString(void);
1043
+ XMLPUBFUN int *__xmlSaveNoEmptyTags(void);
878
1044
  #endif
879
1045
 
880
- #define XML_GLOBALS_PARSER \
881
- XML_GLOBALS_PARSER_CORE \
882
- XML_GLOBALS_PARSER_OUTPUT
883
-
884
- #define XML_OP XML_DECLARE_GLOBAL
885
- XML_GLOBALS_PARSER
886
- #undef XML_OP
887
-
888
- #if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION)
1046
+ #ifndef XML_GLOBALS_NO_REDEFINITION
889
1047
  #define xmlDoValidityCheckingDefaultValue \
890
- XML_GLOBAL_MACRO(xmlDoValidityCheckingDefaultValue)
1048
+ (*__xmlDoValidityCheckingDefaultValue())
891
1049
  #define xmlGetWarningsDefaultValue \
892
- XML_GLOBAL_MACRO(xmlGetWarningsDefaultValue)
893
- #define xmlKeepBlanksDefaultValue XML_GLOBAL_MACRO(xmlKeepBlanksDefaultValue)
1050
+ (*__xmlGetWarningsDefaultValue())
1051
+ #define xmlKeepBlanksDefaultValue (*__xmlKeepBlanksDefaultValue())
894
1052
  #define xmlLineNumbersDefaultValue \
895
- XML_GLOBAL_MACRO(xmlLineNumbersDefaultValue)
896
- #define xmlLoadExtDtdDefaultValue XML_GLOBAL_MACRO(xmlLoadExtDtdDefaultValue)
1053
+ (*__xmlLineNumbersDefaultValue())
1054
+ #define xmlLoadExtDtdDefaultValue (*__xmlLoadExtDtdDefaultValue())
897
1055
  #define xmlPedanticParserDefaultValue \
898
- XML_GLOBAL_MACRO(xmlPedanticParserDefaultValue)
1056
+ (*__xmlPedanticParserDefaultValue())
899
1057
  #define xmlSubstituteEntitiesDefaultValue \
900
- XML_GLOBAL_MACRO(xmlSubstituteEntitiesDefaultValue)
1058
+ (*__xmlSubstituteEntitiesDefaultValue())
901
1059
  #ifdef LIBXML_OUTPUT_ENABLED
902
- #define xmlIndentTreeOutput XML_GLOBAL_MACRO(xmlIndentTreeOutput)
903
- #define xmlTreeIndentString XML_GLOBAL_MACRO(xmlTreeIndentString)
904
- #define xmlSaveNoEmptyTags XML_GLOBAL_MACRO(xmlSaveNoEmptyTags)
1060
+ #define xmlIndentTreeOutput (*__xmlIndentTreeOutput())
1061
+ #define xmlTreeIndentString (*__xmlTreeIndentString())
1062
+ #define xmlSaveNoEmptyTags (*__xmlSaveNoEmptyTags())
905
1063
  #endif
906
1064
  #endif
907
1065
  /** DOC_ENABLE */
@@ -927,7 +1085,6 @@ XML_DEPRECATED
927
1085
  XMLPUBFUN int
928
1086
  xmlParserInputRead (xmlParserInputPtr in,
929
1087
  int len);
930
- XML_DEPRECATED
931
1088
  XMLPUBFUN int
932
1089
  xmlParserInputGrow (xmlParserInputPtr in,
933
1090
  int len);
@@ -944,32 +1101,40 @@ XMLPUBFUN xmlDocPtr
944
1101
  xmlParseMemory (const char *buffer,
945
1102
  int size);
946
1103
  #endif /* LIBXML_SAX1_ENABLED */
947
- XML_DEPRECATED XMLPUBFUN int
1104
+ XML_DEPRECATED
1105
+ XMLPUBFUN int
948
1106
  xmlSubstituteEntitiesDefault(int val);
949
- XML_DEPRECATED XMLPUBFUN int
1107
+ XML_DEPRECATED
1108
+ XMLPUBFUN int
950
1109
  xmlThrDefSubstituteEntitiesDefaultValue(int v);
951
1110
  XMLPUBFUN int
952
1111
  xmlKeepBlanksDefault (int val);
953
- XML_DEPRECATED XMLPUBFUN int
1112
+ XML_DEPRECATED
1113
+ XMLPUBFUN int
954
1114
  xmlThrDefKeepBlanksDefaultValue(int v);
955
1115
  XMLPUBFUN void
956
1116
  xmlStopParser (xmlParserCtxtPtr ctxt);
957
- XML_DEPRECATED XMLPUBFUN int
1117
+ XML_DEPRECATED
1118
+ XMLPUBFUN int
958
1119
  xmlPedanticParserDefault(int val);
959
- XML_DEPRECATED XMLPUBFUN int
1120
+ XML_DEPRECATED
1121
+ XMLPUBFUN int
960
1122
  xmlThrDefPedanticParserDefaultValue(int v);
961
- XML_DEPRECATED XMLPUBFUN int
1123
+ XML_DEPRECATED
1124
+ XMLPUBFUN int
962
1125
  xmlLineNumbersDefault (int val);
963
- XML_DEPRECATED XMLPUBFUN int
1126
+ XML_DEPRECATED
1127
+ XMLPUBFUN int
964
1128
  xmlThrDefLineNumbersDefaultValue(int v);
965
- XML_DEPRECATED XMLPUBFUN int
1129
+ XML_DEPRECATED
1130
+ XMLPUBFUN int
966
1131
  xmlThrDefDoValidityCheckingDefaultValue(int v);
967
- XML_DEPRECATED XMLPUBFUN int
1132
+ XML_DEPRECATED
1133
+ XMLPUBFUN int
968
1134
  xmlThrDefGetWarningsDefaultValue(int v);
969
- XML_DEPRECATED XMLPUBFUN int
1135
+ XML_DEPRECATED
1136
+ XMLPUBFUN int
970
1137
  xmlThrDefLoadExtDtdDefaultValue(int v);
971
- XML_DEPRECATED XMLPUBFUN int
972
- xmlThrDefParserDebugEntities(int v);
973
1138
 
974
1139
  #ifdef LIBXML_SAX1_ENABLED
975
1140
  /*
@@ -992,6 +1157,7 @@ XMLPUBFUN xmlDocPtr
992
1157
  */
993
1158
  XMLPUBFUN int
994
1159
  xmlParseDocument (xmlParserCtxtPtr ctxt);
1160
+ XML_DEPRECATED
995
1161
  XMLPUBFUN int
996
1162
  xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt);
997
1163
  #ifdef LIBXML_SAX1_ENABLED
@@ -1045,6 +1211,18 @@ XMLPUBFUN xmlDocPtr
1045
1211
  #endif /* LIBXML_SAX1_ENABLED */
1046
1212
 
1047
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);
1048
1226
  XML_DEPRECATED
1049
1227
  XMLPUBFUN xmlDtdPtr
1050
1228
  xmlSAXParseDTD (xmlSAXHandlerPtr sax,
@@ -1122,26 +1300,6 @@ XMLPUBFUN void
1122
1300
  XMLPUBFUN xmlParserCtxtPtr
1123
1301
  xmlCreateDocParserCtxt (const xmlChar *cur);
1124
1302
 
1125
- #ifdef LIBXML_LEGACY_ENABLED
1126
- /*
1127
- * Reading/setting optional parsing features.
1128
- */
1129
- XML_DEPRECATED
1130
- XMLPUBFUN int
1131
- xmlGetFeaturesList (int *len,
1132
- const char **result);
1133
- XML_DEPRECATED
1134
- XMLPUBFUN int
1135
- xmlGetFeature (xmlParserCtxtPtr ctxt,
1136
- const char *name,
1137
- void *result);
1138
- XML_DEPRECATED
1139
- XMLPUBFUN int
1140
- xmlSetFeature (xmlParserCtxtPtr ctxt,
1141
- const char *name,
1142
- void *value);
1143
- #endif /* LIBXML_LEGACY_ENABLED */
1144
-
1145
1303
  #ifdef LIBXML_PUSH_ENABLED
1146
1304
  /*
1147
1305
  * Interfaces for the Push mode.
@@ -1179,16 +1337,21 @@ XMLPUBFUN xmlParserInputPtr
1179
1337
  /*
1180
1338
  * Node infos.
1181
1339
  */
1340
+ XML_DEPRECATED
1182
1341
  XMLPUBFUN const xmlParserNodeInfo*
1183
1342
  xmlParserFindNodeInfo (xmlParserCtxtPtr ctxt,
1184
1343
  xmlNodePtr node);
1344
+ XML_DEPRECATED
1185
1345
  XMLPUBFUN void
1186
1346
  xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
1347
+ XML_DEPRECATED
1187
1348
  XMLPUBFUN void
1188
1349
  xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
1350
+ XML_DEPRECATED
1189
1351
  XMLPUBFUN unsigned long
1190
1352
  xmlParserFindNodeInfoIndex(xmlParserNodeInfoSeqPtr seq,
1191
1353
  xmlNodePtr node);
1354
+ XML_DEPRECATED
1192
1355
  XMLPUBFUN void
1193
1356
  xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt,
1194
1357
  xmlParserNodeInfoPtr info);
@@ -1206,9 +1369,7 @@ XMLPUBFUN xmlParserInputPtr
1206
1369
  const char *ID,
1207
1370
  xmlParserCtxtPtr ctxt);
1208
1371
 
1209
- /*
1210
- * Index lookup, actually implemented in the encoding module
1211
- */
1372
+ XML_DEPRECATED
1212
1373
  XMLPUBFUN long
1213
1374
  xmlByteConsumed (xmlParserCtxtPtr ctxt);
1214
1375
 
@@ -1247,7 +1408,12 @@ typedef enum {
1247
1408
  XML_PARSE_OLDSAX = 1<<20,/* parse using SAX2 interface before 2.7.0 */
1248
1409
  XML_PARSE_IGNORE_ENC= 1<<21,/* ignore internal document encoding hint */
1249
1410
  XML_PARSE_BIG_LINES = 1<<22,/* Store big lines numbers in text PSVI field */
1250
- XML_PARSE_NO_XXE = 1<<23 /* disable loading of external content */
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 */
1251
1417
  } xmlParserOption;
1252
1418
 
1253
1419
  XMLPUBFUN void
@@ -1258,16 +1424,64 @@ XMLPUBFUN int
1258
1424
  int size,
1259
1425
  const char *filename,
1260
1426
  const char *encoding);
1427
+ XMLPUBFUN int
1428
+ xmlCtxtGetOptions (xmlParserCtxtPtr ctxt);
1261
1429
  XMLPUBFUN int
1262
1430
  xmlCtxtSetOptions (xmlParserCtxtPtr ctxt,
1263
1431
  int options);
1264
1432
  XMLPUBFUN int
1265
1433
  xmlCtxtUseOptions (xmlParserCtxtPtr ctxt,
1266
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);
1267
1473
  XMLPUBFUN void
1268
1474
  xmlCtxtSetErrorHandler (xmlParserCtxtPtr ctxt,
1269
1475
  xmlStructuredErrorFunc handler,
1270
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);
1271
1485
  XMLPUBFUN void
1272
1486
  xmlCtxtSetMaxAmplification(xmlParserCtxtPtr ctxt,
1273
1487
  unsigned maxAmpl);
@@ -1301,6 +1515,11 @@ XMLPUBFUN xmlDocPtr
1301
1515
  XMLPUBFUN xmlDocPtr
1302
1516
  xmlCtxtParseDocument (xmlParserCtxtPtr ctxt,
1303
1517
  xmlParserInputPtr input);
1518
+ XMLPUBFUN xmlNodePtr
1519
+ xmlCtxtParseContent (xmlParserCtxtPtr ctxt,
1520
+ xmlParserInputPtr input,
1521
+ xmlNodePtr node,
1522
+ int hasTextDecl);
1304
1523
  XMLPUBFUN xmlDocPtr
1305
1524
  xmlCtxtReadDoc (xmlParserCtxtPtr ctxt,
1306
1525
  const xmlChar *cur,
@@ -1334,6 +1553,29 @@ XMLPUBFUN xmlDocPtr
1334
1553
  const char *encoding,
1335
1554
  int options);
1336
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
+
1337
1579
  /*
1338
1580
  * Library wide options
1339
1581
  */
@@ -1378,6 +1620,7 @@ typedef enum {
1378
1620
  XML_WITH_ZLIB = 31,
1379
1621
  XML_WITH_ICU = 32,
1380
1622
  XML_WITH_LZMA = 33,
1623
+ XML_WITH_RELAXNG = 34, /* since 2.14.0 */
1381
1624
  XML_WITH_NONE = 99999 /* just to be sure of allocation size */
1382
1625
  } xmlFeature;
1383
1626