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 | * *
|
---|
27 | * Helpers *
|
---|
28 | * *
|
---|
29 | ************************************************************************/
|
---|
30 |
|
---|
31 | /*
|
---|
32 | * Many of these macros may later turn into functions. They
|
---|
33 | * shouldn't be used in #ifdef's preprocessor instructions.
|
---|
34 | */
|
---|
35 | /**
|
---|
36 | * xmlXPathSetError:
|
---|
37 | * @ctxt: an XPath parser context
|
---|
38 | * @err: an xmlXPathError code
|
---|
39 | *
|
---|
40 | * Raises an error.
|
---|
41 | */
|
---|
42 | #define xmlXPathSetError(ctxt, err) \
|
---|
43 | { xmlXPatherror((ctxt), __FILE__, __LINE__, (err)); \
|
---|
44 | if ((ctxt) != NULL) (ctxt)->error = (err); }
|
---|
45 |
|
---|
46 | /**
|
---|
47 | * xmlXPathSetArityError:
|
---|
48 | * @ctxt: an XPath parser context
|
---|
49 | *
|
---|
50 | * Raises an XPATH_INVALID_ARITY error.
|
---|
51 | */
|
---|
52 | #define xmlXPathSetArityError(ctxt) \
|
---|
53 | xmlXPathSetError((ctxt), XPATH_INVALID_ARITY)
|
---|
54 |
|
---|
55 | /**
|
---|
56 | * xmlXPathSetTypeError:
|
---|
57 | * @ctxt: an XPath parser context
|
---|
58 | *
|
---|
59 | * Raises an XPATH_INVALID_TYPE error.
|
---|
60 | */
|
---|
61 | #define xmlXPathSetTypeError(ctxt) \
|
---|
62 | xmlXPathSetError((ctxt), XPATH_INVALID_TYPE)
|
---|
63 |
|
---|
64 | /**
|
---|
65 | * xmlXPathGetError:
|
---|
66 | * @ctxt: an XPath parser context
|
---|
67 | *
|
---|
68 | * Get the error code of an XPath context.
|
---|
69 | *
|
---|
70 | * Returns the context error.
|
---|
71 | */
|
---|
72 | #define xmlXPathGetError(ctxt) ((ctxt)->error)
|
---|
73 |
|
---|
74 | /**
|
---|
75 | * xmlXPathCheckError:
|
---|
76 | * @ctxt: an XPath parser context
|
---|
77 | *
|
---|
78 | * Check if an XPath error was raised.
|
---|
79 | *
|
---|
80 | * Returns true if an error has been raised, false otherwise.
|
---|
81 | */
|
---|
82 | #define xmlXPathCheckError(ctxt) ((ctxt)->error != XPATH_EXPRESSION_OK)
|
---|
83 |
|
---|
84 | /**
|
---|
85 | * xmlXPathGetDocument:
|
---|
86 | * @ctxt: an XPath parser context
|
---|
87 | *
|
---|
88 | * Get the document of an XPath context.
|
---|
89 | *
|
---|
90 | * Returns the context document.
|
---|
91 | */
|
---|
92 | #define xmlXPathGetDocument(ctxt) ((ctxt)->context->doc)
|
---|
93 |
|
---|
94 | /**
|
---|
95 | * xmlXPathGetContextNode:
|
---|
96 | * @ctxt: an XPath parser context
|
---|
97 | *
|
---|
98 | * Get the context node of an XPath context.
|
---|
99 | *
|
---|
100 | * Returns the context node.
|
---|
101 | */
|
---|
102 | #define xmlXPathGetContextNode(ctxt) ((ctxt)->context->node)
|
---|
103 |
|
---|
104 | XMLPUBFUN int
|
---|
105 | xmlXPathPopBoolean (xmlXPathParserContextPtr ctxt);
|
---|
106 | XMLPUBFUN double
|
---|
107 | xmlXPathPopNumber (xmlXPathParserContextPtr ctxt);
|
---|
108 | XMLPUBFUN xmlChar *
|
---|
109 | xmlXPathPopString (xmlXPathParserContextPtr ctxt);
|
---|
110 | XMLPUBFUN xmlNodeSetPtr
|
---|
111 | xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt);
|
---|
112 | XMLPUBFUN void *
|
---|
113 | xmlXPathPopExternal (xmlXPathParserContextPtr ctxt);
|
---|
114 |
|
---|
115 | /**
|
---|
116 | * xmlXPathReturnBoolean:
|
---|
117 | * @ctxt: an XPath parser context
|
---|
118 | * @val: a boolean
|
---|
119 | *
|
---|
120 | * Pushes the boolean @val on the context stack.
|
---|
121 | */
|
---|
122 | #define xmlXPathReturnBoolean(ctxt, val) \
|
---|
123 | valuePush((ctxt), xmlXPathNewBoolean(val))
|
---|
124 |
|
---|
125 | /**
|
---|
126 | * xmlXPathReturnTrue:
|
---|
127 | * @ctxt: an XPath parser context
|
---|
128 | *
|
---|
129 | * Pushes true on the context stack.
|
---|
130 | */
|
---|
131 | #define xmlXPathReturnTrue(ctxt) xmlXPathReturnBoolean((ctxt), 1)
|
---|
132 |
|
---|
133 | /**
|
---|
134 | * xmlXPathReturnFalse:
|
---|
135 | * @ctxt: an XPath parser context
|
---|
136 | *
|
---|
137 | * Pushes false on the context stack.
|
---|
138 | */
|
---|
139 | #define xmlXPathReturnFalse(ctxt) xmlXPathReturnBoolean((ctxt), 0)
|
---|
140 |
|
---|
141 | /**
|
---|
142 | * xmlXPathReturnNumber:
|
---|
143 | * @ctxt: an XPath parser context
|
---|
144 | * @val: a double
|
---|
145 | *
|
---|
146 | * Pushes the double @val on the context stack.
|
---|
147 | */
|
---|
148 | #define xmlXPathReturnNumber(ctxt, val) \
|
---|
149 | valuePush((ctxt), xmlXPathNewFloat(val))
|
---|
150 |
|
---|
151 | /**
|
---|
152 | * xmlXPathReturnString:
|
---|
153 | * @ctxt: an XPath parser context
|
---|
154 | * @str: a string
|
---|
155 | *
|
---|
156 | * Pushes the string @str on the context stack.
|
---|
157 | */
|
---|
158 | #define xmlXPathReturnString(ctxt, str) \
|
---|
159 | valuePush((ctxt), xmlXPathWrapString(str))
|
---|
160 |
|
---|
161 | /**
|
---|
162 | * xmlXPathReturnEmptyString:
|
---|
163 | * @ctxt: an XPath parser context
|
---|
164 | *
|
---|
165 | * Pushes an empty string on the stack.
|
---|
166 | */
|
---|
167 | #define xmlXPathReturnEmptyString(ctxt) \
|
---|
168 | valuePush((ctxt), xmlXPathNewCString(""))
|
---|
169 |
|
---|
170 | /**
|
---|
171 | * xmlXPathReturnNodeSet:
|
---|
172 | * @ctxt: an XPath parser context
|
---|
173 | * @ns: a node-set
|
---|
174 | *
|
---|
175 | * Pushes the node-set @ns on the context stack.
|
---|
176 | */
|
---|
177 | #define xmlXPathReturnNodeSet(ctxt, ns) \
|
---|
178 | valuePush((ctxt), xmlXPathWrapNodeSet(ns))
|
---|
179 |
|
---|
180 | /**
|
---|
181 | * xmlXPathReturnEmptyNodeSet:
|
---|
182 | * @ctxt: an XPath parser context
|
---|
183 | *
|
---|
184 | * Pushes an empty node-set on the context stack.
|
---|
185 | */
|
---|
186 | #define xmlXPathReturnEmptyNodeSet(ctxt) \
|
---|
187 | valuePush((ctxt), xmlXPathNewNodeSet(NULL))
|
---|
188 |
|
---|
189 | /**
|
---|
190 | * xmlXPathReturnExternal:
|
---|
191 | * @ctxt: an XPath parser context
|
---|
192 | * @val: user data
|
---|
193 | *
|
---|
194 | * Pushes user data on the context stack.
|
---|
195 | */
|
---|
196 | #define xmlXPathReturnExternal(ctxt, val) \
|
---|
197 | valuePush((ctxt), xmlXPathWrapExternal(val))
|
---|
198 |
|
---|
199 | /**
|
---|
200 | * xmlXPathStackIsNodeSet:
|
---|
201 | * @ctxt: an XPath parser context
|
---|
202 | *
|
---|
203 | * Check if the current value on the XPath stack is a node set or
|
---|
204 | * an XSLT value tree.
|
---|
205 | *
|
---|
206 | * Returns true if the current object on the stack is a node-set.
|
---|
207 | */
|
---|
208 | #define xmlXPathStackIsNodeSet(ctxt) \
|
---|
209 | (((ctxt)->value != NULL) \
|
---|
210 | && (((ctxt)->value->type == XPATH_NODESET) \
|
---|
211 | || ((ctxt)->value->type == XPATH_XSLT_TREE)))
|
---|
212 |
|
---|
213 | /**
|
---|
214 | * xmlXPathStackIsExternal:
|
---|
215 | * @ctxt: an XPath parser context
|
---|
216 | *
|
---|
217 | * Checks if the current value on the XPath stack is an external
|
---|
218 | * object.
|
---|
219 | *
|
---|
220 | * Returns true if the current object on the stack is an external
|
---|
221 | * object.
|
---|
222 | */
|
---|
223 | #define xmlXPathStackIsExternal(ctxt) \
|
---|
224 | ((ctxt->value != NULL) && (ctxt->value->type == XPATH_USERS))
|
---|
225 |
|
---|
226 | /**
|
---|
227 | * xmlXPathEmptyNodeSet:
|
---|
228 | * @ns: a node-set
|
---|
229 | *
|
---|
230 | * Empties a node-set.
|
---|
231 | */
|
---|
232 | #define xmlXPathEmptyNodeSet(ns) \
|
---|
233 | { while ((ns)->nodeNr > 0) (ns)->nodeTab[--(ns)->nodeNr] = NULL; }
|
---|
234 |
|
---|
235 | /**
|
---|
236 | * CHECK_ERROR:
|
---|
237 | *
|
---|
238 | * Macro to return from the function if an XPath error was detected.
|
---|
239 | */
|
---|
240 | #define CHECK_ERROR \
|
---|
241 | if (ctxt->error != XPATH_EXPRESSION_OK) return
|
---|
242 |
|
---|
243 | /**
|
---|
244 | * CHECK_ERROR0:
|
---|
245 | *
|
---|
246 | * Macro to return 0 from the function if an XPath error was detected.
|
---|
247 | */
|
---|
248 | #define CHECK_ERROR0 \
|
---|
249 | if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
|
---|
250 |
|
---|
251 | /**
|
---|
252 | * XP_ERROR:
|
---|
253 | * @X: the error code
|
---|
254 | *
|
---|
255 | * Macro to raise an XPath error and return.
|
---|
256 | */
|
---|
257 | #define XP_ERROR(X) \
|
---|
258 | { xmlXPathErr(ctxt, X); return; }
|
---|
259 |
|
---|
260 | /**
|
---|
261 | * XP_ERROR0:
|
---|
262 | * @X: the error code
|
---|
263 | *
|
---|
264 | * Macro to raise an XPath error and return 0.
|
---|
265 | */
|
---|
266 | #define XP_ERROR0(X) \
|
---|
267 | { xmlXPathErr(ctxt, X); return(0); }
|
---|
268 |
|
---|
269 | /**
|
---|
270 | * CHECK_TYPE:
|
---|
271 | * @typeval: the XPath type
|
---|
272 | *
|
---|
273 | * Macro to check that the value on top of the XPath stack is of a given
|
---|
274 | * type.
|
---|
275 | */
|
---|
276 | #define CHECK_TYPE(typeval) \
|
---|
277 | if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \
|
---|
278 | XP_ERROR(XPATH_INVALID_TYPE)
|
---|
279 |
|
---|
280 | /**
|
---|
281 | * CHECK_TYPE0:
|
---|
282 | * @typeval: the XPath type
|
---|
283 | *
|
---|
284 | * Macro to check that the value on top of the XPath stack is of a given
|
---|
285 | * type. Return(0) in case of failure
|
---|
286 | */
|
---|
287 | #define CHECK_TYPE0(typeval) \
|
---|
288 | if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \
|
---|
289 | XP_ERROR0(XPATH_INVALID_TYPE)
|
---|
290 |
|
---|
291 | /**
|
---|
292 | * CHECK_ARITY:
|
---|
293 | * @x: the number of expected args
|
---|
294 | *
|
---|
295 | * Macro to check that the number of args passed to an XPath function matches.
|
---|
296 | */
|
---|
297 | #define CHECK_ARITY(x) \
|
---|
298 | if (ctxt == NULL) return; \
|
---|
299 | if (nargs != (x)) \
|
---|
300 | XP_ERROR(XPATH_INVALID_ARITY); \
|
---|
301 | if (ctxt->valueNr < (x)) \
|
---|
302 | XP_ERROR(XPATH_STACK_ERROR);
|
---|
303 |
|
---|
304 | /**
|
---|
305 | * CAST_TO_STRING:
|
---|
306 | *
|
---|
307 | * Macro to try to cast the value on the top of the XPath stack to a string.
|
---|
308 | */
|
---|
309 | #define CAST_TO_STRING \
|
---|
310 | if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING)) \
|
---|
311 | xmlXPathStringFunction(ctxt, 1);
|
---|
312 |
|
---|
313 | /**
|
---|
314 | * CAST_TO_NUMBER:
|
---|
315 | *
|
---|
316 | * Macro to try to cast the value on the top of the XPath stack to a number.
|
---|
317 | */
|
---|
318 | #define CAST_TO_NUMBER \
|
---|
319 | if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER)) \
|
---|
320 | xmlXPathNumberFunction(ctxt, 1);
|
---|
321 |
|
---|
322 | /**
|
---|
323 | * CAST_TO_BOOLEAN:
|
---|
324 | *
|
---|
325 | * Macro to try to cast the value on the top of the XPath stack to a boolean.
|
---|
326 | */
|
---|
327 | #define CAST_TO_BOOLEAN \
|
---|
328 | if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_BOOLEAN)) \
|
---|
329 | xmlXPathBooleanFunction(ctxt, 1);
|
---|
330 |
|
---|
331 | /*
|
---|
332 | * Variable Lookup forwarding.
|
---|
333 | */
|
---|
334 |
|
---|
335 | XMLPUBFUN void
|
---|
336 | xmlXPathRegisterVariableLookup (xmlXPathContextPtr ctxt,
|
---|
337 | xmlXPathVariableLookupFunc f,
|
---|
338 | void *data);
|
---|
339 |
|
---|
340 | /*
|
---|
341 | * Function Lookup forwarding.
|
---|
342 | */
|
---|
343 |
|
---|
344 | XMLPUBFUN void
|
---|
345 | xmlXPathRegisterFuncLookup (xmlXPathContextPtr ctxt,
|
---|
346 | xmlXPathFuncLookupFunc f,
|
---|
347 | void *funcCtxt);
|
---|
348 |
|
---|
349 | /*
|
---|
350 | * Error reporting.
|
---|
351 | */
|
---|
352 | XMLPUBFUN void
|
---|
353 | xmlXPatherror (xmlXPathParserContextPtr ctxt,
|
---|
354 | const char *file,
|
---|
355 | int line,
|
---|
356 | int no);
|
---|
357 |
|
---|
358 | XMLPUBFUN void
|
---|
359 | xmlXPathErr (xmlXPathParserContextPtr ctxt,
|
---|
360 | int error);
|
---|
361 |
|
---|
362 | #ifdef LIBXML_DEBUG_ENABLED
|
---|
363 | XMLPUBFUN void
|
---|
364 | xmlXPathDebugDumpObject (FILE *output,
|
---|
365 | xmlXPathObjectPtr cur,
|
---|
366 | int depth);
|
---|
367 | XMLPUBFUN void
|
---|
368 | xmlXPathDebugDumpCompExpr(FILE *output,
|
---|
369 | xmlXPathCompExprPtr comp,
|
---|
370 | int depth);
|
---|
371 | #endif
|
---|
372 | /**
|
---|
373 | * NodeSet handling.
|
---|
374 | */
|
---|
375 | XMLPUBFUN int
|
---|
376 | xmlXPathNodeSetContains (xmlNodeSetPtr cur,
|
---|
377 | xmlNodePtr val);
|
---|
378 | XMLPUBFUN xmlNodeSetPtr
|
---|
379 | xmlXPathDifference (xmlNodeSetPtr nodes1,
|
---|
380 | xmlNodeSetPtr nodes2);
|
---|
381 | XMLPUBFUN xmlNodeSetPtr
|
---|
382 | xmlXPathIntersection (xmlNodeSetPtr nodes1,
|
---|
383 | xmlNodeSetPtr nodes2);
|
---|
384 |
|
---|
385 | XMLPUBFUN xmlNodeSetPtr
|
---|
386 | xmlXPathDistinctSorted (xmlNodeSetPtr nodes);
|
---|
387 | XMLPUBFUN xmlNodeSetPtr
|
---|
388 | xmlXPathDistinct (xmlNodeSetPtr nodes);
|
---|
389 |
|
---|
390 | XMLPUBFUN int
|
---|
391 | xmlXPathHasSameNodes (xmlNodeSetPtr nodes1,
|
---|
392 | xmlNodeSetPtr nodes2);
|
---|
393 |
|
---|
394 | XMLPUBFUN xmlNodeSetPtr
|
---|
395 | xmlXPathNodeLeadingSorted (xmlNodeSetPtr nodes,
|
---|
396 | xmlNodePtr node);
|
---|
397 | XMLPUBFUN xmlNodeSetPtr
|
---|
398 | xmlXPathLeadingSorted (xmlNodeSetPtr nodes1,
|
---|
399 | xmlNodeSetPtr nodes2);
|
---|
400 | XMLPUBFUN xmlNodeSetPtr
|
---|
401 | xmlXPathNodeLeading (xmlNodeSetPtr nodes,
|
---|
402 | xmlNodePtr node);
|
---|
403 | XMLPUBFUN xmlNodeSetPtr
|
---|
404 | xmlXPathLeading (xmlNodeSetPtr nodes1,
|
---|
405 | xmlNodeSetPtr nodes2);
|
---|
406 |
|
---|
407 | XMLPUBFUN xmlNodeSetPtr
|
---|
408 | xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes,
|
---|
409 | xmlNodePtr node);
|
---|
410 | XMLPUBFUN xmlNodeSetPtr
|
---|
411 | xmlXPathTrailingSorted (xmlNodeSetPtr nodes1,
|
---|
412 | xmlNodeSetPtr nodes2);
|
---|
413 | XMLPUBFUN xmlNodeSetPtr
|
---|
414 | xmlXPathNodeTrailing (xmlNodeSetPtr nodes,
|
---|
415 | xmlNodePtr node);
|
---|
416 | XMLPUBFUN xmlNodeSetPtr
|
---|
417 | xmlXPathTrailing (xmlNodeSetPtr nodes1,
|
---|
418 | xmlNodeSetPtr nodes2);
|
---|
419 |
|
---|
420 |
|
---|
421 | /**
|
---|
422 | * Extending a context.
|
---|
423 | */
|
---|
424 |
|
---|
425 | XMLPUBFUN int
|
---|
426 | xmlXPathRegisterNs (xmlXPathContextPtr ctxt,
|
---|
427 | const xmlChar *prefix,
|
---|
428 | const xmlChar *ns_uri);
|
---|
429 | XMLPUBFUN const xmlChar *
|
---|
430 | xmlXPathNsLookup (xmlXPathContextPtr ctxt,
|
---|
431 | const xmlChar *prefix);
|
---|
432 | XMLPUBFUN void
|
---|
433 | xmlXPathRegisteredNsCleanup (xmlXPathContextPtr ctxt);
|
---|
434 |
|
---|
435 | XMLPUBFUN int
|
---|
436 | xmlXPathRegisterFunc (xmlXPathContextPtr ctxt,
|
---|
437 | const xmlChar *name,
|
---|
438 | xmlXPathFunction f);
|
---|
439 | XMLPUBFUN int
|
---|
440 | xmlXPathRegisterFuncNS (xmlXPathContextPtr ctxt,
|
---|
441 | const xmlChar *name,
|
---|
442 | const xmlChar *ns_uri,
|
---|
443 | xmlXPathFunction f);
|
---|
444 | XMLPUBFUN int
|
---|
445 | xmlXPathRegisterVariable (xmlXPathContextPtr ctxt,
|
---|
446 | const xmlChar *name,
|
---|
447 | xmlXPathObjectPtr value);
|
---|
448 | XMLPUBFUN int
|
---|
449 | xmlXPathRegisterVariableNS (xmlXPathContextPtr ctxt,
|
---|
450 | const xmlChar *name,
|
---|
451 | const xmlChar *ns_uri,
|
---|
452 | xmlXPathObjectPtr value);
|
---|
453 | XMLPUBFUN xmlXPathFunction
|
---|
454 | xmlXPathFunctionLookup (xmlXPathContextPtr ctxt,
|
---|
455 | const xmlChar *name);
|
---|
456 | XMLPUBFUN xmlXPathFunction
|
---|
457 | xmlXPathFunctionLookupNS (xmlXPathContextPtr ctxt,
|
---|
458 | const xmlChar *name,
|
---|
459 | const xmlChar *ns_uri);
|
---|
460 | XMLPUBFUN void
|
---|
461 | xmlXPathRegisteredFuncsCleanup (xmlXPathContextPtr ctxt);
|
---|
462 | XMLPUBFUN xmlXPathObjectPtr
|
---|
463 | xmlXPathVariableLookup (xmlXPathContextPtr ctxt,
|
---|
464 | const xmlChar *name);
|
---|
465 | XMLPUBFUN xmlXPathObjectPtr
|
---|
466 | xmlXPathVariableLookupNS (xmlXPathContextPtr ctxt,
|
---|
467 | const xmlChar *name,
|
---|
468 | const xmlChar *ns_uri);
|
---|
469 | XMLPUBFUN void
|
---|
470 | xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt);
|
---|
471 |
|
---|
472 | /**
|
---|
473 | * Utilities to extend XPath.
|
---|
474 | */
|
---|
475 | XMLPUBFUN xmlXPathParserContextPtr
|
---|
476 | xmlXPathNewParserContext (const xmlChar *str,
|
---|
477 | xmlXPathContextPtr ctxt);
|
---|
478 | XMLPUBFUN void
|
---|
479 | xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt);
|
---|
480 |
|
---|
481 | /* TODO: remap to xmlXPathValuePop and Push. */
|
---|
482 | XMLPUBFUN xmlXPathObjectPtr
|
---|
483 | valuePop (xmlXPathParserContextPtr ctxt);
|
---|
484 | XMLPUBFUN int
|
---|
485 | valuePush (xmlXPathParserContextPtr ctxt,
|
---|
486 | xmlXPathObjectPtr value);
|
---|
487 |
|
---|
488 | XMLPUBFUN xmlXPathObjectPtr
|
---|
489 | xmlXPathNewString (const xmlChar *val);
|
---|
490 | XMLPUBFUN xmlXPathObjectPtr
|
---|
491 | xmlXPathNewCString (const char *val);
|
---|
492 | XMLPUBFUN xmlXPathObjectPtr
|
---|
493 | xmlXPathWrapString (xmlChar *val);
|
---|
494 | XMLPUBFUN xmlXPathObjectPtr
|
---|
495 | xmlXPathWrapCString (char * val);
|
---|
496 | XMLPUBFUN xmlXPathObjectPtr
|
---|
497 | xmlXPathNewFloat (double val);
|
---|
498 | XMLPUBFUN xmlXPathObjectPtr
|
---|
499 | xmlXPathNewBoolean (int val);
|
---|
500 | XMLPUBFUN xmlXPathObjectPtr
|
---|
501 | xmlXPathNewNodeSet (xmlNodePtr val);
|
---|
502 | XMLPUBFUN xmlXPathObjectPtr
|
---|
503 | xmlXPathNewValueTree (xmlNodePtr val);
|
---|
504 | XMLPUBFUN int
|
---|
505 | xmlXPathNodeSetAdd (xmlNodeSetPtr cur,
|
---|
506 | xmlNodePtr val);
|
---|
507 | XMLPUBFUN int
|
---|
508 | xmlXPathNodeSetAddUnique (xmlNodeSetPtr cur,
|
---|
509 | xmlNodePtr val);
|
---|
510 | XMLPUBFUN int
|
---|
511 | xmlXPathNodeSetAddNs (xmlNodeSetPtr cur,
|
---|
512 | xmlNodePtr node,
|
---|
513 | xmlNsPtr ns);
|
---|
514 | XMLPUBFUN void
|
---|
515 | xmlXPathNodeSetSort (xmlNodeSetPtr set);
|
---|
516 |
|
---|
517 | XMLPUBFUN void
|
---|
518 | xmlXPathRoot (xmlXPathParserContextPtr ctxt);
|
---|
519 | XMLPUBFUN void
|
---|
520 | xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt);
|
---|
521 | XMLPUBFUN xmlChar *
|
---|
522 | xmlXPathParseName (xmlXPathParserContextPtr ctxt);
|
---|
523 | XMLPUBFUN xmlChar *
|
---|
524 | xmlXPathParseNCName (xmlXPathParserContextPtr ctxt);
|
---|
525 |
|
---|
526 | /*
|
---|
527 | * Existing functions.
|
---|
528 | */
|
---|
529 | XMLPUBFUN double
|
---|
530 | xmlXPathStringEvalNumber (const xmlChar *str);
|
---|
531 | XMLPUBFUN int
|
---|
532 | xmlXPathEvaluatePredicateResult (xmlXPathParserContextPtr ctxt,
|
---|
533 | xmlXPathObjectPtr res);
|
---|
534 | XMLPUBFUN void
|
---|
535 | xmlXPathRegisterAllFunctions (xmlXPathContextPtr ctxt);
|
---|
536 | XMLPUBFUN xmlNodeSetPtr
|
---|
537 | xmlXPathNodeSetMerge (xmlNodeSetPtr val1,
|
---|
538 | xmlNodeSetPtr val2);
|
---|
539 | XMLPUBFUN void
|
---|
540 | xmlXPathNodeSetDel (xmlNodeSetPtr cur,
|
---|
541 | xmlNodePtr val);
|
---|
542 | XMLPUBFUN void
|
---|
543 | xmlXPathNodeSetRemove (xmlNodeSetPtr cur,
|
---|
544 | int val);
|
---|
545 | XMLPUBFUN xmlXPathObjectPtr
|
---|
546 | xmlXPathNewNodeSetList (xmlNodeSetPtr val);
|
---|
547 | XMLPUBFUN xmlXPathObjectPtr
|
---|
548 | xmlXPathWrapNodeSet (xmlNodeSetPtr val);
|
---|
549 | XMLPUBFUN xmlXPathObjectPtr
|
---|
550 | xmlXPathWrapExternal (void *val);
|
---|
551 |
|
---|
552 | XMLPUBFUN int xmlXPathEqualValues(xmlXPathParserContextPtr ctxt);
|
---|
553 | XMLPUBFUN int xmlXPathNotEqualValues(xmlXPathParserContextPtr ctxt);
|
---|
554 | XMLPUBFUN int xmlXPathCompareValues(xmlXPathParserContextPtr ctxt, int inf, int strict);
|
---|
555 | XMLPUBFUN void xmlXPathValueFlipSign(xmlXPathParserContextPtr ctxt);
|
---|
556 | XMLPUBFUN void xmlXPathAddValues(xmlXPathParserContextPtr ctxt);
|
---|
557 | XMLPUBFUN void xmlXPathSubValues(xmlXPathParserContextPtr ctxt);
|
---|
558 | XMLPUBFUN void xmlXPathMultValues(xmlXPathParserContextPtr ctxt);
|
---|
559 | XMLPUBFUN void xmlXPathDivValues(xmlXPathParserContextPtr ctxt);
|
---|
560 | XMLPUBFUN void xmlXPathModValues(xmlXPathParserContextPtr ctxt);
|
---|
561 |
|
---|
562 | XMLPUBFUN int xmlXPathIsNodeType(const xmlChar *name);
|
---|
563 |
|
---|
564 | /*
|
---|
565 | * Some of the axis navigation routines.
|
---|
566 | */
|
---|
567 | XMLPUBFUN xmlNodePtr xmlXPathNextSelf(xmlXPathParserContextPtr ctxt,
|
---|
568 | xmlNodePtr cur);
|
---|
569 | XMLPUBFUN xmlNodePtr xmlXPathNextChild(xmlXPathParserContextPtr ctxt,
|
---|
570 | xmlNodePtr cur);
|
---|
571 | XMLPUBFUN xmlNodePtr xmlXPathNextDescendant(xmlXPathParserContextPtr ctxt,
|
---|
572 | xmlNodePtr cur);
|
---|
573 | XMLPUBFUN xmlNodePtr xmlXPathNextDescendantOrSelf(xmlXPathParserContextPtr ctxt,
|
---|
574 | xmlNodePtr cur);
|
---|
575 | XMLPUBFUN xmlNodePtr xmlXPathNextParent(xmlXPathParserContextPtr ctxt,
|
---|
576 | xmlNodePtr cur);
|
---|
577 | XMLPUBFUN xmlNodePtr xmlXPathNextAncestorOrSelf(xmlXPathParserContextPtr ctxt,
|
---|
578 | xmlNodePtr cur);
|
---|
579 | XMLPUBFUN xmlNodePtr xmlXPathNextFollowingSibling(xmlXPathParserContextPtr ctxt,
|
---|
580 | xmlNodePtr cur);
|
---|
581 | XMLPUBFUN xmlNodePtr xmlXPathNextFollowing(xmlXPathParserContextPtr ctxt,
|
---|
582 | xmlNodePtr cur);
|
---|
583 | XMLPUBFUN xmlNodePtr xmlXPathNextNamespace(xmlXPathParserContextPtr ctxt,
|
---|
584 | xmlNodePtr cur);
|
---|
585 | XMLPUBFUN xmlNodePtr xmlXPathNextAttribute(xmlXPathParserContextPtr ctxt,
|
---|
586 | xmlNodePtr cur);
|
---|
587 | XMLPUBFUN xmlNodePtr xmlXPathNextPreceding(xmlXPathParserContextPtr ctxt,
|
---|
588 | xmlNodePtr cur);
|
---|
589 | XMLPUBFUN xmlNodePtr xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt,
|
---|
590 | xmlNodePtr cur);
|
---|
591 | XMLPUBFUN xmlNodePtr xmlXPathNextPrecedingSibling(xmlXPathParserContextPtr ctxt,
|
---|
592 | xmlNodePtr cur);
|
---|
593 | /*
|
---|
594 | * The official core of XPath functions.
|
---|
595 | */
|
---|
596 | XMLPUBFUN void xmlXPathLastFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
597 | XMLPUBFUN void xmlXPathPositionFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
598 | XMLPUBFUN void xmlXPathCountFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
599 | XMLPUBFUN void xmlXPathIdFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
600 | XMLPUBFUN void xmlXPathLocalNameFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
601 | XMLPUBFUN void xmlXPathNamespaceURIFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
602 | XMLPUBFUN void xmlXPathStringFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
603 | XMLPUBFUN void xmlXPathStringLengthFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
604 | XMLPUBFUN void xmlXPathConcatFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
605 | XMLPUBFUN void xmlXPathContainsFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
606 | XMLPUBFUN void xmlXPathStartsWithFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
607 | XMLPUBFUN void xmlXPathSubstringFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
608 | XMLPUBFUN void xmlXPathSubstringBeforeFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
609 | XMLPUBFUN void xmlXPathSubstringAfterFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
610 | XMLPUBFUN void xmlXPathNormalizeFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
611 | XMLPUBFUN void xmlXPathTranslateFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
612 | XMLPUBFUN void xmlXPathNotFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
613 | XMLPUBFUN void xmlXPathTrueFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
614 | XMLPUBFUN void xmlXPathFalseFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
615 | XMLPUBFUN void xmlXPathLangFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
616 | XMLPUBFUN void xmlXPathNumberFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
617 | XMLPUBFUN void xmlXPathSumFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
618 | XMLPUBFUN void xmlXPathFloorFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
619 | XMLPUBFUN void xmlXPathCeilingFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
620 | XMLPUBFUN void xmlXPathRoundFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
621 | XMLPUBFUN void xmlXPathBooleanFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
---|
622 |
|
---|
623 | /**
|
---|
624 | * Really internal functions
|
---|
625 | */
|
---|
626 | XMLPUBFUN void xmlXPathNodeSetFreeNs(xmlNsPtr ns);
|
---|
627 |
|
---|
628 | #ifdef __cplusplus
|
---|
629 | }
|
---|
630 | #endif
|
---|
631 |
|
---|
632 | #endif /* LIBXML_XPATH_ENABLED */
|
---|
633 | #endif /* ! __XML_XPATH_INTERNALS_H__ */
|
---|