lxml 5.3.0__cp313-cp313-manylinux_2_28_x86_64.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 (172) hide show
  1. lxml/ElementInclude.py +244 -0
  2. lxml/__init__.py +22 -0
  3. lxml/_elementpath.cpython-313-x86_64-linux-gnu.so +0 -0
  4. lxml/_elementpath.py +341 -0
  5. lxml/apihelpers.pxi +1793 -0
  6. lxml/builder.cpython-313-x86_64-linux-gnu.so +0 -0
  7. lxml/builder.py +232 -0
  8. lxml/classlookup.pxi +580 -0
  9. lxml/cleanup.pxi +215 -0
  10. lxml/cssselect.py +101 -0
  11. lxml/debug.pxi +90 -0
  12. lxml/docloader.pxi +178 -0
  13. lxml/doctestcompare.py +488 -0
  14. lxml/dtd.pxi +478 -0
  15. lxml/etree.cpython-313-x86_64-linux-gnu.so +0 -0
  16. lxml/etree.h +248 -0
  17. lxml/etree.pyx +3731 -0
  18. lxml/etree_api.h +195 -0
  19. lxml/extensions.pxi +833 -0
  20. lxml/html/ElementSoup.py +10 -0
  21. lxml/html/__init__.py +1923 -0
  22. lxml/html/_diffcommand.py +86 -0
  23. lxml/html/_html5builder.py +100 -0
  24. lxml/html/_setmixin.py +56 -0
  25. lxml/html/builder.py +133 -0
  26. lxml/html/clean.py +21 -0
  27. lxml/html/defs.py +135 -0
  28. lxml/html/diff.cpython-313-x86_64-linux-gnu.so +0 -0
  29. lxml/html/diff.py +878 -0
  30. lxml/html/formfill.py +299 -0
  31. lxml/html/html5parser.py +260 -0
  32. lxml/html/soupparser.py +314 -0
  33. lxml/html/usedoctest.py +13 -0
  34. lxml/includes/__init__.pxd +0 -0
  35. lxml/includes/__init__.py +0 -0
  36. lxml/includes/c14n.pxd +25 -0
  37. lxml/includes/config.pxd +3 -0
  38. lxml/includes/dtdvalid.pxd +18 -0
  39. lxml/includes/etree_defs.h +379 -0
  40. lxml/includes/etreepublic.pxd +237 -0
  41. lxml/includes/extlibs/__init__.py +0 -0
  42. lxml/includes/extlibs/libcharset.h +45 -0
  43. lxml/includes/extlibs/localcharset.h +137 -0
  44. lxml/includes/extlibs/zconf.h +543 -0
  45. lxml/includes/extlibs/zlib.h +1938 -0
  46. lxml/includes/htmlparser.pxd +56 -0
  47. lxml/includes/libexslt/__init__.py +0 -0
  48. lxml/includes/libexslt/exslt.h +108 -0
  49. lxml/includes/libexslt/exsltconfig.h +70 -0
  50. lxml/includes/libexslt/exsltexports.h +63 -0
  51. lxml/includes/libxml/HTMLparser.h +343 -0
  52. lxml/includes/libxml/HTMLtree.h +147 -0
  53. lxml/includes/libxml/SAX.h +202 -0
  54. lxml/includes/libxml/SAX2.h +171 -0
  55. lxml/includes/libxml/__init__.py +0 -0
  56. lxml/includes/libxml/c14n.h +126 -0
  57. lxml/includes/libxml/catalog.h +182 -0
  58. lxml/includes/libxml/chvalid.h +230 -0
  59. lxml/includes/libxml/debugXML.h +217 -0
  60. lxml/includes/libxml/dict.h +82 -0
  61. lxml/includes/libxml/encoding.h +235 -0
  62. lxml/includes/libxml/entities.h +155 -0
  63. lxml/includes/libxml/globals.h +41 -0
  64. lxml/includes/libxml/hash.h +232 -0
  65. lxml/includes/libxml/list.h +137 -0
  66. lxml/includes/libxml/nanoftp.h +186 -0
  67. lxml/includes/libxml/nanohttp.h +81 -0
  68. lxml/includes/libxml/parser.h +1384 -0
  69. lxml/includes/libxml/parserInternals.h +663 -0
  70. lxml/includes/libxml/relaxng.h +219 -0
  71. lxml/includes/libxml/schemasInternals.h +959 -0
  72. lxml/includes/libxml/schematron.h +143 -0
  73. lxml/includes/libxml/threads.h +87 -0
  74. lxml/includes/libxml/tree.h +1362 -0
  75. lxml/includes/libxml/uri.h +95 -0
  76. lxml/includes/libxml/valid.h +450 -0
  77. lxml/includes/libxml/xinclude.h +129 -0
  78. lxml/includes/libxml/xlink.h +189 -0
  79. lxml/includes/libxml/xmlIO.h +421 -0
  80. lxml/includes/libxml/xmlautomata.h +146 -0
  81. lxml/includes/libxml/xmlerror.h +948 -0
  82. lxml/includes/libxml/xmlexports.h +50 -0
  83. lxml/includes/libxml/xmlmemory.h +225 -0
  84. lxml/includes/libxml/xmlmodule.h +57 -0
  85. lxml/includes/libxml/xmlreader.h +434 -0
  86. lxml/includes/libxml/xmlregexp.h +215 -0
  87. lxml/includes/libxml/xmlsave.h +97 -0
  88. lxml/includes/libxml/xmlschemas.h +249 -0
  89. lxml/includes/libxml/xmlschemastypes.h +152 -0
  90. lxml/includes/libxml/xmlstring.h +140 -0
  91. lxml/includes/libxml/xmlunicode.h +202 -0
  92. lxml/includes/libxml/xmlversion.h +511 -0
  93. lxml/includes/libxml/xmlwriter.h +488 -0
  94. lxml/includes/libxml/xpath.h +575 -0
  95. lxml/includes/libxml/xpathInternals.h +633 -0
  96. lxml/includes/libxml/xpointer.h +138 -0
  97. lxml/includes/libxslt/__init__.py +0 -0
  98. lxml/includes/libxslt/attributes.h +39 -0
  99. lxml/includes/libxslt/documents.h +93 -0
  100. lxml/includes/libxslt/extensions.h +262 -0
  101. lxml/includes/libxslt/extra.h +72 -0
  102. lxml/includes/libxslt/functions.h +78 -0
  103. lxml/includes/libxslt/imports.h +75 -0
  104. lxml/includes/libxslt/keys.h +53 -0
  105. lxml/includes/libxslt/namespaces.h +68 -0
  106. lxml/includes/libxslt/numbersInternals.h +73 -0
  107. lxml/includes/libxslt/pattern.h +84 -0
  108. lxml/includes/libxslt/preproc.h +43 -0
  109. lxml/includes/libxslt/security.h +104 -0
  110. lxml/includes/libxslt/templates.h +77 -0
  111. lxml/includes/libxslt/transform.h +207 -0
  112. lxml/includes/libxslt/variables.h +118 -0
  113. lxml/includes/libxslt/xslt.h +110 -0
  114. lxml/includes/libxslt/xsltInternals.h +1995 -0
  115. lxml/includes/libxslt/xsltconfig.h +146 -0
  116. lxml/includes/libxslt/xsltexports.h +64 -0
  117. lxml/includes/libxslt/xsltlocale.h +44 -0
  118. lxml/includes/libxslt/xsltutils.h +343 -0
  119. lxml/includes/lxml-version.h +3 -0
  120. lxml/includes/relaxng.pxd +64 -0
  121. lxml/includes/schematron.pxd +34 -0
  122. lxml/includes/tree.pxd +494 -0
  123. lxml/includes/uri.pxd +5 -0
  124. lxml/includes/xinclude.pxd +22 -0
  125. lxml/includes/xmlerror.pxd +852 -0
  126. lxml/includes/xmlparser.pxd +265 -0
  127. lxml/includes/xmlschema.pxd +35 -0
  128. lxml/includes/xpath.pxd +136 -0
  129. lxml/includes/xslt.pxd +190 -0
  130. lxml/isoschematron/__init__.py +348 -0
  131. lxml/isoschematron/resources/rng/iso-schematron.rng +709 -0
  132. lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl +75 -0
  133. lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl +77 -0
  134. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl +313 -0
  135. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl +1160 -0
  136. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl +55 -0
  137. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl +1796 -0
  138. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl +588 -0
  139. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt +84 -0
  140. lxml/iterparse.pxi +438 -0
  141. lxml/lxml.etree.h +248 -0
  142. lxml/lxml.etree_api.h +195 -0
  143. lxml/nsclasses.pxi +281 -0
  144. lxml/objectify.cpython-313-x86_64-linux-gnu.so +0 -0
  145. lxml/objectify.pyx +2145 -0
  146. lxml/objectpath.pxi +332 -0
  147. lxml/parser.pxi +2000 -0
  148. lxml/parsertarget.pxi +180 -0
  149. lxml/proxy.pxi +619 -0
  150. lxml/public-api.pxi +178 -0
  151. lxml/pyclasslookup.py +3 -0
  152. lxml/readonlytree.pxi +565 -0
  153. lxml/relaxng.pxi +165 -0
  154. lxml/sax.cpython-313-x86_64-linux-gnu.so +0 -0
  155. lxml/sax.py +275 -0
  156. lxml/saxparser.pxi +875 -0
  157. lxml/schematron.pxi +168 -0
  158. lxml/serializer.pxi +1781 -0
  159. lxml/usedoctest.py +13 -0
  160. lxml/xinclude.pxi +67 -0
  161. lxml/xmlerror.pxi +1654 -0
  162. lxml/xmlid.pxi +179 -0
  163. lxml/xmlschema.pxi +215 -0
  164. lxml/xpath.pxi +487 -0
  165. lxml/xslt.pxi +950 -0
  166. lxml/xsltext.pxi +242 -0
  167. lxml-5.3.0.dist-info/LICENSE.txt +29 -0
  168. lxml-5.3.0.dist-info/LICENSES.txt +29 -0
  169. lxml-5.3.0.dist-info/METADATA +103 -0
  170. lxml-5.3.0.dist-info/RECORD +172 -0
  171. lxml-5.3.0.dist-info/WHEEL +5 -0
  172. lxml-5.3.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1362 @@
1
+ /*
2
+ * Summary: interfaces for tree manipulation
3
+ * Description: this module describes the structures found in an tree resulting
4
+ * from an XML or HTML parsing, as well as the API provided for
5
+ * various processing on that tree
6
+ *
7
+ * Copy: See Copyright for the status of this software.
8
+ *
9
+ * Author: Daniel Veillard
10
+ */
11
+
12
+ #ifndef XML_TREE_INTERNALS
13
+
14
+ /*
15
+ * Emulate circular dependency for backward compatibility
16
+ */
17
+ #include <libxml/parser.h>
18
+
19
+ #else /* XML_TREE_INTERNALS */
20
+
21
+ #ifndef __XML_TREE_H__
22
+ #define __XML_TREE_H__
23
+
24
+ #include <stdio.h>
25
+ #include <limits.h>
26
+ #include <libxml/xmlversion.h>
27
+ #include <libxml/xmlstring.h>
28
+ #include <libxml/xmlmemory.h>
29
+ #include <libxml/xmlregexp.h>
30
+
31
+ #ifdef __cplusplus
32
+ extern "C" {
33
+ #endif
34
+
35
+ /*
36
+ * Some of the basic types pointer to structures:
37
+ */
38
+ /* xmlIO.h */
39
+ typedef struct _xmlParserInputBuffer xmlParserInputBuffer;
40
+ typedef xmlParserInputBuffer *xmlParserInputBufferPtr;
41
+
42
+ typedef struct _xmlOutputBuffer xmlOutputBuffer;
43
+ typedef xmlOutputBuffer *xmlOutputBufferPtr;
44
+
45
+ /* parser.h */
46
+ typedef struct _xmlParserInput xmlParserInput;
47
+ typedef xmlParserInput *xmlParserInputPtr;
48
+
49
+ typedef struct _xmlParserCtxt xmlParserCtxt;
50
+ typedef xmlParserCtxt *xmlParserCtxtPtr;
51
+
52
+ typedef struct _xmlSAXLocator xmlSAXLocator;
53
+ typedef xmlSAXLocator *xmlSAXLocatorPtr;
54
+
55
+ typedef struct _xmlSAXHandler xmlSAXHandler;
56
+ typedef xmlSAXHandler *xmlSAXHandlerPtr;
57
+
58
+ /* entities.h */
59
+ typedef struct _xmlEntity xmlEntity;
60
+ typedef xmlEntity *xmlEntityPtr;
61
+
62
+ /**
63
+ * BASE_BUFFER_SIZE:
64
+ *
65
+ * default buffer size 4000.
66
+ */
67
+ #define BASE_BUFFER_SIZE 4096
68
+
69
+ /**
70
+ * LIBXML_NAMESPACE_DICT:
71
+ *
72
+ * Defines experimental behaviour:
73
+ * 1) xmlNs gets an additional field @context (a xmlDoc)
74
+ * 2) when creating a tree, xmlNs->href is stored in the dict of xmlDoc.
75
+ */
76
+ /* #define LIBXML_NAMESPACE_DICT */
77
+
78
+ /**
79
+ * xmlBufferAllocationScheme:
80
+ *
81
+ * A buffer allocation scheme can be defined to either match exactly the
82
+ * need or double it's allocated size each time it is found too small.
83
+ */
84
+
85
+ typedef enum {
86
+ XML_BUFFER_ALLOC_DOUBLEIT, /* double each time one need to grow */
87
+ XML_BUFFER_ALLOC_EXACT, /* grow only to the minimal size */
88
+ XML_BUFFER_ALLOC_IMMUTABLE, /* immutable buffer, deprecated */
89
+ XML_BUFFER_ALLOC_IO, /* special allocation scheme used for I/O */
90
+ XML_BUFFER_ALLOC_HYBRID, /* exact up to a threshold, and doubleit thereafter */
91
+ XML_BUFFER_ALLOC_BOUNDED /* limit the upper size of the buffer */
92
+ } xmlBufferAllocationScheme;
93
+
94
+ /**
95
+ * xmlBuffer:
96
+ *
97
+ * A buffer structure, this old construct is limited to 2GB and
98
+ * is being deprecated, use API with xmlBuf instead
99
+ */
100
+ typedef struct _xmlBuffer xmlBuffer;
101
+ typedef xmlBuffer *xmlBufferPtr;
102
+ struct _xmlBuffer {
103
+ xmlChar *content; /* The buffer content UTF8 */
104
+ unsigned int use; /* The buffer size used */
105
+ unsigned int size; /* The buffer size */
106
+ xmlBufferAllocationScheme alloc; /* The realloc method */
107
+ xmlChar *contentIO; /* in IO mode we may have a different base */
108
+ };
109
+
110
+ /**
111
+ * xmlBuf:
112
+ *
113
+ * A buffer structure, new one, the actual structure internals are not public
114
+ */
115
+
116
+ typedef struct _xmlBuf xmlBuf;
117
+
118
+ /**
119
+ * xmlBufPtr:
120
+ *
121
+ * A pointer to a buffer structure, the actual structure internals are not
122
+ * public
123
+ */
124
+
125
+ typedef xmlBuf *xmlBufPtr;
126
+
127
+ /*
128
+ * A few public routines for xmlBuf. As those are expected to be used
129
+ * mostly internally the bulk of the routines are internal in buf.h
130
+ */
131
+ XMLPUBFUN xmlChar* xmlBufContent (const xmlBuf* buf);
132
+ XMLPUBFUN xmlChar* xmlBufEnd (xmlBufPtr buf);
133
+ XMLPUBFUN size_t xmlBufUse (const xmlBufPtr buf);
134
+ XMLPUBFUN size_t xmlBufShrink (xmlBufPtr buf, size_t len);
135
+
136
+ /*
137
+ * LIBXML2_NEW_BUFFER:
138
+ *
139
+ * Macro used to express that the API use the new buffers for
140
+ * xmlParserInputBuffer and xmlOutputBuffer. The change was
141
+ * introduced in 2.9.0.
142
+ */
143
+ #define LIBXML2_NEW_BUFFER
144
+
145
+ /**
146
+ * XML_XML_NAMESPACE:
147
+ *
148
+ * This is the namespace for the special xml: prefix predefined in the
149
+ * XML Namespace specification.
150
+ */
151
+ #define XML_XML_NAMESPACE \
152
+ (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
153
+
154
+ /**
155
+ * XML_XML_ID:
156
+ *
157
+ * This is the name for the special xml:id attribute
158
+ */
159
+ #define XML_XML_ID (const xmlChar *) "xml:id"
160
+
161
+ /*
162
+ * The different element types carried by an XML tree.
163
+ *
164
+ * NOTE: This is synchronized with DOM Level1 values
165
+ * See http://www.w3.org/TR/REC-DOM-Level-1/
166
+ *
167
+ * Actually this had diverged a bit, and now XML_DOCUMENT_TYPE_NODE should
168
+ * be deprecated to use an XML_DTD_NODE.
169
+ */
170
+ typedef enum {
171
+ XML_ELEMENT_NODE= 1,
172
+ XML_ATTRIBUTE_NODE= 2,
173
+ XML_TEXT_NODE= 3,
174
+ XML_CDATA_SECTION_NODE= 4,
175
+ XML_ENTITY_REF_NODE= 5,
176
+ XML_ENTITY_NODE= 6,
177
+ XML_PI_NODE= 7,
178
+ XML_COMMENT_NODE= 8,
179
+ XML_DOCUMENT_NODE= 9,
180
+ XML_DOCUMENT_TYPE_NODE= 10,
181
+ XML_DOCUMENT_FRAG_NODE= 11,
182
+ XML_NOTATION_NODE= 12,
183
+ XML_HTML_DOCUMENT_NODE= 13,
184
+ XML_DTD_NODE= 14,
185
+ XML_ELEMENT_DECL= 15,
186
+ XML_ATTRIBUTE_DECL= 16,
187
+ XML_ENTITY_DECL= 17,
188
+ XML_NAMESPACE_DECL= 18,
189
+ XML_XINCLUDE_START= 19,
190
+ XML_XINCLUDE_END= 20
191
+ /* XML_DOCB_DOCUMENT_NODE= 21 */ /* removed */
192
+ } xmlElementType;
193
+
194
+ /** DOC_DISABLE */
195
+ /* For backward compatibility */
196
+ #define XML_DOCB_DOCUMENT_NODE 21
197
+ /** DOC_ENABLE */
198
+
199
+ /**
200
+ * xmlNotation:
201
+ *
202
+ * A DTD Notation definition.
203
+ */
204
+
205
+ typedef struct _xmlNotation xmlNotation;
206
+ typedef xmlNotation *xmlNotationPtr;
207
+ struct _xmlNotation {
208
+ const xmlChar *name; /* Notation name */
209
+ const xmlChar *PublicID; /* Public identifier, if any */
210
+ const xmlChar *SystemID; /* System identifier, if any */
211
+ };
212
+
213
+ /**
214
+ * xmlAttributeType:
215
+ *
216
+ * A DTD Attribute type definition.
217
+ */
218
+
219
+ typedef enum {
220
+ XML_ATTRIBUTE_CDATA = 1,
221
+ XML_ATTRIBUTE_ID,
222
+ XML_ATTRIBUTE_IDREF ,
223
+ XML_ATTRIBUTE_IDREFS,
224
+ XML_ATTRIBUTE_ENTITY,
225
+ XML_ATTRIBUTE_ENTITIES,
226
+ XML_ATTRIBUTE_NMTOKEN,
227
+ XML_ATTRIBUTE_NMTOKENS,
228
+ XML_ATTRIBUTE_ENUMERATION,
229
+ XML_ATTRIBUTE_NOTATION
230
+ } xmlAttributeType;
231
+
232
+ /**
233
+ * xmlAttributeDefault:
234
+ *
235
+ * A DTD Attribute default definition.
236
+ */
237
+
238
+ typedef enum {
239
+ XML_ATTRIBUTE_NONE = 1,
240
+ XML_ATTRIBUTE_REQUIRED,
241
+ XML_ATTRIBUTE_IMPLIED,
242
+ XML_ATTRIBUTE_FIXED
243
+ } xmlAttributeDefault;
244
+
245
+ /**
246
+ * xmlEnumeration:
247
+ *
248
+ * List structure used when there is an enumeration in DTDs.
249
+ */
250
+
251
+ typedef struct _xmlEnumeration xmlEnumeration;
252
+ typedef xmlEnumeration *xmlEnumerationPtr;
253
+ struct _xmlEnumeration {
254
+ struct _xmlEnumeration *next; /* next one */
255
+ const xmlChar *name; /* Enumeration name */
256
+ };
257
+
258
+ /**
259
+ * xmlAttribute:
260
+ *
261
+ * An Attribute declaration in a DTD.
262
+ */
263
+
264
+ typedef struct _xmlAttribute xmlAttribute;
265
+ typedef xmlAttribute *xmlAttributePtr;
266
+ struct _xmlAttribute {
267
+ void *_private; /* application data */
268
+ xmlElementType type; /* XML_ATTRIBUTE_DECL, must be second ! */
269
+ const xmlChar *name; /* Attribute name */
270
+ struct _xmlNode *children; /* NULL */
271
+ struct _xmlNode *last; /* NULL */
272
+ struct _xmlDtd *parent; /* -> DTD */
273
+ struct _xmlNode *next; /* next sibling link */
274
+ struct _xmlNode *prev; /* previous sibling link */
275
+ struct _xmlDoc *doc; /* the containing document */
276
+
277
+ struct _xmlAttribute *nexth; /* next in hash table */
278
+ xmlAttributeType atype; /* The attribute type */
279
+ xmlAttributeDefault def; /* the default */
280
+ const xmlChar *defaultValue; /* or the default value */
281
+ xmlEnumerationPtr tree; /* or the enumeration tree if any */
282
+ const xmlChar *prefix; /* the namespace prefix if any */
283
+ const xmlChar *elem; /* Element holding the attribute */
284
+ };
285
+
286
+ /**
287
+ * xmlElementContentType:
288
+ *
289
+ * Possible definitions of element content types.
290
+ */
291
+ typedef enum {
292
+ XML_ELEMENT_CONTENT_PCDATA = 1,
293
+ XML_ELEMENT_CONTENT_ELEMENT,
294
+ XML_ELEMENT_CONTENT_SEQ,
295
+ XML_ELEMENT_CONTENT_OR
296
+ } xmlElementContentType;
297
+
298
+ /**
299
+ * xmlElementContentOccur:
300
+ *
301
+ * Possible definitions of element content occurrences.
302
+ */
303
+ typedef enum {
304
+ XML_ELEMENT_CONTENT_ONCE = 1,
305
+ XML_ELEMENT_CONTENT_OPT,
306
+ XML_ELEMENT_CONTENT_MULT,
307
+ XML_ELEMENT_CONTENT_PLUS
308
+ } xmlElementContentOccur;
309
+
310
+ /**
311
+ * xmlElementContent:
312
+ *
313
+ * An XML Element content as stored after parsing an element definition
314
+ * in a DTD.
315
+ */
316
+
317
+ typedef struct _xmlElementContent xmlElementContent;
318
+ typedef xmlElementContent *xmlElementContentPtr;
319
+ struct _xmlElementContent {
320
+ xmlElementContentType type; /* PCDATA, ELEMENT, SEQ or OR */
321
+ xmlElementContentOccur ocur; /* ONCE, OPT, MULT or PLUS */
322
+ const xmlChar *name; /* Element name */
323
+ struct _xmlElementContent *c1; /* first child */
324
+ struct _xmlElementContent *c2; /* second child */
325
+ struct _xmlElementContent *parent; /* parent */
326
+ const xmlChar *prefix; /* Namespace prefix */
327
+ };
328
+
329
+ /**
330
+ * xmlElementTypeVal:
331
+ *
332
+ * The different possibilities for an element content type.
333
+ */
334
+
335
+ typedef enum {
336
+ XML_ELEMENT_TYPE_UNDEFINED = 0,
337
+ XML_ELEMENT_TYPE_EMPTY = 1,
338
+ XML_ELEMENT_TYPE_ANY,
339
+ XML_ELEMENT_TYPE_MIXED,
340
+ XML_ELEMENT_TYPE_ELEMENT
341
+ } xmlElementTypeVal;
342
+
343
+ /**
344
+ * xmlElement:
345
+ *
346
+ * An XML Element declaration from a DTD.
347
+ */
348
+
349
+ typedef struct _xmlElement xmlElement;
350
+ typedef xmlElement *xmlElementPtr;
351
+ struct _xmlElement {
352
+ void *_private; /* application data */
353
+ xmlElementType type; /* XML_ELEMENT_DECL, must be second ! */
354
+ const xmlChar *name; /* Element name */
355
+ struct _xmlNode *children; /* NULL */
356
+ struct _xmlNode *last; /* NULL */
357
+ struct _xmlDtd *parent; /* -> DTD */
358
+ struct _xmlNode *next; /* next sibling link */
359
+ struct _xmlNode *prev; /* previous sibling link */
360
+ struct _xmlDoc *doc; /* the containing document */
361
+
362
+ xmlElementTypeVal etype; /* The type */
363
+ xmlElementContentPtr content; /* the allowed element content */
364
+ xmlAttributePtr attributes; /* List of the declared attributes */
365
+ const xmlChar *prefix; /* the namespace prefix if any */
366
+ #ifdef LIBXML_REGEXP_ENABLED
367
+ xmlRegexpPtr contModel; /* the validating regexp */
368
+ #else
369
+ void *contModel;
370
+ #endif
371
+ };
372
+
373
+
374
+ /**
375
+ * XML_LOCAL_NAMESPACE:
376
+ *
377
+ * A namespace declaration node.
378
+ */
379
+ #define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
380
+ typedef xmlElementType xmlNsType;
381
+
382
+ /**
383
+ * xmlNs:
384
+ *
385
+ * An XML namespace.
386
+ * Note that prefix == NULL is valid, it defines the default namespace
387
+ * within the subtree (until overridden).
388
+ *
389
+ * xmlNsType is unified with xmlElementType.
390
+ */
391
+
392
+ typedef struct _xmlNs xmlNs;
393
+ typedef xmlNs *xmlNsPtr;
394
+ struct _xmlNs {
395
+ struct _xmlNs *next; /* next Ns link for this node */
396
+ xmlNsType type; /* global or local */
397
+ const xmlChar *href; /* URL for the namespace */
398
+ const xmlChar *prefix; /* prefix for the namespace */
399
+ void *_private; /* application data */
400
+ struct _xmlDoc *context; /* normally an xmlDoc */
401
+ };
402
+
403
+ /**
404
+ * xmlDtd:
405
+ *
406
+ * An XML DTD, as defined by <!DOCTYPE ... There is actually one for
407
+ * the internal subset and for the external subset.
408
+ */
409
+ typedef struct _xmlDtd xmlDtd;
410
+ typedef xmlDtd *xmlDtdPtr;
411
+ struct _xmlDtd {
412
+ void *_private; /* application data */
413
+ xmlElementType type; /* XML_DTD_NODE, must be second ! */
414
+ const xmlChar *name; /* Name of the DTD */
415
+ struct _xmlNode *children; /* the value of the property link */
416
+ struct _xmlNode *last; /* last child link */
417
+ struct _xmlDoc *parent; /* child->parent link */
418
+ struct _xmlNode *next; /* next sibling link */
419
+ struct _xmlNode *prev; /* previous sibling link */
420
+ struct _xmlDoc *doc; /* the containing document */
421
+
422
+ /* End of common part */
423
+ void *notations; /* Hash table for notations if any */
424
+ void *elements; /* Hash table for elements if any */
425
+ void *attributes; /* Hash table for attributes if any */
426
+ void *entities; /* Hash table for entities if any */
427
+ const xmlChar *ExternalID; /* External identifier for PUBLIC DTD */
428
+ const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC DTD */
429
+ void *pentities; /* Hash table for param entities if any */
430
+ };
431
+
432
+ /**
433
+ * xmlAttr:
434
+ *
435
+ * An attribute on an XML node.
436
+ */
437
+ typedef struct _xmlAttr xmlAttr;
438
+ typedef xmlAttr *xmlAttrPtr;
439
+ struct _xmlAttr {
440
+ void *_private; /* application data */
441
+ xmlElementType type; /* XML_ATTRIBUTE_NODE, must be second ! */
442
+ const xmlChar *name; /* the name of the property */
443
+ struct _xmlNode *children; /* the value of the property */
444
+ struct _xmlNode *last; /* NULL */
445
+ struct _xmlNode *parent; /* child->parent link */
446
+ struct _xmlAttr *next; /* next sibling link */
447
+ struct _xmlAttr *prev; /* previous sibling link */
448
+ struct _xmlDoc *doc; /* the containing document */
449
+ xmlNs *ns; /* pointer to the associated namespace */
450
+ xmlAttributeType atype; /* the attribute type if validating */
451
+ void *psvi; /* for type/PSVI information */
452
+ };
453
+
454
+ /**
455
+ * xmlID:
456
+ *
457
+ * An XML ID instance.
458
+ */
459
+
460
+ typedef struct _xmlID xmlID;
461
+ typedef xmlID *xmlIDPtr;
462
+ struct _xmlID {
463
+ struct _xmlID *next; /* next ID */
464
+ const xmlChar *value; /* The ID name */
465
+ xmlAttrPtr attr; /* The attribute holding it */
466
+ const xmlChar *name; /* The attribute if attr is not available */
467
+ int lineno; /* The line number if attr is not available */
468
+ struct _xmlDoc *doc; /* The document holding the ID */
469
+ };
470
+
471
+ /**
472
+ * xmlRef:
473
+ *
474
+ * An XML IDREF instance.
475
+ */
476
+
477
+ typedef struct _xmlRef xmlRef;
478
+ typedef xmlRef *xmlRefPtr;
479
+ struct _xmlRef {
480
+ struct _xmlRef *next; /* next Ref */
481
+ const xmlChar *value; /* The Ref name */
482
+ xmlAttrPtr attr; /* The attribute holding it */
483
+ const xmlChar *name; /* The attribute if attr is not available */
484
+ int lineno; /* The line number if attr is not available */
485
+ };
486
+
487
+ /**
488
+ * xmlNode:
489
+ *
490
+ * A node in an XML tree.
491
+ */
492
+ typedef struct _xmlNode xmlNode;
493
+ typedef xmlNode *xmlNodePtr;
494
+ struct _xmlNode {
495
+ void *_private; /* application data */
496
+ xmlElementType type; /* type number, must be second ! */
497
+ const xmlChar *name; /* the name of the node, or the entity */
498
+ struct _xmlNode *children; /* parent->childs link */
499
+ struct _xmlNode *last; /* last child link */
500
+ struct _xmlNode *parent; /* child->parent link */
501
+ struct _xmlNode *next; /* next sibling link */
502
+ struct _xmlNode *prev; /* previous sibling link */
503
+ struct _xmlDoc *doc; /* the containing document */
504
+
505
+ /* End of common part */
506
+ xmlNs *ns; /* pointer to the associated namespace */
507
+ xmlChar *content; /* the content */
508
+ struct _xmlAttr *properties;/* properties list */
509
+ xmlNs *nsDef; /* namespace definitions on this node */
510
+ void *psvi; /* for type/PSVI information */
511
+ unsigned short line; /* line number */
512
+ unsigned short extra; /* extra data for XPath/XSLT */
513
+ };
514
+
515
+ /**
516
+ * XML_GET_CONTENT:
517
+ *
518
+ * Macro to extract the content pointer of a node.
519
+ */
520
+ #define XML_GET_CONTENT(n) \
521
+ ((n)->type == XML_ELEMENT_NODE ? NULL : (n)->content)
522
+
523
+ /**
524
+ * XML_GET_LINE:
525
+ *
526
+ * Macro to extract the line number of an element node.
527
+ */
528
+ #define XML_GET_LINE(n) \
529
+ (xmlGetLineNo(n))
530
+
531
+ /**
532
+ * xmlDocProperty
533
+ *
534
+ * Set of properties of the document as found by the parser
535
+ * Some of them are linked to similarly named xmlParserOption
536
+ */
537
+ typedef enum {
538
+ XML_DOC_WELLFORMED = 1<<0, /* document is XML well formed */
539
+ XML_DOC_NSVALID = 1<<1, /* document is Namespace valid */
540
+ XML_DOC_OLD10 = 1<<2, /* parsed with old XML-1.0 parser */
541
+ XML_DOC_DTDVALID = 1<<3, /* DTD validation was successful */
542
+ XML_DOC_XINCLUDE = 1<<4, /* XInclude substitution was done */
543
+ XML_DOC_USERBUILT = 1<<5, /* Document was built using the API
544
+ and not by parsing an instance */
545
+ XML_DOC_INTERNAL = 1<<6, /* built for internal processing */
546
+ XML_DOC_HTML = 1<<7 /* parsed or built HTML document */
547
+ } xmlDocProperties;
548
+
549
+ /**
550
+ * xmlDoc:
551
+ *
552
+ * An XML document.
553
+ */
554
+ typedef struct _xmlDoc xmlDoc;
555
+ typedef xmlDoc *xmlDocPtr;
556
+ struct _xmlDoc {
557
+ void *_private; /* application data */
558
+ xmlElementType type; /* XML_DOCUMENT_NODE, must be second ! */
559
+ char *name; /* name/filename/URI of the document */
560
+ struct _xmlNode *children; /* the document tree */
561
+ struct _xmlNode *last; /* last child link */
562
+ struct _xmlNode *parent; /* child->parent link */
563
+ struct _xmlNode *next; /* next sibling link */
564
+ struct _xmlNode *prev; /* previous sibling link */
565
+ struct _xmlDoc *doc; /* autoreference to itself */
566
+
567
+ /* End of common part */
568
+ int compression;/* level of zlib compression */
569
+ int standalone; /* standalone document (no external refs)
570
+ 1 if standalone="yes"
571
+ 0 if standalone="no"
572
+ -1 if there is no XML declaration
573
+ -2 if there is an XML declaration, but no
574
+ standalone attribute was specified */
575
+ struct _xmlDtd *intSubset; /* the document internal subset */
576
+ struct _xmlDtd *extSubset; /* the document external subset */
577
+ struct _xmlNs *oldNs; /* Global namespace, the old way */
578
+ const xmlChar *version; /* the XML version string */
579
+ const xmlChar *encoding; /* actual encoding, if any */
580
+ void *ids; /* Hash table for ID attributes if any */
581
+ void *refs; /* Hash table for IDREFs attributes if any */
582
+ const xmlChar *URL; /* The URI for that document */
583
+ int charset; /* unused */
584
+ struct _xmlDict *dict; /* dict used to allocate names or NULL */
585
+ void *psvi; /* for type/PSVI information */
586
+ int parseFlags; /* set of xmlParserOption used to parse the
587
+ document */
588
+ int properties; /* set of xmlDocProperties for this document
589
+ set at the end of parsing */
590
+ };
591
+
592
+
593
+ typedef struct _xmlDOMWrapCtxt xmlDOMWrapCtxt;
594
+ typedef xmlDOMWrapCtxt *xmlDOMWrapCtxtPtr;
595
+
596
+ /**
597
+ * xmlDOMWrapAcquireNsFunction:
598
+ * @ctxt: a DOM wrapper context
599
+ * @node: the context node (element or attribute)
600
+ * @nsName: the requested namespace name
601
+ * @nsPrefix: the requested namespace prefix
602
+ *
603
+ * A function called to acquire namespaces (xmlNs) from the wrapper.
604
+ *
605
+ * Returns an xmlNsPtr or NULL in case of an error.
606
+ */
607
+ typedef xmlNsPtr (*xmlDOMWrapAcquireNsFunction) (xmlDOMWrapCtxtPtr ctxt,
608
+ xmlNodePtr node,
609
+ const xmlChar *nsName,
610
+ const xmlChar *nsPrefix);
611
+
612
+ /**
613
+ * xmlDOMWrapCtxt:
614
+ *
615
+ * Context for DOM wrapper-operations.
616
+ */
617
+ struct _xmlDOMWrapCtxt {
618
+ void * _private;
619
+ /*
620
+ * The type of this context, just in case we need specialized
621
+ * contexts in the future.
622
+ */
623
+ int type;
624
+ /*
625
+ * Internal namespace map used for various operations.
626
+ */
627
+ void * namespaceMap;
628
+ /*
629
+ * Use this one to acquire an xmlNsPtr intended for node->ns.
630
+ * (Note that this is not intended for elem->nsDef).
631
+ */
632
+ xmlDOMWrapAcquireNsFunction getNsForNodeFunc;
633
+ };
634
+
635
+ /**
636
+ * xmlRegisterNodeFunc:
637
+ * @node: the current node
638
+ *
639
+ * Signature for the registration callback of a created node
640
+ */
641
+ typedef void (*xmlRegisterNodeFunc) (xmlNodePtr node);
642
+
643
+ /**
644
+ * xmlDeregisterNodeFunc:
645
+ * @node: the current node
646
+ *
647
+ * Signature for the deregistration callback of a discarded node
648
+ */
649
+ typedef void (*xmlDeregisterNodeFunc) (xmlNodePtr node);
650
+
651
+ /**
652
+ * xmlChildrenNode:
653
+ *
654
+ * Macro for compatibility naming layer with libxml1. Maps
655
+ * to "children."
656
+ */
657
+ #ifndef xmlChildrenNode
658
+ #define xmlChildrenNode children
659
+ #endif
660
+
661
+ /**
662
+ * xmlRootNode:
663
+ *
664
+ * Macro for compatibility naming layer with libxml1. Maps
665
+ * to "children".
666
+ */
667
+ #ifndef xmlRootNode
668
+ #define xmlRootNode children
669
+ #endif
670
+
671
+ /*
672
+ * Variables.
673
+ */
674
+
675
+ /** DOC_DISABLE */
676
+ #define XML_GLOBALS_TREE \
677
+ XML_OP(xmlBufferAllocScheme, xmlBufferAllocationScheme, XML_DEPRECATED) \
678
+ XML_OP(xmlDefaultBufferSize, int, XML_DEPRECATED) \
679
+ XML_OP(xmlRegisterNodeDefaultValue, xmlRegisterNodeFunc, XML_DEPRECATED) \
680
+ XML_OP(xmlDeregisterNodeDefaultValue, xmlDeregisterNodeFunc, \
681
+ XML_DEPRECATED)
682
+
683
+ #define XML_OP XML_DECLARE_GLOBAL
684
+ XML_GLOBALS_TREE
685
+ #undef XML_OP
686
+
687
+ #if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION)
688
+ #define xmlBufferAllocScheme XML_GLOBAL_MACRO(xmlBufferAllocScheme)
689
+ #define xmlDefaultBufferSize XML_GLOBAL_MACRO(xmlDefaultBufferSize)
690
+ #define xmlRegisterNodeDefaultValue \
691
+ XML_GLOBAL_MACRO(xmlRegisterNodeDefaultValue)
692
+ #define xmlDeregisterNodeDefaultValue \
693
+ XML_GLOBAL_MACRO(xmlDeregisterNodeDefaultValue)
694
+ #endif
695
+ /** DOC_ENABLE */
696
+
697
+ /*
698
+ * Some helper functions
699
+ */
700
+ XMLPUBFUN int
701
+ xmlValidateNCName (const xmlChar *value,
702
+ int space);
703
+
704
+ #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
705
+ XMLPUBFUN int
706
+ xmlValidateQName (const xmlChar *value,
707
+ int space);
708
+ XMLPUBFUN int
709
+ xmlValidateName (const xmlChar *value,
710
+ int space);
711
+ XMLPUBFUN int
712
+ xmlValidateNMToken (const xmlChar *value,
713
+ int space);
714
+ #endif
715
+
716
+ XMLPUBFUN xmlChar *
717
+ xmlBuildQName (const xmlChar *ncname,
718
+ const xmlChar *prefix,
719
+ xmlChar *memory,
720
+ int len);
721
+ XMLPUBFUN xmlChar *
722
+ xmlSplitQName2 (const xmlChar *name,
723
+ xmlChar **prefix);
724
+ XMLPUBFUN const xmlChar *
725
+ xmlSplitQName3 (const xmlChar *name,
726
+ int *len);
727
+
728
+ /*
729
+ * Handling Buffers, the old ones see @xmlBuf for the new ones.
730
+ */
731
+
732
+ XMLPUBFUN void
733
+ xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme);
734
+ XMLPUBFUN xmlBufferAllocationScheme
735
+ xmlGetBufferAllocationScheme(void);
736
+
737
+ XMLPUBFUN xmlBufferPtr
738
+ xmlBufferCreate (void);
739
+ XMLPUBFUN xmlBufferPtr
740
+ xmlBufferCreateSize (size_t size);
741
+ XMLPUBFUN xmlBufferPtr
742
+ xmlBufferCreateStatic (void *mem,
743
+ size_t size);
744
+ XMLPUBFUN int
745
+ xmlBufferResize (xmlBufferPtr buf,
746
+ unsigned int size);
747
+ XMLPUBFUN void
748
+ xmlBufferFree (xmlBufferPtr buf);
749
+ XMLPUBFUN int
750
+ xmlBufferDump (FILE *file,
751
+ xmlBufferPtr buf);
752
+ XMLPUBFUN int
753
+ xmlBufferAdd (xmlBufferPtr buf,
754
+ const xmlChar *str,
755
+ int len);
756
+ XMLPUBFUN int
757
+ xmlBufferAddHead (xmlBufferPtr buf,
758
+ const xmlChar *str,
759
+ int len);
760
+ XMLPUBFUN int
761
+ xmlBufferCat (xmlBufferPtr buf,
762
+ const xmlChar *str);
763
+ XMLPUBFUN int
764
+ xmlBufferCCat (xmlBufferPtr buf,
765
+ const char *str);
766
+ XMLPUBFUN int
767
+ xmlBufferShrink (xmlBufferPtr buf,
768
+ unsigned int len);
769
+ XMLPUBFUN int
770
+ xmlBufferGrow (xmlBufferPtr buf,
771
+ unsigned int len);
772
+ XMLPUBFUN void
773
+ xmlBufferEmpty (xmlBufferPtr buf);
774
+ XMLPUBFUN const xmlChar*
775
+ xmlBufferContent (const xmlBuffer *buf);
776
+ XMLPUBFUN xmlChar*
777
+ xmlBufferDetach (xmlBufferPtr buf);
778
+ XMLPUBFUN void
779
+ xmlBufferSetAllocationScheme(xmlBufferPtr buf,
780
+ xmlBufferAllocationScheme scheme);
781
+ XMLPUBFUN int
782
+ xmlBufferLength (const xmlBuffer *buf);
783
+
784
+ /*
785
+ * Creating/freeing new structures.
786
+ */
787
+ XMLPUBFUN xmlDtdPtr
788
+ xmlCreateIntSubset (xmlDocPtr doc,
789
+ const xmlChar *name,
790
+ const xmlChar *ExternalID,
791
+ const xmlChar *SystemID);
792
+ XMLPUBFUN xmlDtdPtr
793
+ xmlNewDtd (xmlDocPtr doc,
794
+ const xmlChar *name,
795
+ const xmlChar *ExternalID,
796
+ const xmlChar *SystemID);
797
+ XMLPUBFUN xmlDtdPtr
798
+ xmlGetIntSubset (const xmlDoc *doc);
799
+ XMLPUBFUN void
800
+ xmlFreeDtd (xmlDtdPtr cur);
801
+ #ifdef LIBXML_LEGACY_ENABLED
802
+ XML_DEPRECATED
803
+ XMLPUBFUN xmlNsPtr
804
+ xmlNewGlobalNs (xmlDocPtr doc,
805
+ const xmlChar *href,
806
+ const xmlChar *prefix);
807
+ #endif /* LIBXML_LEGACY_ENABLED */
808
+ XMLPUBFUN xmlNsPtr
809
+ xmlNewNs (xmlNodePtr node,
810
+ const xmlChar *href,
811
+ const xmlChar *prefix);
812
+ XMLPUBFUN void
813
+ xmlFreeNs (xmlNsPtr cur);
814
+ XMLPUBFUN void
815
+ xmlFreeNsList (xmlNsPtr cur);
816
+ XMLPUBFUN xmlDocPtr
817
+ xmlNewDoc (const xmlChar *version);
818
+ XMLPUBFUN void
819
+ xmlFreeDoc (xmlDocPtr cur);
820
+ XMLPUBFUN xmlAttrPtr
821
+ xmlNewDocProp (xmlDocPtr doc,
822
+ const xmlChar *name,
823
+ const xmlChar *value);
824
+ #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
825
+ defined(LIBXML_SCHEMAS_ENABLED)
826
+ XMLPUBFUN xmlAttrPtr
827
+ xmlNewProp (xmlNodePtr node,
828
+ const xmlChar *name,
829
+ const xmlChar *value);
830
+ #endif
831
+ XMLPUBFUN xmlAttrPtr
832
+ xmlNewNsProp (xmlNodePtr node,
833
+ xmlNsPtr ns,
834
+ const xmlChar *name,
835
+ const xmlChar *value);
836
+ XMLPUBFUN xmlAttrPtr
837
+ xmlNewNsPropEatName (xmlNodePtr node,
838
+ xmlNsPtr ns,
839
+ xmlChar *name,
840
+ const xmlChar *value);
841
+ XMLPUBFUN void
842
+ xmlFreePropList (xmlAttrPtr cur);
843
+ XMLPUBFUN void
844
+ xmlFreeProp (xmlAttrPtr cur);
845
+ XMLPUBFUN xmlAttrPtr
846
+ xmlCopyProp (xmlNodePtr target,
847
+ xmlAttrPtr cur);
848
+ XMLPUBFUN xmlAttrPtr
849
+ xmlCopyPropList (xmlNodePtr target,
850
+ xmlAttrPtr cur);
851
+ #ifdef LIBXML_TREE_ENABLED
852
+ XMLPUBFUN xmlDtdPtr
853
+ xmlCopyDtd (xmlDtdPtr dtd);
854
+ #endif /* LIBXML_TREE_ENABLED */
855
+ #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
856
+ XMLPUBFUN xmlDocPtr
857
+ xmlCopyDoc (xmlDocPtr doc,
858
+ int recursive);
859
+ #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */
860
+ /*
861
+ * Creating new nodes.
862
+ */
863
+ XMLPUBFUN xmlNodePtr
864
+ xmlNewDocNode (xmlDocPtr doc,
865
+ xmlNsPtr ns,
866
+ const xmlChar *name,
867
+ const xmlChar *content);
868
+ XMLPUBFUN xmlNodePtr
869
+ xmlNewDocNodeEatName (xmlDocPtr doc,
870
+ xmlNsPtr ns,
871
+ xmlChar *name,
872
+ const xmlChar *content);
873
+ XMLPUBFUN xmlNodePtr
874
+ xmlNewNode (xmlNsPtr ns,
875
+ const xmlChar *name);
876
+ XMLPUBFUN xmlNodePtr
877
+ xmlNewNodeEatName (xmlNsPtr ns,
878
+ xmlChar *name);
879
+ #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
880
+ XMLPUBFUN xmlNodePtr
881
+ xmlNewChild (xmlNodePtr parent,
882
+ xmlNsPtr ns,
883
+ const xmlChar *name,
884
+ const xmlChar *content);
885
+ #endif
886
+ XMLPUBFUN xmlNodePtr
887
+ xmlNewDocText (const xmlDoc *doc,
888
+ const xmlChar *content);
889
+ XMLPUBFUN xmlNodePtr
890
+ xmlNewText (const xmlChar *content);
891
+ XMLPUBFUN xmlNodePtr
892
+ xmlNewDocPI (xmlDocPtr doc,
893
+ const xmlChar *name,
894
+ const xmlChar *content);
895
+ XMLPUBFUN xmlNodePtr
896
+ xmlNewPI (const xmlChar *name,
897
+ const xmlChar *content);
898
+ XMLPUBFUN xmlNodePtr
899
+ xmlNewDocTextLen (xmlDocPtr doc,
900
+ const xmlChar *content,
901
+ int len);
902
+ XMLPUBFUN xmlNodePtr
903
+ xmlNewTextLen (const xmlChar *content,
904
+ int len);
905
+ XMLPUBFUN xmlNodePtr
906
+ xmlNewDocComment (xmlDocPtr doc,
907
+ const xmlChar *content);
908
+ XMLPUBFUN xmlNodePtr
909
+ xmlNewComment (const xmlChar *content);
910
+ XMLPUBFUN xmlNodePtr
911
+ xmlNewCDataBlock (xmlDocPtr doc,
912
+ const xmlChar *content,
913
+ int len);
914
+ XMLPUBFUN xmlNodePtr
915
+ xmlNewCharRef (xmlDocPtr doc,
916
+ const xmlChar *name);
917
+ XMLPUBFUN xmlNodePtr
918
+ xmlNewReference (const xmlDoc *doc,
919
+ const xmlChar *name);
920
+ XMLPUBFUN xmlNodePtr
921
+ xmlCopyNode (xmlNodePtr node,
922
+ int recursive);
923
+ XMLPUBFUN xmlNodePtr
924
+ xmlDocCopyNode (xmlNodePtr node,
925
+ xmlDocPtr doc,
926
+ int recursive);
927
+ XMLPUBFUN xmlNodePtr
928
+ xmlDocCopyNodeList (xmlDocPtr doc,
929
+ xmlNodePtr node);
930
+ XMLPUBFUN xmlNodePtr
931
+ xmlCopyNodeList (xmlNodePtr node);
932
+ #ifdef LIBXML_TREE_ENABLED
933
+ XMLPUBFUN xmlNodePtr
934
+ xmlNewTextChild (xmlNodePtr parent,
935
+ xmlNsPtr ns,
936
+ const xmlChar *name,
937
+ const xmlChar *content);
938
+ XMLPUBFUN xmlNodePtr
939
+ xmlNewDocRawNode (xmlDocPtr doc,
940
+ xmlNsPtr ns,
941
+ const xmlChar *name,
942
+ const xmlChar *content);
943
+ XMLPUBFUN xmlNodePtr
944
+ xmlNewDocFragment (xmlDocPtr doc);
945
+ #endif /* LIBXML_TREE_ENABLED */
946
+
947
+ /*
948
+ * Navigating.
949
+ */
950
+ XMLPUBFUN long
951
+ xmlGetLineNo (const xmlNode *node);
952
+ #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
953
+ XMLPUBFUN xmlChar *
954
+ xmlGetNodePath (const xmlNode *node);
955
+ #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) */
956
+ XMLPUBFUN xmlNodePtr
957
+ xmlDocGetRootElement (const xmlDoc *doc);
958
+ XMLPUBFUN xmlNodePtr
959
+ xmlGetLastChild (const xmlNode *parent);
960
+ XMLPUBFUN int
961
+ xmlNodeIsText (const xmlNode *node);
962
+ XMLPUBFUN int
963
+ xmlIsBlankNode (const xmlNode *node);
964
+
965
+ /*
966
+ * Changing the structure.
967
+ */
968
+ #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
969
+ XMLPUBFUN xmlNodePtr
970
+ xmlDocSetRootElement (xmlDocPtr doc,
971
+ xmlNodePtr root);
972
+ #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */
973
+ #ifdef LIBXML_TREE_ENABLED
974
+ XMLPUBFUN void
975
+ xmlNodeSetName (xmlNodePtr cur,
976
+ const xmlChar *name);
977
+ #endif /* LIBXML_TREE_ENABLED */
978
+ XMLPUBFUN xmlNodePtr
979
+ xmlAddChild (xmlNodePtr parent,
980
+ xmlNodePtr cur);
981
+ XMLPUBFUN xmlNodePtr
982
+ xmlAddChildList (xmlNodePtr parent,
983
+ xmlNodePtr cur);
984
+ #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
985
+ XMLPUBFUN xmlNodePtr
986
+ xmlReplaceNode (xmlNodePtr old,
987
+ xmlNodePtr cur);
988
+ #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */
989
+ #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
990
+ defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
991
+ XMLPUBFUN xmlNodePtr
992
+ xmlAddPrevSibling (xmlNodePtr cur,
993
+ xmlNodePtr elem);
994
+ #endif /* LIBXML_TREE_ENABLED || LIBXML_HTML_ENABLED || LIBXML_SCHEMAS_ENABLED */
995
+ XMLPUBFUN xmlNodePtr
996
+ xmlAddSibling (xmlNodePtr cur,
997
+ xmlNodePtr elem);
998
+ XMLPUBFUN xmlNodePtr
999
+ xmlAddNextSibling (xmlNodePtr cur,
1000
+ xmlNodePtr elem);
1001
+ XMLPUBFUN void
1002
+ xmlUnlinkNode (xmlNodePtr cur);
1003
+ XMLPUBFUN xmlNodePtr
1004
+ xmlTextMerge (xmlNodePtr first,
1005
+ xmlNodePtr second);
1006
+ XMLPUBFUN int
1007
+ xmlTextConcat (xmlNodePtr node,
1008
+ const xmlChar *content,
1009
+ int len);
1010
+ XMLPUBFUN void
1011
+ xmlFreeNodeList (xmlNodePtr cur);
1012
+ XMLPUBFUN void
1013
+ xmlFreeNode (xmlNodePtr cur);
1014
+ XMLPUBFUN void
1015
+ xmlSetTreeDoc (xmlNodePtr tree,
1016
+ xmlDocPtr doc);
1017
+ XMLPUBFUN void
1018
+ xmlSetListDoc (xmlNodePtr list,
1019
+ xmlDocPtr doc);
1020
+ /*
1021
+ * Namespaces.
1022
+ */
1023
+ XMLPUBFUN xmlNsPtr
1024
+ xmlSearchNs (xmlDocPtr doc,
1025
+ xmlNodePtr node,
1026
+ const xmlChar *nameSpace);
1027
+ XMLPUBFUN xmlNsPtr
1028
+ xmlSearchNsByHref (xmlDocPtr doc,
1029
+ xmlNodePtr node,
1030
+ const xmlChar *href);
1031
+ #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || \
1032
+ defined(LIBXML_SCHEMAS_ENABLED)
1033
+ XMLPUBFUN xmlNsPtr *
1034
+ xmlGetNsList (const xmlDoc *doc,
1035
+ const xmlNode *node);
1036
+ #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) */
1037
+
1038
+ XMLPUBFUN void
1039
+ xmlSetNs (xmlNodePtr node,
1040
+ xmlNsPtr ns);
1041
+ XMLPUBFUN xmlNsPtr
1042
+ xmlCopyNamespace (xmlNsPtr cur);
1043
+ XMLPUBFUN xmlNsPtr
1044
+ xmlCopyNamespaceList (xmlNsPtr cur);
1045
+
1046
+ /*
1047
+ * Changing the content.
1048
+ */
1049
+ #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || \
1050
+ defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
1051
+ XMLPUBFUN xmlAttrPtr
1052
+ xmlSetProp (xmlNodePtr node,
1053
+ const xmlChar *name,
1054
+ const xmlChar *value);
1055
+ XMLPUBFUN xmlAttrPtr
1056
+ xmlSetNsProp (xmlNodePtr node,
1057
+ xmlNsPtr ns,
1058
+ const xmlChar *name,
1059
+ const xmlChar *value);
1060
+ #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || \
1061
+ defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) */
1062
+ XMLPUBFUN xmlChar *
1063
+ xmlGetNoNsProp (const xmlNode *node,
1064
+ const xmlChar *name);
1065
+ XMLPUBFUN xmlChar *
1066
+ xmlGetProp (const xmlNode *node,
1067
+ const xmlChar *name);
1068
+ XMLPUBFUN xmlAttrPtr
1069
+ xmlHasProp (const xmlNode *node,
1070
+ const xmlChar *name);
1071
+ XMLPUBFUN xmlAttrPtr
1072
+ xmlHasNsProp (const xmlNode *node,
1073
+ const xmlChar *name,
1074
+ const xmlChar *nameSpace);
1075
+ XMLPUBFUN xmlChar *
1076
+ xmlGetNsProp (const xmlNode *node,
1077
+ const xmlChar *name,
1078
+ const xmlChar *nameSpace);
1079
+ XMLPUBFUN xmlNodePtr
1080
+ xmlStringGetNodeList (const xmlDoc *doc,
1081
+ const xmlChar *value);
1082
+ XMLPUBFUN xmlNodePtr
1083
+ xmlStringLenGetNodeList (const xmlDoc *doc,
1084
+ const xmlChar *value,
1085
+ int len);
1086
+ XMLPUBFUN xmlChar *
1087
+ xmlNodeListGetString (xmlDocPtr doc,
1088
+ const xmlNode *list,
1089
+ int inLine);
1090
+ #ifdef LIBXML_TREE_ENABLED
1091
+ XMLPUBFUN xmlChar *
1092
+ xmlNodeListGetRawString (const xmlDoc *doc,
1093
+ const xmlNode *list,
1094
+ int inLine);
1095
+ #endif /* LIBXML_TREE_ENABLED */
1096
+ XMLPUBFUN void
1097
+ xmlNodeSetContent (xmlNodePtr cur,
1098
+ const xmlChar *content);
1099
+ #ifdef LIBXML_TREE_ENABLED
1100
+ XMLPUBFUN void
1101
+ xmlNodeSetContentLen (xmlNodePtr cur,
1102
+ const xmlChar *content,
1103
+ int len);
1104
+ #endif /* LIBXML_TREE_ENABLED */
1105
+ XMLPUBFUN void
1106
+ xmlNodeAddContent (xmlNodePtr cur,
1107
+ const xmlChar *content);
1108
+ XMLPUBFUN void
1109
+ xmlNodeAddContentLen (xmlNodePtr cur,
1110
+ const xmlChar *content,
1111
+ int len);
1112
+ XMLPUBFUN xmlChar *
1113
+ xmlNodeGetContent (const xmlNode *cur);
1114
+
1115
+ XMLPUBFUN int
1116
+ xmlNodeBufGetContent (xmlBufferPtr buffer,
1117
+ const xmlNode *cur);
1118
+ XMLPUBFUN int
1119
+ xmlBufGetNodeContent (xmlBufPtr buf,
1120
+ const xmlNode *cur);
1121
+
1122
+ XMLPUBFUN xmlChar *
1123
+ xmlNodeGetLang (const xmlNode *cur);
1124
+ XMLPUBFUN int
1125
+ xmlNodeGetSpacePreserve (const xmlNode *cur);
1126
+ #ifdef LIBXML_TREE_ENABLED
1127
+ XMLPUBFUN void
1128
+ xmlNodeSetLang (xmlNodePtr cur,
1129
+ const xmlChar *lang);
1130
+ XMLPUBFUN void
1131
+ xmlNodeSetSpacePreserve (xmlNodePtr cur,
1132
+ int val);
1133
+ #endif /* LIBXML_TREE_ENABLED */
1134
+ XMLPUBFUN xmlChar *
1135
+ xmlNodeGetBase (const xmlDoc *doc,
1136
+ const xmlNode *cur);
1137
+ #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
1138
+ XMLPUBFUN void
1139
+ xmlNodeSetBase (xmlNodePtr cur,
1140
+ const xmlChar *uri);
1141
+ #endif
1142
+
1143
+ /*
1144
+ * Removing content.
1145
+ */
1146
+ XMLPUBFUN int
1147
+ xmlRemoveProp (xmlAttrPtr cur);
1148
+ #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
1149
+ XMLPUBFUN int
1150
+ xmlUnsetNsProp (xmlNodePtr node,
1151
+ xmlNsPtr ns,
1152
+ const xmlChar *name);
1153
+ XMLPUBFUN int
1154
+ xmlUnsetProp (xmlNodePtr node,
1155
+ const xmlChar *name);
1156
+ #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */
1157
+
1158
+ /*
1159
+ * Internal, don't use.
1160
+ */
1161
+ XMLPUBFUN void
1162
+ xmlBufferWriteCHAR (xmlBufferPtr buf,
1163
+ const xmlChar *string);
1164
+ XMLPUBFUN void
1165
+ xmlBufferWriteChar (xmlBufferPtr buf,
1166
+ const char *string);
1167
+ XMLPUBFUN void
1168
+ xmlBufferWriteQuotedString(xmlBufferPtr buf,
1169
+ const xmlChar *string);
1170
+
1171
+ #ifdef LIBXML_OUTPUT_ENABLED
1172
+ XMLPUBFUN void xmlAttrSerializeTxtContent(xmlBufferPtr buf,
1173
+ xmlDocPtr doc,
1174
+ xmlAttrPtr attr,
1175
+ const xmlChar *string);
1176
+ #endif /* LIBXML_OUTPUT_ENABLED */
1177
+
1178
+ #ifdef LIBXML_TREE_ENABLED
1179
+ /*
1180
+ * Namespace handling.
1181
+ */
1182
+ XMLPUBFUN int
1183
+ xmlReconciliateNs (xmlDocPtr doc,
1184
+ xmlNodePtr tree);
1185
+ #endif
1186
+
1187
+ #ifdef LIBXML_OUTPUT_ENABLED
1188
+ /*
1189
+ * Saving.
1190
+ */
1191
+ XMLPUBFUN void
1192
+ xmlDocDumpFormatMemory (xmlDocPtr cur,
1193
+ xmlChar **mem,
1194
+ int *size,
1195
+ int format);
1196
+ XMLPUBFUN void
1197
+ xmlDocDumpMemory (xmlDocPtr cur,
1198
+ xmlChar **mem,
1199
+ int *size);
1200
+ XMLPUBFUN void
1201
+ xmlDocDumpMemoryEnc (xmlDocPtr out_doc,
1202
+ xmlChar **doc_txt_ptr,
1203
+ int * doc_txt_len,
1204
+ const char *txt_encoding);
1205
+ XMLPUBFUN void
1206
+ xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc,
1207
+ xmlChar **doc_txt_ptr,
1208
+ int * doc_txt_len,
1209
+ const char *txt_encoding,
1210
+ int format);
1211
+ XMLPUBFUN int
1212
+ xmlDocFormatDump (FILE *f,
1213
+ xmlDocPtr cur,
1214
+ int format);
1215
+ XMLPUBFUN int
1216
+ xmlDocDump (FILE *f,
1217
+ xmlDocPtr cur);
1218
+ XMLPUBFUN void
1219
+ xmlElemDump (FILE *f,
1220
+ xmlDocPtr doc,
1221
+ xmlNodePtr cur);
1222
+ XMLPUBFUN int
1223
+ xmlSaveFile (const char *filename,
1224
+ xmlDocPtr cur);
1225
+ XMLPUBFUN int
1226
+ xmlSaveFormatFile (const char *filename,
1227
+ xmlDocPtr cur,
1228
+ int format);
1229
+ XMLPUBFUN size_t
1230
+ xmlBufNodeDump (xmlBufPtr buf,
1231
+ xmlDocPtr doc,
1232
+ xmlNodePtr cur,
1233
+ int level,
1234
+ int format);
1235
+ XMLPUBFUN int
1236
+ xmlNodeDump (xmlBufferPtr buf,
1237
+ xmlDocPtr doc,
1238
+ xmlNodePtr cur,
1239
+ int level,
1240
+ int format);
1241
+
1242
+ XMLPUBFUN int
1243
+ xmlSaveFileTo (xmlOutputBufferPtr buf,
1244
+ xmlDocPtr cur,
1245
+ const char *encoding);
1246
+ XMLPUBFUN int
1247
+ xmlSaveFormatFileTo (xmlOutputBufferPtr buf,
1248
+ xmlDocPtr cur,
1249
+ const char *encoding,
1250
+ int format);
1251
+ XMLPUBFUN void
1252
+ xmlNodeDumpOutput (xmlOutputBufferPtr buf,
1253
+ xmlDocPtr doc,
1254
+ xmlNodePtr cur,
1255
+ int level,
1256
+ int format,
1257
+ const char *encoding);
1258
+
1259
+ XMLPUBFUN int
1260
+ xmlSaveFormatFileEnc (const char *filename,
1261
+ xmlDocPtr cur,
1262
+ const char *encoding,
1263
+ int format);
1264
+
1265
+ XMLPUBFUN int
1266
+ xmlSaveFileEnc (const char *filename,
1267
+ xmlDocPtr cur,
1268
+ const char *encoding);
1269
+
1270
+ #endif /* LIBXML_OUTPUT_ENABLED */
1271
+ /*
1272
+ * XHTML
1273
+ */
1274
+ XMLPUBFUN int
1275
+ xmlIsXHTML (const xmlChar *systemID,
1276
+ const xmlChar *publicID);
1277
+
1278
+ /*
1279
+ * Compression.
1280
+ */
1281
+ XMLPUBFUN int
1282
+ xmlGetDocCompressMode (const xmlDoc *doc);
1283
+ XMLPUBFUN void
1284
+ xmlSetDocCompressMode (xmlDocPtr doc,
1285
+ int mode);
1286
+ XMLPUBFUN int
1287
+ xmlGetCompressMode (void);
1288
+ XMLPUBFUN void
1289
+ xmlSetCompressMode (int mode);
1290
+
1291
+ /*
1292
+ * DOM-wrapper helper functions.
1293
+ */
1294
+ XMLPUBFUN xmlDOMWrapCtxtPtr
1295
+ xmlDOMWrapNewCtxt (void);
1296
+ XMLPUBFUN void
1297
+ xmlDOMWrapFreeCtxt (xmlDOMWrapCtxtPtr ctxt);
1298
+ XMLPUBFUN int
1299
+ xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt,
1300
+ xmlNodePtr elem,
1301
+ int options);
1302
+ XMLPUBFUN int
1303
+ xmlDOMWrapAdoptNode (xmlDOMWrapCtxtPtr ctxt,
1304
+ xmlDocPtr sourceDoc,
1305
+ xmlNodePtr node,
1306
+ xmlDocPtr destDoc,
1307
+ xmlNodePtr destParent,
1308
+ int options);
1309
+ XMLPUBFUN int
1310
+ xmlDOMWrapRemoveNode (xmlDOMWrapCtxtPtr ctxt,
1311
+ xmlDocPtr doc,
1312
+ xmlNodePtr node,
1313
+ int options);
1314
+ XMLPUBFUN int
1315
+ xmlDOMWrapCloneNode (xmlDOMWrapCtxtPtr ctxt,
1316
+ xmlDocPtr sourceDoc,
1317
+ xmlNodePtr node,
1318
+ xmlNodePtr *clonedNode,
1319
+ xmlDocPtr destDoc,
1320
+ xmlNodePtr destParent,
1321
+ int deep,
1322
+ int options);
1323
+
1324
+ #ifdef LIBXML_TREE_ENABLED
1325
+ /*
1326
+ * 5 interfaces from DOM ElementTraversal, but different in entities
1327
+ * traversal.
1328
+ */
1329
+ XMLPUBFUN unsigned long
1330
+ xmlChildElementCount (xmlNodePtr parent);
1331
+ XMLPUBFUN xmlNodePtr
1332
+ xmlNextElementSibling (xmlNodePtr node);
1333
+ XMLPUBFUN xmlNodePtr
1334
+ xmlFirstElementChild (xmlNodePtr parent);
1335
+ XMLPUBFUN xmlNodePtr
1336
+ xmlLastElementChild (xmlNodePtr parent);
1337
+ XMLPUBFUN xmlNodePtr
1338
+ xmlPreviousElementSibling (xmlNodePtr node);
1339
+ #endif
1340
+
1341
+ XMLPUBFUN xmlRegisterNodeFunc
1342
+ xmlRegisterNodeDefault (xmlRegisterNodeFunc func);
1343
+ XMLPUBFUN xmlDeregisterNodeFunc
1344
+ xmlDeregisterNodeDefault (xmlDeregisterNodeFunc func);
1345
+ XMLPUBFUN xmlRegisterNodeFunc
1346
+ xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func);
1347
+ XMLPUBFUN xmlDeregisterNodeFunc
1348
+ xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func);
1349
+
1350
+ XML_DEPRECATED XMLPUBFUN xmlBufferAllocationScheme
1351
+ xmlThrDefBufferAllocScheme (xmlBufferAllocationScheme v);
1352
+ XML_DEPRECATED XMLPUBFUN int
1353
+ xmlThrDefDefaultBufferSize (int v);
1354
+
1355
+ #ifdef __cplusplus
1356
+ }
1357
+ #endif
1358
+
1359
+ #endif /* __XML_TREE_H__ */
1360
+
1361
+ #endif /* XML_TREE_INTERNALS */
1362
+