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