lxml 6.0.0__cp312-cp312-macosx_10_13_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 (174) hide show
  1. lxml/ElementInclude.py +244 -0
  2. lxml/__init__.py +22 -0
  3. lxml/_elementpath.cpython-312-darwin.so +0 -0
  4. lxml/_elementpath.py +343 -0
  5. lxml/apihelpers.pxi +1801 -0
  6. lxml/builder.cpython-312-darwin.so +0 -0
  7. lxml/builder.py +243 -0
  8. lxml/classlookup.pxi +580 -0
  9. lxml/cleanup.pxi +215 -0
  10. lxml/cssselect.py +101 -0
  11. lxml/debug.pxi +36 -0
  12. lxml/docloader.pxi +178 -0
  13. lxml/doctestcompare.py +488 -0
  14. lxml/dtd.pxi +479 -0
  15. lxml/etree.cpython-312-darwin.so +0 -0
  16. lxml/etree.h +244 -0
  17. lxml/etree.pyx +3853 -0
  18. lxml/etree_api.h +204 -0
  19. lxml/extensions.pxi +830 -0
  20. lxml/html/ElementSoup.py +10 -0
  21. lxml/html/__init__.py +1927 -0
  22. lxml/html/_diffcommand.py +86 -0
  23. lxml/html/_difflib.cpython-312-darwin.so +0 -0
  24. lxml/html/_difflib.py +2106 -0
  25. lxml/html/_html5builder.py +100 -0
  26. lxml/html/_setmixin.py +56 -0
  27. lxml/html/builder.py +173 -0
  28. lxml/html/clean.py +21 -0
  29. lxml/html/defs.py +135 -0
  30. lxml/html/diff.cpython-312-darwin.so +0 -0
  31. lxml/html/diff.py +972 -0
  32. lxml/html/formfill.py +299 -0
  33. lxml/html/html5parser.py +260 -0
  34. lxml/html/soupparser.py +314 -0
  35. lxml/html/usedoctest.py +13 -0
  36. lxml/includes/__init__.pxd +0 -0
  37. lxml/includes/__init__.py +0 -0
  38. lxml/includes/c14n.pxd +25 -0
  39. lxml/includes/config.pxd +3 -0
  40. lxml/includes/dtdvalid.pxd +18 -0
  41. lxml/includes/etree_defs.h +379 -0
  42. lxml/includes/etreepublic.pxd +237 -0
  43. lxml/includes/extlibs/__init__.py +0 -0
  44. lxml/includes/extlibs/libcharset.h +45 -0
  45. lxml/includes/extlibs/localcharset.h +137 -0
  46. lxml/includes/extlibs/zconf.h +543 -0
  47. lxml/includes/extlibs/zlib.h +1938 -0
  48. lxml/includes/htmlparser.pxd +56 -0
  49. lxml/includes/libexslt/__init__.py +0 -0
  50. lxml/includes/libexslt/exslt.h +108 -0
  51. lxml/includes/libexslt/exsltconfig.h +70 -0
  52. lxml/includes/libexslt/exsltexports.h +63 -0
  53. lxml/includes/libxml/HTMLparser.h +339 -0
  54. lxml/includes/libxml/HTMLtree.h +148 -0
  55. lxml/includes/libxml/SAX.h +18 -0
  56. lxml/includes/libxml/SAX2.h +170 -0
  57. lxml/includes/libxml/__init__.py +0 -0
  58. lxml/includes/libxml/c14n.h +115 -0
  59. lxml/includes/libxml/catalog.h +183 -0
  60. lxml/includes/libxml/chvalid.h +230 -0
  61. lxml/includes/libxml/debugXML.h +79 -0
  62. lxml/includes/libxml/dict.h +82 -0
  63. lxml/includes/libxml/encoding.h +307 -0
  64. lxml/includes/libxml/entities.h +147 -0
  65. lxml/includes/libxml/globals.h +25 -0
  66. lxml/includes/libxml/hash.h +251 -0
  67. lxml/includes/libxml/list.h +137 -0
  68. lxml/includes/libxml/nanoftp.h +16 -0
  69. lxml/includes/libxml/nanohttp.h +98 -0
  70. lxml/includes/libxml/parser.h +1633 -0
  71. lxml/includes/libxml/parserInternals.h +591 -0
  72. lxml/includes/libxml/relaxng.h +224 -0
  73. lxml/includes/libxml/schemasInternals.h +959 -0
  74. lxml/includes/libxml/schematron.h +143 -0
  75. lxml/includes/libxml/threads.h +81 -0
  76. lxml/includes/libxml/tree.h +1326 -0
  77. lxml/includes/libxml/uri.h +106 -0
  78. lxml/includes/libxml/valid.h +485 -0
  79. lxml/includes/libxml/xinclude.h +141 -0
  80. lxml/includes/libxml/xlink.h +193 -0
  81. lxml/includes/libxml/xmlIO.h +419 -0
  82. lxml/includes/libxml/xmlautomata.h +163 -0
  83. lxml/includes/libxml/xmlerror.h +962 -0
  84. lxml/includes/libxml/xmlexports.h +96 -0
  85. lxml/includes/libxml/xmlmemory.h +188 -0
  86. lxml/includes/libxml/xmlmodule.h +61 -0
  87. lxml/includes/libxml/xmlreader.h +444 -0
  88. lxml/includes/libxml/xmlregexp.h +116 -0
  89. lxml/includes/libxml/xmlsave.h +111 -0
  90. lxml/includes/libxml/xmlschemas.h +254 -0
  91. lxml/includes/libxml/xmlschemastypes.h +152 -0
  92. lxml/includes/libxml/xmlstring.h +140 -0
  93. lxml/includes/libxml/xmlunicode.h +15 -0
  94. lxml/includes/libxml/xmlversion.h +332 -0
  95. lxml/includes/libxml/xmlwriter.h +489 -0
  96. lxml/includes/libxml/xpath.h +569 -0
  97. lxml/includes/libxml/xpathInternals.h +639 -0
  98. lxml/includes/libxml/xpointer.h +48 -0
  99. lxml/includes/libxslt/__init__.py +0 -0
  100. lxml/includes/libxslt/attributes.h +39 -0
  101. lxml/includes/libxslt/documents.h +93 -0
  102. lxml/includes/libxslt/extensions.h +262 -0
  103. lxml/includes/libxslt/extra.h +72 -0
  104. lxml/includes/libxslt/functions.h +78 -0
  105. lxml/includes/libxslt/imports.h +75 -0
  106. lxml/includes/libxslt/keys.h +53 -0
  107. lxml/includes/libxslt/namespaces.h +68 -0
  108. lxml/includes/libxslt/numbersInternals.h +73 -0
  109. lxml/includes/libxslt/pattern.h +84 -0
  110. lxml/includes/libxslt/preproc.h +43 -0
  111. lxml/includes/libxslt/security.h +104 -0
  112. lxml/includes/libxslt/templates.h +77 -0
  113. lxml/includes/libxslt/transform.h +207 -0
  114. lxml/includes/libxslt/variables.h +118 -0
  115. lxml/includes/libxslt/xslt.h +110 -0
  116. lxml/includes/libxslt/xsltInternals.h +1995 -0
  117. lxml/includes/libxslt/xsltconfig.h +146 -0
  118. lxml/includes/libxslt/xsltexports.h +64 -0
  119. lxml/includes/libxslt/xsltlocale.h +44 -0
  120. lxml/includes/libxslt/xsltutils.h +343 -0
  121. lxml/includes/lxml-version.h +3 -0
  122. lxml/includes/relaxng.pxd +64 -0
  123. lxml/includes/schematron.pxd +34 -0
  124. lxml/includes/tree.pxd +492 -0
  125. lxml/includes/uri.pxd +5 -0
  126. lxml/includes/xinclude.pxd +22 -0
  127. lxml/includes/xmlerror.pxd +852 -0
  128. lxml/includes/xmlparser.pxd +303 -0
  129. lxml/includes/xmlschema.pxd +35 -0
  130. lxml/includes/xpath.pxd +136 -0
  131. lxml/includes/xslt.pxd +190 -0
  132. lxml/isoschematron/__init__.py +348 -0
  133. lxml/isoschematron/resources/rng/iso-schematron.rng +709 -0
  134. lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl +75 -0
  135. lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl +77 -0
  136. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl +313 -0
  137. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl +1160 -0
  138. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl +55 -0
  139. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl +1796 -0
  140. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl +588 -0
  141. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt +84 -0
  142. lxml/iterparse.pxi +438 -0
  143. lxml/lxml.etree.h +244 -0
  144. lxml/lxml.etree_api.h +204 -0
  145. lxml/nsclasses.pxi +281 -0
  146. lxml/objectify.cpython-312-darwin.so +0 -0
  147. lxml/objectify.pyx +2149 -0
  148. lxml/objectpath.pxi +332 -0
  149. lxml/parser.pxi +2059 -0
  150. lxml/parsertarget.pxi +180 -0
  151. lxml/proxy.pxi +619 -0
  152. lxml/public-api.pxi +178 -0
  153. lxml/pyclasslookup.py +3 -0
  154. lxml/readonlytree.pxi +565 -0
  155. lxml/relaxng.pxi +165 -0
  156. lxml/sax.cpython-312-darwin.so +0 -0
  157. lxml/sax.py +286 -0
  158. lxml/saxparser.pxi +875 -0
  159. lxml/schematron.pxi +173 -0
  160. lxml/serializer.pxi +1849 -0
  161. lxml/usedoctest.py +13 -0
  162. lxml/xinclude.pxi +67 -0
  163. lxml/xmlerror.pxi +1654 -0
  164. lxml/xmlid.pxi +179 -0
  165. lxml/xmlschema.pxi +215 -0
  166. lxml/xpath.pxi +487 -0
  167. lxml/xslt.pxi +957 -0
  168. lxml/xsltext.pxi +242 -0
  169. lxml-6.0.0.dist-info/METADATA +163 -0
  170. lxml-6.0.0.dist-info/RECORD +174 -0
  171. lxml-6.0.0.dist-info/WHEEL +6 -0
  172. lxml-6.0.0.dist-info/licenses/LICENSE.txt +31 -0
  173. lxml-6.0.0.dist-info/licenses/LICENSES.txt +29 -0
  174. lxml-6.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,639 @@
1
+ /*
2
+ * Summary: internal interfaces for XML Path Language implementation
3
+ * Description: internal interfaces for XML Path Language implementation
4
+ * used to build new modules on top of XPath like XPointer and
5
+ * XSLT
6
+ *
7
+ * Copy: See Copyright for the status of this software.
8
+ *
9
+ * Author: Daniel Veillard
10
+ */
11
+
12
+ #ifndef __XML_XPATH_INTERNALS_H__
13
+ #define __XML_XPATH_INTERNALS_H__
14
+
15
+ #include <stdio.h>
16
+ #include <libxml/xmlversion.h>
17
+ #include <libxml/xpath.h>
18
+
19
+ #ifdef LIBXML_XPATH_ENABLED
20
+
21
+ #ifdef __cplusplus
22
+ extern "C" {
23
+ #endif
24
+
25
+ /*
26
+ * Backward compatibility
27
+ */
28
+ #define valuePush xmlXPathValuePush
29
+ #define valuePop xmlXPathValuePop
30
+
31
+ /************************************************************************
32
+ * *
33
+ * Helpers *
34
+ * *
35
+ ************************************************************************/
36
+
37
+ /*
38
+ * Many of these macros may later turn into functions. They
39
+ * shouldn't be used in #ifdef's preprocessor instructions.
40
+ */
41
+ /**
42
+ * xmlXPathSetError:
43
+ * @ctxt: an XPath parser context
44
+ * @err: an xmlXPathError code
45
+ *
46
+ * Raises an error.
47
+ */
48
+ #define xmlXPathSetError(ctxt, err) \
49
+ { xmlXPatherror((ctxt), __FILE__, __LINE__, (err)); \
50
+ if ((ctxt) != NULL) (ctxt)->error = (err); }
51
+
52
+ /**
53
+ * xmlXPathSetArityError:
54
+ * @ctxt: an XPath parser context
55
+ *
56
+ * Raises an XPATH_INVALID_ARITY error.
57
+ */
58
+ #define xmlXPathSetArityError(ctxt) \
59
+ xmlXPathSetError((ctxt), XPATH_INVALID_ARITY)
60
+
61
+ /**
62
+ * xmlXPathSetTypeError:
63
+ * @ctxt: an XPath parser context
64
+ *
65
+ * Raises an XPATH_INVALID_TYPE error.
66
+ */
67
+ #define xmlXPathSetTypeError(ctxt) \
68
+ xmlXPathSetError((ctxt), XPATH_INVALID_TYPE)
69
+
70
+ /**
71
+ * xmlXPathGetError:
72
+ * @ctxt: an XPath parser context
73
+ *
74
+ * Get the error code of an XPath context.
75
+ *
76
+ * Returns the context error.
77
+ */
78
+ #define xmlXPathGetError(ctxt) ((ctxt)->error)
79
+
80
+ /**
81
+ * xmlXPathCheckError:
82
+ * @ctxt: an XPath parser context
83
+ *
84
+ * Check if an XPath error was raised.
85
+ *
86
+ * Returns true if an error has been raised, false otherwise.
87
+ */
88
+ #define xmlXPathCheckError(ctxt) ((ctxt)->error != XPATH_EXPRESSION_OK)
89
+
90
+ /**
91
+ * xmlXPathGetDocument:
92
+ * @ctxt: an XPath parser context
93
+ *
94
+ * Get the document of an XPath context.
95
+ *
96
+ * Returns the context document.
97
+ */
98
+ #define xmlXPathGetDocument(ctxt) ((ctxt)->context->doc)
99
+
100
+ /**
101
+ * xmlXPathGetContextNode:
102
+ * @ctxt: an XPath parser context
103
+ *
104
+ * Get the context node of an XPath context.
105
+ *
106
+ * Returns the context node.
107
+ */
108
+ #define xmlXPathGetContextNode(ctxt) ((ctxt)->context->node)
109
+
110
+ XMLPUBFUN int
111
+ xmlXPathPopBoolean (xmlXPathParserContextPtr ctxt);
112
+ XMLPUBFUN double
113
+ xmlXPathPopNumber (xmlXPathParserContextPtr ctxt);
114
+ XMLPUBFUN xmlChar *
115
+ xmlXPathPopString (xmlXPathParserContextPtr ctxt);
116
+ XMLPUBFUN xmlNodeSetPtr
117
+ xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt);
118
+ XMLPUBFUN void *
119
+ xmlXPathPopExternal (xmlXPathParserContextPtr ctxt);
120
+
121
+ /**
122
+ * xmlXPathReturnBoolean:
123
+ * @ctxt: an XPath parser context
124
+ * @val: a boolean
125
+ *
126
+ * Pushes the boolean @val on the context stack.
127
+ */
128
+ #define xmlXPathReturnBoolean(ctxt, val) \
129
+ valuePush((ctxt), xmlXPathNewBoolean(val))
130
+
131
+ /**
132
+ * xmlXPathReturnTrue:
133
+ * @ctxt: an XPath parser context
134
+ *
135
+ * Pushes true on the context stack.
136
+ */
137
+ #define xmlXPathReturnTrue(ctxt) xmlXPathReturnBoolean((ctxt), 1)
138
+
139
+ /**
140
+ * xmlXPathReturnFalse:
141
+ * @ctxt: an XPath parser context
142
+ *
143
+ * Pushes false on the context stack.
144
+ */
145
+ #define xmlXPathReturnFalse(ctxt) xmlXPathReturnBoolean((ctxt), 0)
146
+
147
+ /**
148
+ * xmlXPathReturnNumber:
149
+ * @ctxt: an XPath parser context
150
+ * @val: a double
151
+ *
152
+ * Pushes the double @val on the context stack.
153
+ */
154
+ #define xmlXPathReturnNumber(ctxt, val) \
155
+ valuePush((ctxt), xmlXPathNewFloat(val))
156
+
157
+ /**
158
+ * xmlXPathReturnString:
159
+ * @ctxt: an XPath parser context
160
+ * @str: a string
161
+ *
162
+ * Pushes the string @str on the context stack.
163
+ */
164
+ #define xmlXPathReturnString(ctxt, str) \
165
+ valuePush((ctxt), xmlXPathWrapString(str))
166
+
167
+ /**
168
+ * xmlXPathReturnEmptyString:
169
+ * @ctxt: an XPath parser context
170
+ *
171
+ * Pushes an empty string on the stack.
172
+ */
173
+ #define xmlXPathReturnEmptyString(ctxt) \
174
+ valuePush((ctxt), xmlXPathNewCString(""))
175
+
176
+ /**
177
+ * xmlXPathReturnNodeSet:
178
+ * @ctxt: an XPath parser context
179
+ * @ns: a node-set
180
+ *
181
+ * Pushes the node-set @ns on the context stack.
182
+ */
183
+ #define xmlXPathReturnNodeSet(ctxt, ns) \
184
+ valuePush((ctxt), xmlXPathWrapNodeSet(ns))
185
+
186
+ /**
187
+ * xmlXPathReturnEmptyNodeSet:
188
+ * @ctxt: an XPath parser context
189
+ *
190
+ * Pushes an empty node-set on the context stack.
191
+ */
192
+ #define xmlXPathReturnEmptyNodeSet(ctxt) \
193
+ valuePush((ctxt), xmlXPathNewNodeSet(NULL))
194
+
195
+ /**
196
+ * xmlXPathReturnExternal:
197
+ * @ctxt: an XPath parser context
198
+ * @val: user data
199
+ *
200
+ * Pushes user data on the context stack.
201
+ */
202
+ #define xmlXPathReturnExternal(ctxt, val) \
203
+ valuePush((ctxt), xmlXPathWrapExternal(val))
204
+
205
+ /**
206
+ * xmlXPathStackIsNodeSet:
207
+ * @ctxt: an XPath parser context
208
+ *
209
+ * Check if the current value on the XPath stack is a node set or
210
+ * an XSLT value tree.
211
+ *
212
+ * Returns true if the current object on the stack is a node-set.
213
+ */
214
+ #define xmlXPathStackIsNodeSet(ctxt) \
215
+ (((ctxt)->value != NULL) \
216
+ && (((ctxt)->value->type == XPATH_NODESET) \
217
+ || ((ctxt)->value->type == XPATH_XSLT_TREE)))
218
+
219
+ /**
220
+ * xmlXPathStackIsExternal:
221
+ * @ctxt: an XPath parser context
222
+ *
223
+ * Checks if the current value on the XPath stack is an external
224
+ * object.
225
+ *
226
+ * Returns true if the current object on the stack is an external
227
+ * object.
228
+ */
229
+ #define xmlXPathStackIsExternal(ctxt) \
230
+ ((ctxt->value != NULL) && (ctxt->value->type == XPATH_USERS))
231
+
232
+ /**
233
+ * xmlXPathEmptyNodeSet:
234
+ * @ns: a node-set
235
+ *
236
+ * Empties a node-set.
237
+ */
238
+ #define xmlXPathEmptyNodeSet(ns) \
239
+ { while ((ns)->nodeNr > 0) (ns)->nodeTab[--(ns)->nodeNr] = NULL; }
240
+
241
+ /**
242
+ * CHECK_ERROR:
243
+ *
244
+ * Macro to return from the function if an XPath error was detected.
245
+ */
246
+ #define CHECK_ERROR \
247
+ if (ctxt->error != XPATH_EXPRESSION_OK) return
248
+
249
+ /**
250
+ * CHECK_ERROR0:
251
+ *
252
+ * Macro to return 0 from the function if an XPath error was detected.
253
+ */
254
+ #define CHECK_ERROR0 \
255
+ if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
256
+
257
+ /**
258
+ * XP_ERROR:
259
+ * @X: the error code
260
+ *
261
+ * Macro to raise an XPath error and return.
262
+ */
263
+ #define XP_ERROR(X) \
264
+ { xmlXPathErr(ctxt, X); return; }
265
+
266
+ /**
267
+ * XP_ERROR0:
268
+ * @X: the error code
269
+ *
270
+ * Macro to raise an XPath error and return 0.
271
+ */
272
+ #define XP_ERROR0(X) \
273
+ { xmlXPathErr(ctxt, X); return(0); }
274
+
275
+ /**
276
+ * CHECK_TYPE:
277
+ * @typeval: the XPath type
278
+ *
279
+ * Macro to check that the value on top of the XPath stack is of a given
280
+ * type.
281
+ */
282
+ #define CHECK_TYPE(typeval) \
283
+ if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \
284
+ XP_ERROR(XPATH_INVALID_TYPE)
285
+
286
+ /**
287
+ * CHECK_TYPE0:
288
+ * @typeval: the XPath type
289
+ *
290
+ * Macro to check that the value on top of the XPath stack is of a given
291
+ * type. Return(0) in case of failure
292
+ */
293
+ #define CHECK_TYPE0(typeval) \
294
+ if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \
295
+ XP_ERROR0(XPATH_INVALID_TYPE)
296
+
297
+ /**
298
+ * CHECK_ARITY:
299
+ * @x: the number of expected args
300
+ *
301
+ * Macro to check that the number of args passed to an XPath function matches.
302
+ */
303
+ #define CHECK_ARITY(x) \
304
+ if (ctxt == NULL) return; \
305
+ if (nargs != (x)) \
306
+ XP_ERROR(XPATH_INVALID_ARITY); \
307
+ if (ctxt->valueNr < (x)) \
308
+ XP_ERROR(XPATH_STACK_ERROR);
309
+
310
+ /**
311
+ * CAST_TO_STRING:
312
+ *
313
+ * Macro to try to cast the value on the top of the XPath stack to a string.
314
+ */
315
+ #define CAST_TO_STRING \
316
+ if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING)) \
317
+ xmlXPathStringFunction(ctxt, 1);
318
+
319
+ /**
320
+ * CAST_TO_NUMBER:
321
+ *
322
+ * Macro to try to cast the value on the top of the XPath stack to a number.
323
+ */
324
+ #define CAST_TO_NUMBER \
325
+ if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER)) \
326
+ xmlXPathNumberFunction(ctxt, 1);
327
+
328
+ /**
329
+ * CAST_TO_BOOLEAN:
330
+ *
331
+ * Macro to try to cast the value on the top of the XPath stack to a boolean.
332
+ */
333
+ #define CAST_TO_BOOLEAN \
334
+ if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_BOOLEAN)) \
335
+ xmlXPathBooleanFunction(ctxt, 1);
336
+
337
+ /*
338
+ * Variable Lookup forwarding.
339
+ */
340
+
341
+ XMLPUBFUN void
342
+ xmlXPathRegisterVariableLookup (xmlXPathContextPtr ctxt,
343
+ xmlXPathVariableLookupFunc f,
344
+ void *data);
345
+
346
+ /*
347
+ * Function Lookup forwarding.
348
+ */
349
+
350
+ XMLPUBFUN void
351
+ xmlXPathRegisterFuncLookup (xmlXPathContextPtr ctxt,
352
+ xmlXPathFuncLookupFunc f,
353
+ void *funcCtxt);
354
+
355
+ /*
356
+ * Error reporting.
357
+ */
358
+ XMLPUBFUN void
359
+ xmlXPatherror (xmlXPathParserContextPtr ctxt,
360
+ const char *file,
361
+ int line,
362
+ int no);
363
+
364
+ XMLPUBFUN void
365
+ xmlXPathErr (xmlXPathParserContextPtr ctxt,
366
+ int error);
367
+
368
+ #ifdef LIBXML_DEBUG_ENABLED
369
+ XMLPUBFUN void
370
+ xmlXPathDebugDumpObject (FILE *output,
371
+ xmlXPathObjectPtr cur,
372
+ int depth);
373
+ XMLPUBFUN void
374
+ xmlXPathDebugDumpCompExpr(FILE *output,
375
+ xmlXPathCompExprPtr comp,
376
+ int depth);
377
+ #endif
378
+ /**
379
+ * NodeSet handling.
380
+ */
381
+ XMLPUBFUN int
382
+ xmlXPathNodeSetContains (xmlNodeSetPtr cur,
383
+ xmlNodePtr val);
384
+ XMLPUBFUN xmlNodeSetPtr
385
+ xmlXPathDifference (xmlNodeSetPtr nodes1,
386
+ xmlNodeSetPtr nodes2);
387
+ XMLPUBFUN xmlNodeSetPtr
388
+ xmlXPathIntersection (xmlNodeSetPtr nodes1,
389
+ xmlNodeSetPtr nodes2);
390
+
391
+ XMLPUBFUN xmlNodeSetPtr
392
+ xmlXPathDistinctSorted (xmlNodeSetPtr nodes);
393
+ XMLPUBFUN xmlNodeSetPtr
394
+ xmlXPathDistinct (xmlNodeSetPtr nodes);
395
+
396
+ XMLPUBFUN int
397
+ xmlXPathHasSameNodes (xmlNodeSetPtr nodes1,
398
+ xmlNodeSetPtr nodes2);
399
+
400
+ XMLPUBFUN xmlNodeSetPtr
401
+ xmlXPathNodeLeadingSorted (xmlNodeSetPtr nodes,
402
+ xmlNodePtr node);
403
+ XMLPUBFUN xmlNodeSetPtr
404
+ xmlXPathLeadingSorted (xmlNodeSetPtr nodes1,
405
+ xmlNodeSetPtr nodes2);
406
+ XMLPUBFUN xmlNodeSetPtr
407
+ xmlXPathNodeLeading (xmlNodeSetPtr nodes,
408
+ xmlNodePtr node);
409
+ XMLPUBFUN xmlNodeSetPtr
410
+ xmlXPathLeading (xmlNodeSetPtr nodes1,
411
+ xmlNodeSetPtr nodes2);
412
+
413
+ XMLPUBFUN xmlNodeSetPtr
414
+ xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes,
415
+ xmlNodePtr node);
416
+ XMLPUBFUN xmlNodeSetPtr
417
+ xmlXPathTrailingSorted (xmlNodeSetPtr nodes1,
418
+ xmlNodeSetPtr nodes2);
419
+ XMLPUBFUN xmlNodeSetPtr
420
+ xmlXPathNodeTrailing (xmlNodeSetPtr nodes,
421
+ xmlNodePtr node);
422
+ XMLPUBFUN xmlNodeSetPtr
423
+ xmlXPathTrailing (xmlNodeSetPtr nodes1,
424
+ xmlNodeSetPtr nodes2);
425
+
426
+
427
+ /**
428
+ * Extending a context.
429
+ */
430
+
431
+ XMLPUBFUN int
432
+ xmlXPathRegisterNs (xmlXPathContextPtr ctxt,
433
+ const xmlChar *prefix,
434
+ const xmlChar *ns_uri);
435
+ XMLPUBFUN const xmlChar *
436
+ xmlXPathNsLookup (xmlXPathContextPtr ctxt,
437
+ const xmlChar *prefix);
438
+ XMLPUBFUN void
439
+ xmlXPathRegisteredNsCleanup (xmlXPathContextPtr ctxt);
440
+
441
+ XMLPUBFUN int
442
+ xmlXPathRegisterFunc (xmlXPathContextPtr ctxt,
443
+ const xmlChar *name,
444
+ xmlXPathFunction f);
445
+ XMLPUBFUN int
446
+ xmlXPathRegisterFuncNS (xmlXPathContextPtr ctxt,
447
+ const xmlChar *name,
448
+ const xmlChar *ns_uri,
449
+ xmlXPathFunction f);
450
+ XMLPUBFUN int
451
+ xmlXPathRegisterVariable (xmlXPathContextPtr ctxt,
452
+ const xmlChar *name,
453
+ xmlXPathObjectPtr value);
454
+ XMLPUBFUN int
455
+ xmlXPathRegisterVariableNS (xmlXPathContextPtr ctxt,
456
+ const xmlChar *name,
457
+ const xmlChar *ns_uri,
458
+ xmlXPathObjectPtr value);
459
+ XMLPUBFUN xmlXPathFunction
460
+ xmlXPathFunctionLookup (xmlXPathContextPtr ctxt,
461
+ const xmlChar *name);
462
+ XMLPUBFUN xmlXPathFunction
463
+ xmlXPathFunctionLookupNS (xmlXPathContextPtr ctxt,
464
+ const xmlChar *name,
465
+ const xmlChar *ns_uri);
466
+ XMLPUBFUN void
467
+ xmlXPathRegisteredFuncsCleanup (xmlXPathContextPtr ctxt);
468
+ XMLPUBFUN xmlXPathObjectPtr
469
+ xmlXPathVariableLookup (xmlXPathContextPtr ctxt,
470
+ const xmlChar *name);
471
+ XMLPUBFUN xmlXPathObjectPtr
472
+ xmlXPathVariableLookupNS (xmlXPathContextPtr ctxt,
473
+ const xmlChar *name,
474
+ const xmlChar *ns_uri);
475
+ XMLPUBFUN void
476
+ xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt);
477
+
478
+ /**
479
+ * Utilities to extend XPath.
480
+ */
481
+ XMLPUBFUN xmlXPathParserContextPtr
482
+ xmlXPathNewParserContext (const xmlChar *str,
483
+ xmlXPathContextPtr ctxt);
484
+ XMLPUBFUN void
485
+ xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt);
486
+
487
+ XMLPUBFUN xmlXPathObjectPtr
488
+ xmlXPathValuePop (xmlXPathParserContextPtr ctxt);
489
+ XMLPUBFUN int
490
+ xmlXPathValuePush (xmlXPathParserContextPtr ctxt,
491
+ xmlXPathObjectPtr value);
492
+
493
+ XMLPUBFUN xmlXPathObjectPtr
494
+ xmlXPathNewString (const xmlChar *val);
495
+ XMLPUBFUN xmlXPathObjectPtr
496
+ xmlXPathNewCString (const char *val);
497
+ XMLPUBFUN xmlXPathObjectPtr
498
+ xmlXPathWrapString (xmlChar *val);
499
+ XMLPUBFUN xmlXPathObjectPtr
500
+ xmlXPathWrapCString (char * val);
501
+ XMLPUBFUN xmlXPathObjectPtr
502
+ xmlXPathNewFloat (double val);
503
+ XMLPUBFUN xmlXPathObjectPtr
504
+ xmlXPathNewBoolean (int val);
505
+ XMLPUBFUN xmlXPathObjectPtr
506
+ xmlXPathNewNodeSet (xmlNodePtr val);
507
+ XMLPUBFUN xmlXPathObjectPtr
508
+ xmlXPathNewValueTree (xmlNodePtr val);
509
+ XMLPUBFUN int
510
+ xmlXPathNodeSetAdd (xmlNodeSetPtr cur,
511
+ xmlNodePtr val);
512
+ XMLPUBFUN int
513
+ xmlXPathNodeSetAddUnique (xmlNodeSetPtr cur,
514
+ xmlNodePtr val);
515
+ XMLPUBFUN int
516
+ xmlXPathNodeSetAddNs (xmlNodeSetPtr cur,
517
+ xmlNodePtr node,
518
+ xmlNsPtr ns);
519
+ XMLPUBFUN void
520
+ xmlXPathNodeSetSort (xmlNodeSetPtr set);
521
+
522
+ XMLPUBFUN void
523
+ xmlXPathRoot (xmlXPathParserContextPtr ctxt);
524
+ XML_DEPRECATED
525
+ XMLPUBFUN void
526
+ xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt);
527
+ XMLPUBFUN xmlChar *
528
+ xmlXPathParseName (xmlXPathParserContextPtr ctxt);
529
+ XMLPUBFUN xmlChar *
530
+ xmlXPathParseNCName (xmlXPathParserContextPtr ctxt);
531
+
532
+ /*
533
+ * Existing functions.
534
+ */
535
+ XMLPUBFUN double
536
+ xmlXPathStringEvalNumber (const xmlChar *str);
537
+ XMLPUBFUN int
538
+ xmlXPathEvaluatePredicateResult (xmlXPathParserContextPtr ctxt,
539
+ xmlXPathObjectPtr res);
540
+ XMLPUBFUN void
541
+ xmlXPathRegisterAllFunctions (xmlXPathContextPtr ctxt);
542
+ XMLPUBFUN xmlNodeSetPtr
543
+ xmlXPathNodeSetMerge (xmlNodeSetPtr val1,
544
+ xmlNodeSetPtr val2);
545
+ XMLPUBFUN void
546
+ xmlXPathNodeSetDel (xmlNodeSetPtr cur,
547
+ xmlNodePtr val);
548
+ XMLPUBFUN void
549
+ xmlXPathNodeSetRemove (xmlNodeSetPtr cur,
550
+ int val);
551
+ XMLPUBFUN xmlXPathObjectPtr
552
+ xmlXPathNewNodeSetList (xmlNodeSetPtr val);
553
+ XMLPUBFUN xmlXPathObjectPtr
554
+ xmlXPathWrapNodeSet (xmlNodeSetPtr val);
555
+ XMLPUBFUN xmlXPathObjectPtr
556
+ xmlXPathWrapExternal (void *val);
557
+
558
+ XMLPUBFUN int xmlXPathEqualValues(xmlXPathParserContextPtr ctxt);
559
+ XMLPUBFUN int xmlXPathNotEqualValues(xmlXPathParserContextPtr ctxt);
560
+ XMLPUBFUN int xmlXPathCompareValues(xmlXPathParserContextPtr ctxt, int inf, int strict);
561
+ XMLPUBFUN void xmlXPathValueFlipSign(xmlXPathParserContextPtr ctxt);
562
+ XMLPUBFUN void xmlXPathAddValues(xmlXPathParserContextPtr ctxt);
563
+ XMLPUBFUN void xmlXPathSubValues(xmlXPathParserContextPtr ctxt);
564
+ XMLPUBFUN void xmlXPathMultValues(xmlXPathParserContextPtr ctxt);
565
+ XMLPUBFUN void xmlXPathDivValues(xmlXPathParserContextPtr ctxt);
566
+ XMLPUBFUN void xmlXPathModValues(xmlXPathParserContextPtr ctxt);
567
+
568
+ XMLPUBFUN int xmlXPathIsNodeType(const xmlChar *name);
569
+
570
+ /*
571
+ * Some of the axis navigation routines.
572
+ */
573
+ XMLPUBFUN xmlNodePtr xmlXPathNextSelf(xmlXPathParserContextPtr ctxt,
574
+ xmlNodePtr cur);
575
+ XMLPUBFUN xmlNodePtr xmlXPathNextChild(xmlXPathParserContextPtr ctxt,
576
+ xmlNodePtr cur);
577
+ XMLPUBFUN xmlNodePtr xmlXPathNextDescendant(xmlXPathParserContextPtr ctxt,
578
+ xmlNodePtr cur);
579
+ XMLPUBFUN xmlNodePtr xmlXPathNextDescendantOrSelf(xmlXPathParserContextPtr ctxt,
580
+ xmlNodePtr cur);
581
+ XMLPUBFUN xmlNodePtr xmlXPathNextParent(xmlXPathParserContextPtr ctxt,
582
+ xmlNodePtr cur);
583
+ XMLPUBFUN xmlNodePtr xmlXPathNextAncestorOrSelf(xmlXPathParserContextPtr ctxt,
584
+ xmlNodePtr cur);
585
+ XMLPUBFUN xmlNodePtr xmlXPathNextFollowingSibling(xmlXPathParserContextPtr ctxt,
586
+ xmlNodePtr cur);
587
+ XMLPUBFUN xmlNodePtr xmlXPathNextFollowing(xmlXPathParserContextPtr ctxt,
588
+ xmlNodePtr cur);
589
+ XMLPUBFUN xmlNodePtr xmlXPathNextNamespace(xmlXPathParserContextPtr ctxt,
590
+ xmlNodePtr cur);
591
+ XMLPUBFUN xmlNodePtr xmlXPathNextAttribute(xmlXPathParserContextPtr ctxt,
592
+ xmlNodePtr cur);
593
+ XMLPUBFUN xmlNodePtr xmlXPathNextPreceding(xmlXPathParserContextPtr ctxt,
594
+ xmlNodePtr cur);
595
+ XMLPUBFUN xmlNodePtr xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt,
596
+ xmlNodePtr cur);
597
+ XMLPUBFUN xmlNodePtr xmlXPathNextPrecedingSibling(xmlXPathParserContextPtr ctxt,
598
+ xmlNodePtr cur);
599
+ /*
600
+ * The official core of XPath functions.
601
+ */
602
+ XMLPUBFUN void xmlXPathLastFunction(xmlXPathParserContextPtr ctxt, int nargs);
603
+ XMLPUBFUN void xmlXPathPositionFunction(xmlXPathParserContextPtr ctxt, int nargs);
604
+ XMLPUBFUN void xmlXPathCountFunction(xmlXPathParserContextPtr ctxt, int nargs);
605
+ XMLPUBFUN void xmlXPathIdFunction(xmlXPathParserContextPtr ctxt, int nargs);
606
+ XMLPUBFUN void xmlXPathLocalNameFunction(xmlXPathParserContextPtr ctxt, int nargs);
607
+ XMLPUBFUN void xmlXPathNamespaceURIFunction(xmlXPathParserContextPtr ctxt, int nargs);
608
+ XMLPUBFUN void xmlXPathStringFunction(xmlXPathParserContextPtr ctxt, int nargs);
609
+ XMLPUBFUN void xmlXPathStringLengthFunction(xmlXPathParserContextPtr ctxt, int nargs);
610
+ XMLPUBFUN void xmlXPathConcatFunction(xmlXPathParserContextPtr ctxt, int nargs);
611
+ XMLPUBFUN void xmlXPathContainsFunction(xmlXPathParserContextPtr ctxt, int nargs);
612
+ XMLPUBFUN void xmlXPathStartsWithFunction(xmlXPathParserContextPtr ctxt, int nargs);
613
+ XMLPUBFUN void xmlXPathSubstringFunction(xmlXPathParserContextPtr ctxt, int nargs);
614
+ XMLPUBFUN void xmlXPathSubstringBeforeFunction(xmlXPathParserContextPtr ctxt, int nargs);
615
+ XMLPUBFUN void xmlXPathSubstringAfterFunction(xmlXPathParserContextPtr ctxt, int nargs);
616
+ XMLPUBFUN void xmlXPathNormalizeFunction(xmlXPathParserContextPtr ctxt, int nargs);
617
+ XMLPUBFUN void xmlXPathTranslateFunction(xmlXPathParserContextPtr ctxt, int nargs);
618
+ XMLPUBFUN void xmlXPathNotFunction(xmlXPathParserContextPtr ctxt, int nargs);
619
+ XMLPUBFUN void xmlXPathTrueFunction(xmlXPathParserContextPtr ctxt, int nargs);
620
+ XMLPUBFUN void xmlXPathFalseFunction(xmlXPathParserContextPtr ctxt, int nargs);
621
+ XMLPUBFUN void xmlXPathLangFunction(xmlXPathParserContextPtr ctxt, int nargs);
622
+ XMLPUBFUN void xmlXPathNumberFunction(xmlXPathParserContextPtr ctxt, int nargs);
623
+ XMLPUBFUN void xmlXPathSumFunction(xmlXPathParserContextPtr ctxt, int nargs);
624
+ XMLPUBFUN void xmlXPathFloorFunction(xmlXPathParserContextPtr ctxt, int nargs);
625
+ XMLPUBFUN void xmlXPathCeilingFunction(xmlXPathParserContextPtr ctxt, int nargs);
626
+ XMLPUBFUN void xmlXPathRoundFunction(xmlXPathParserContextPtr ctxt, int nargs);
627
+ XMLPUBFUN void xmlXPathBooleanFunction(xmlXPathParserContextPtr ctxt, int nargs);
628
+
629
+ /**
630
+ * Really internal functions
631
+ */
632
+ XMLPUBFUN void xmlXPathNodeSetFreeNs(xmlNsPtr ns);
633
+
634
+ #ifdef __cplusplus
635
+ }
636
+ #endif
637
+
638
+ #endif /* LIBXML_XPATH_ENABLED */
639
+ #endif /* ! __XML_XPATH_INTERNALS_H__ */
@@ -0,0 +1,48 @@
1
+ /*
2
+ * Summary: API to handle XML Pointers
3
+ * Description: API to handle XML Pointers
4
+ * Base implementation was made accordingly to
5
+ * W3C Candidate Recommendation 7 June 2000
6
+ * http://www.w3.org/TR/2000/CR-xptr-20000607
7
+ *
8
+ * Added support for the element() scheme described in:
9
+ * W3C Proposed Recommendation 13 November 2002
10
+ * http://www.w3.org/TR/2002/PR-xptr-element-20021113/
11
+ *
12
+ * Copy: See Copyright for the status of this software.
13
+ *
14
+ * Author: Daniel Veillard
15
+ */
16
+
17
+ #ifndef __XML_XPTR_H__
18
+ #define __XML_XPTR_H__
19
+
20
+ #include <libxml/xmlversion.h>
21
+
22
+ #ifdef LIBXML_XPTR_ENABLED
23
+
24
+ #include <libxml/tree.h>
25
+ #include <libxml/xpath.h>
26
+
27
+ #ifdef __cplusplus
28
+ extern "C" {
29
+ #endif
30
+
31
+ /*
32
+ * Functions.
33
+ */
34
+ XML_DEPRECATED
35
+ XMLPUBFUN xmlXPathContextPtr
36
+ xmlXPtrNewContext (xmlDocPtr doc,
37
+ xmlNodePtr here,
38
+ xmlNodePtr origin);
39
+ XMLPUBFUN xmlXPathObjectPtr
40
+ xmlXPtrEval (const xmlChar *str,
41
+ xmlXPathContextPtr ctx);
42
+
43
+ #ifdef __cplusplus
44
+ }
45
+ #endif
46
+
47
+ #endif /* LIBXML_XPTR_ENABLED */
48
+ #endif /* __XML_XPTR_H__ */
File without changes