blob: 63f360952666af0002d9753785e82afd57940f22 [file] [log] [blame]
Owen Taylor3473f882001-02-23 17:55:21 +00001/*
2 * xpath.c: internal interfaces for XML Path Language implementation
3 * used to build new modules on top of XPath
4 *
5 * See COPYRIGHT for the status of this software
6 *
Daniel Veillardc5d64342001-06-24 12:13:24 +00007 * Author: daniel@veillard.com
Owen Taylor3473f882001-02-23 17:55:21 +00008 */
9
10#ifndef __XML_XPATH_INTERNALS_H__
11#define __XML_XPATH_INTERNALS_H__
12
Daniel Veillardc5d64342001-06-24 12:13:24 +000013#if defined(WIN32) && defined(_MSC_VER)
14#include <libxml/xmlwin32version.h>
15#else
Daniel Veillard017b1082001-06-21 11:20:21 +000016#include <libxml/xmlversion.h>
Daniel Veillardc5d64342001-06-24 12:13:24 +000017#endif
Owen Taylor3473f882001-02-23 17:55:21 +000018#include <libxml/xpath.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24/************************************************************************
25 * *
26 * Helpers *
27 * *
28 ************************************************************************/
29
Daniel Veillard8fcc4942001-07-17 20:07:33 +000030/**
31 * Many of these macros may later turn into functions. They
32 * shouldn't be used in #ifdef's preprocessor instructions.
33 */
Thomas Broyerf06a3d82001-07-16 04:52:57 +000034/**
35 * xmlXPathSetError:
36 * @ctxt: an XPath parser context
37 * @err: an xmlXPathError code
38 *
39 * Raises an error.
40 */
41#define xmlXPathSetError(ctxt, err) \
42 { xmlXPatherror((ctxt), __FILE__, __LINE__, (err)); \
43 (ctxt)->error = (err); }
Daniel Veillard8fcc4942001-07-17 20:07:33 +000044
Thomas Broyerf06a3d82001-07-16 04:52:57 +000045/**
46 * xmlXPathSetArityError:
47 * @ctxt: an XPath parser context
48 *
49 * Raises an XPATH_INVALID_ARITY error
50 */
51#define xmlXPathSetArityError(ctxt) \
52 xmlXPathSetError((ctxt), XPATH_INVALID_ARITY)
Daniel Veillard8fcc4942001-07-17 20:07:33 +000053
Thomas Broyerf06a3d82001-07-16 04:52:57 +000054/**
55 * xmlXPathSetTypeError:
56 * @ctxt: an XPath parser context
57 *
58 * Raises an XPATH_INVALID_TYPE error
59 */
60#define xmlXPathSetTypeError(ctxt) \
61 xmlXPathSetError((ctxt), XPATH_INVALID_TYPE)
Daniel Veillard8fcc4942001-07-17 20:07:33 +000062
Thomas Broyerf06a3d82001-07-16 04:52:57 +000063/**
64 * xmlXPathGetError:
65 * @ctxt: an XPath parser context
66 *
Daniel Veillard5e2dace2001-07-18 19:30:27 +000067 * Get the error code of an XPath context
68 *
Thomas Broyerf06a3d82001-07-16 04:52:57 +000069 * Returns the context error
70 */
71#define xmlXPathGetError(ctxt) ((ctxt)->error)
Daniel Veillard8fcc4942001-07-17 20:07:33 +000072
Thomas Broyerf06a3d82001-07-16 04:52:57 +000073/**
74 * xmlXPathCheckError:
75 * @ctxt: an XPath parser context
76 *
Daniel Veillard5e2dace2001-07-18 19:30:27 +000077 * Check if an XPath error was raised
78 *
Thomas Broyerf06a3d82001-07-16 04:52:57 +000079 * Returns true if an error has been raised, false otherwise.
80 */
81#define xmlXPathCheckError(ctxt) ((ctxt)->error != XPATH_EXPRESSION_OK)
82
83/**
84 * xmlXPathGetDocument:
85 * @ctxt: an XPath parser context
86 *
Daniel Veillard5e2dace2001-07-18 19:30:27 +000087 * Get the document of an XPath context
88 *
Thomas Broyerf06a3d82001-07-16 04:52:57 +000089 * Returns the context document
90 */
91#define xmlXPathGetDocument(ctxt) ((ctxt)->context->doc)
Daniel Veillard8fcc4942001-07-17 20:07:33 +000092
Thomas Broyerf06a3d82001-07-16 04:52:57 +000093/**
94 * xmlXPathGetContextNode:
95 * @ctxt: an XPath parser context
96 *
Daniel Veillard5e2dace2001-07-18 19:30:27 +000097 * Get the context node of an XPath context
98 *
Thomas Broyerf06a3d82001-07-16 04:52:57 +000099 * Returns the context node
100 */
101#define xmlXPathGetContextNode(ctxt) ((ctxt)->context->node)
102
103int xmlXPathPopBoolean (xmlXPathParserContextPtr ctxt);
104double xmlXPathPopNumber (xmlXPathParserContextPtr ctxt);
105xmlChar * xmlXPathPopString (xmlXPathParserContextPtr ctxt);
106xmlNodeSetPtr xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt);
107void * xmlXPathPopExternal (xmlXPathParserContextPtr ctxt);
108
109/**
110 * xmlXPathReturnBoolean:
111 * @ctxt: an XPath parser context
112 * @val: a boolean
113 *
114 * Pushes the boolean @val on the context stack
115 */
116#define xmlXPathReturnBoolean(ctxt, val) \
117 valuePush((ctxt), xmlXPathNewBoolean(val))
Daniel Veillard8fcc4942001-07-17 20:07:33 +0000118
Thomas Broyerf06a3d82001-07-16 04:52:57 +0000119/**
120 * xmlXPathReturnTrue:
121 * @ctxt: an XPath parser context
122 *
123 * Pushes true on the context stack
124 */
125#define xmlXPathReturnTrue(ctxt) xmlXPathReturnBoolean((ctxt), 1)
Daniel Veillard8fcc4942001-07-17 20:07:33 +0000126
Thomas Broyerf06a3d82001-07-16 04:52:57 +0000127/**
128 * xmlXPathReturnFalse:
129 * @ctxt: an XPath parser context
130 *
131 * Pushes false on the context stack
132 */
133#define xmlXPathReturnFalse(ctxt) xmlXPathReturnBoolean((ctxt), 0)
Daniel Veillard8fcc4942001-07-17 20:07:33 +0000134
Thomas Broyerf06a3d82001-07-16 04:52:57 +0000135/**
136 * xmlXPathReturnNumber:
137 * @ctxt: an XPath parser context
138 * @val: a double
139 *
140 * Pushes the double @val on the context stack
141 */
142#define xmlXPathReturnNumber(ctxt, val) \
143 valuePush((ctxt), xmlXPathNewFloat(val))
Daniel Veillard8fcc4942001-07-17 20:07:33 +0000144
Thomas Broyerf06a3d82001-07-16 04:52:57 +0000145/**
146 * xmlXPathReturnString:
147 * @ctxt: an XPath parser context
148 * @str: a string
149 *
150 * Pushes the string @str on the context stack
151 */
152#define xmlXPathReturnString(ctxt, str) \
153 valuePush((ctxt), xmlXPathWrapString(str))
Daniel Veillard8fcc4942001-07-17 20:07:33 +0000154
Thomas Broyerf06a3d82001-07-16 04:52:57 +0000155/**
156 * xmlXPathReturnEmptyString:
157 * @ctxt: an XPath parser context
158 *
159 * Pushes an empty string on the stack
160 */
161#define xmlXPathReturnEmptyString(ctxt) \
162 valuePush((ctxt), xmlXPathNewCString(""))
Daniel Veillard8fcc4942001-07-17 20:07:33 +0000163
Thomas Broyerf06a3d82001-07-16 04:52:57 +0000164/**
165 * xmlXPathReturnNodeSet:
166 * @ctxt: an XPath parser context
167 * @ns: a node-set
168 *
169 * Pushes the node-set @ns on the context stack
170 */
171#define xmlXPathReturnNodeSet(ctxt, ns) \
172 valuePush((ctxt), xmlXPathWrapNodeSet(ns))
Daniel Veillard8fcc4942001-07-17 20:07:33 +0000173
Thomas Broyerf06a3d82001-07-16 04:52:57 +0000174/**
175 * xmlXPathReturnEmptyNodeSet:
176 * @ctxt: an XPath parser context
177 *
178 * Pushes an empty node-set on the context stack
179 */
180#define xmlXPathReturnEmptyNodeSet(ctxt, ns) \
181 valuePush((ctxt), xmlXPathNewNodeSet(NULL))
Daniel Veillard8fcc4942001-07-17 20:07:33 +0000182
Thomas Broyerf06a3d82001-07-16 04:52:57 +0000183/**
184 * xmlXPathReturnExternal:
185 * @ctxt: an XPath parser context
186 * @val: user data
187 *
188 * Pushes user data on the context stack
189 */
190#define xmlXPathReturnExternal(ctxt, val) \
191 valuePush((ctxt), xmlXPathWrapExternal(val))
192
193/**
194 * xmlXPathStackIsNodeSet:
195 * @ctxt: an XPath parser context
196 *
Daniel Veillard5e2dace2001-07-18 19:30:27 +0000197 * Check if the current value on the XPath stack is a node set or
198 * an XSLT value tree
199 *
Thomas Broyerf06a3d82001-07-16 04:52:57 +0000200 * Returns true if the current object on the stack is a node-set
201 */
202#define xmlXPathStackIsNodeSet(ctxt) \
203 (((ctxt)->value != NULL) \
204 && (((ctxt)->value->type == XPATH_NODESET) \
205 || ((ctxt)->value->type == XPATH_XSLT_TREE)))
206
207/**
208 * xmlXPathEmptyNodeSet:
209 * @ns: a node-set
210 *
211 * Empties a node-set
212 */
213#define xmlXPathEmptyNodeSet(ns) \
214 { while ((ns)->nodeNr > 0) (ns)->nodeTab[(ns)->nodeNr--] = NULL; }
215
Daniel Veillardbed7b052001-05-19 14:59:49 +0000216/**
217 * CHECK_ERROR:
218 *
219 * macro to return from the function if an XPath error was detected
220 */
Owen Taylor3473f882001-02-23 17:55:21 +0000221#define CHECK_ERROR \
222 if (ctxt->error != XPATH_EXPRESSION_OK) return
223
Daniel Veillardbed7b052001-05-19 14:59:49 +0000224/**
225 * CHECK_ERROR0:
226 *
227 * macro to return 0 from the function if an XPath error was detected
228 */
Owen Taylor3473f882001-02-23 17:55:21 +0000229#define CHECK_ERROR0 \
230 if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
231
Daniel Veillardbed7b052001-05-19 14:59:49 +0000232/**
233 * XP_ERROR:
234 * @X: the error code
235 *
236 * Macro to raise an XPath error and return
237 */
Owen Taylor3473f882001-02-23 17:55:21 +0000238#define XP_ERROR(X) \
239 { xmlXPatherror(ctxt, __FILE__, __LINE__, X); \
240 ctxt->error = (X); return; }
241
Daniel Veillardbed7b052001-05-19 14:59:49 +0000242/**
243 * XP_ERROR0:
244 * @X: the error code
245 *
246 * Macro to raise an XPath error and return 0
247 */
Owen Taylor3473f882001-02-23 17:55:21 +0000248#define XP_ERROR0(X) \
249 { xmlXPatherror(ctxt, __FILE__, __LINE__, X); \
250 ctxt->error = (X); return(0); }
251
Daniel Veillardbed7b052001-05-19 14:59:49 +0000252/**
253 * CHECK_TYPE:
254 * @typeval: the XPath type
255 *
256 * Macro to check that the value on top of the XPath stack is of a given
257 * type.
258 */
Owen Taylor3473f882001-02-23 17:55:21 +0000259#define CHECK_TYPE(typeval) \
260 if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \
261 XP_ERROR(XPATH_INVALID_TYPE)
262
Daniel Veillardbed7b052001-05-19 14:59:49 +0000263/**
Daniel Veillardf06307e2001-07-03 10:35:50 +0000264 * CHECK_TYPE0:
265 * @typeval: the XPath type
266 *
267 * Macro to check that the value on top of the XPath stack is of a given
268 * type. return(0) in case of failure
269 */
270#define CHECK_TYPE0(typeval) \
271 if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \
272 XP_ERROR0(XPATH_INVALID_TYPE)
273
274/**
Daniel Veillardbed7b052001-05-19 14:59:49 +0000275 * CHECK_ARITY:
276 * @x: the number of expected args
277 *
278 * Macro to check that the number of args passed to an XPath function matches
279 */
Owen Taylor3473f882001-02-23 17:55:21 +0000280#define CHECK_ARITY(x) \
281 if (nargs != (x)) \
282 XP_ERROR(XPATH_INVALID_ARITY);
283
Daniel Veillardbed7b052001-05-19 14:59:49 +0000284/**
285 * CAST_TO_STRING:
286 *
287 * Macro to try to cast the value on the top of the XPath stack to a string
288 */
Owen Taylor3473f882001-02-23 17:55:21 +0000289#define CAST_TO_STRING \
290 if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING)) \
291 xmlXPathStringFunction(ctxt, 1);
292
Daniel Veillardbed7b052001-05-19 14:59:49 +0000293/**
294 * CAST_TO_NUMBER:
295 *
296 * Macro to try to cast the value on the top of the XPath stack to a number
297 */
Owen Taylor3473f882001-02-23 17:55:21 +0000298#define CAST_TO_NUMBER \
299 if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER)) \
300 xmlXPathNumberFunction(ctxt, 1);
301
Daniel Veillardbed7b052001-05-19 14:59:49 +0000302/**
303 * CAST_TO_BOOLEAN:
304 *
305 * Macro to try to cast the value on the top of the XPath stack to a boolean
306 */
Owen Taylor3473f882001-02-23 17:55:21 +0000307#define CAST_TO_BOOLEAN \
308 if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_BOOLEAN)) \
309 xmlXPathBooleanFunction(ctxt, 1);
310
311/*
Thomas Broyerf06a3d82001-07-16 04:52:57 +0000312 * Variable Lookup forwarding
Owen Taylor3473f882001-02-23 17:55:21 +0000313 */
Daniel Veillard5e2dace2001-07-18 19:30:27 +0000314typedef xmlXPathObjectPtr (*xmlXPathVariableLookupFunc) (void *ctxt,
Owen Taylor3473f882001-02-23 17:55:21 +0000315 const xmlChar *name,
316 const xmlChar *ns_uri);
317
318void xmlXPathRegisterVariableLookup (xmlXPathContextPtr ctxt,
319 xmlXPathVariableLookupFunc f,
320 void *varCtxt);
321
322/*
Thomas Broyerba4ad322001-07-26 16:55:21 +0000323 * Function Lookup forwarding
324 */
325typedef xmlXPathFunction
326 (*xmlXPathFuncLookupFunc) (void *ctxt,
327 const xmlChar *name,
328 const xmlChar *ns_uri);
329
330void xmlXPathRegisterFuncLookup (xmlXPathContextPtr ctxt,
331 xmlXPathFuncLookupFunc f,
332 void *funcCtxt);
333
334/*
Owen Taylor3473f882001-02-23 17:55:21 +0000335 * Error reporting
336 */
337void xmlXPatherror (xmlXPathParserContextPtr ctxt,
338 const char *file,
339 int line,
340 int no);
341
342void xmlXPathDebugDumpObject (FILE *output,
343 xmlXPathObjectPtr cur,
344 int depth);
Daniel Veillard56a4cb82001-03-24 17:00:36 +0000345void xmlXPathDebugDumpCompExpr(FILE *output,
346 xmlXPathCompExprPtr comp,
347 int depth);
Thomas Broyerf06a3d82001-07-16 04:52:57 +0000348
349/**
350 * NodeSet handling
351 */
352xmlNodeSetPtr xmlXPathDifference (xmlNodeSetPtr nodes1,
353 xmlNodeSetPtr nodes2);
354xmlNodeSetPtr xmlXPathIntersection (xmlNodeSetPtr nodes1,
355 xmlNodeSetPtr nodes2);
356
357xmlNodeSetPtr xmlXPathDistinctSorted (xmlNodeSetPtr nodes);
358xmlNodeSetPtr xmlXPathDistinct (xmlNodeSetPtr nodes);
359
360int xmlXPathHasSameNodes (xmlNodeSetPtr nodes1,
361 xmlNodeSetPtr nodes2);
362
363xmlNodeSetPtr xmlXPathNodeLeadingSorted (xmlNodeSetPtr nodes,
364 xmlNodePtr node);
365xmlNodeSetPtr xmlXPathLeadingSorted (xmlNodeSetPtr nodes1,
366 xmlNodeSetPtr nodes2);
367xmlNodeSetPtr xmlXPathNodeLeading (xmlNodeSetPtr nodes,
368 xmlNodePtr node);
369xmlNodeSetPtr xmlXPathLeading (xmlNodeSetPtr nodes1,
370 xmlNodeSetPtr nodes2);
371
372xmlNodeSetPtr xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes,
373 xmlNodePtr node);
374xmlNodeSetPtr xmlXPathTrailingSorted (xmlNodeSetPtr nodes1,
375 xmlNodeSetPtr nodes2);
376xmlNodeSetPtr xmlXPathNodeTrailing (xmlNodeSetPtr nodes,
377 xmlNodePtr node);
378xmlNodeSetPtr xmlXPathTrailing (xmlNodeSetPtr nodes1,
379 xmlNodeSetPtr nodes2);
380
381
Owen Taylor3473f882001-02-23 17:55:21 +0000382/**
383 * Extending a context
384 */
385
386int xmlXPathRegisterNs (xmlXPathContextPtr ctxt,
387 const xmlChar *prefix,
388 const xmlChar *ns_uri);
389const xmlChar * xmlXPathNsLookup (xmlXPathContextPtr ctxt,
390 const xmlChar *ns_uri);
391void xmlXPathRegisteredNsCleanup (xmlXPathContextPtr ctxt);
392
393int xmlXPathRegisterFunc (xmlXPathContextPtr ctxt,
394 const xmlChar *name,
395 xmlXPathFunction f);
396int xmlXPathRegisterFuncNS (xmlXPathContextPtr ctxt,
397 const xmlChar *name,
398 const xmlChar *ns_uri,
399 xmlXPathFunction f);
400int xmlXPathRegisterVariable (xmlXPathContextPtr ctxt,
401 const xmlChar *name,
402 xmlXPathObjectPtr value);
403int xmlXPathRegisterVariableNS (xmlXPathContextPtr ctxt,
404 const xmlChar *name,
405 const xmlChar *ns_uri,
406 xmlXPathObjectPtr value);
407xmlXPathFunction xmlXPathFunctionLookup (xmlXPathContextPtr ctxt,
408 const xmlChar *name);
409xmlXPathFunction xmlXPathFunctionLookupNS (xmlXPathContextPtr ctxt,
410 const xmlChar *name,
411 const xmlChar *ns_uri);
412void xmlXPathRegisteredFuncsCleanup(xmlXPathContextPtr ctxt);
413xmlXPathObjectPtr xmlXPathVariableLookup (xmlXPathContextPtr ctxt,
414 const xmlChar *name);
415xmlXPathObjectPtr xmlXPathVariableLookupNS (xmlXPathContextPtr ctxt,
416 const xmlChar *name,
417 const xmlChar *ns_uri);
418void xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt);
419
420/**
421 * Utilities to extend XPath
422 */
423xmlXPathParserContextPtr
424 xmlXPathNewParserContext (const xmlChar *str,
425 xmlXPathContextPtr ctxt);
426void xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt);
427
428/* TODO: remap to xmlXPathValuePop and Push */
429xmlXPathObjectPtr valuePop (xmlXPathParserContextPtr ctxt);
430int valuePush (xmlXPathParserContextPtr ctxt,
431 xmlXPathObjectPtr value);
432
433xmlXPathObjectPtr xmlXPathNewString (const xmlChar *val);
434xmlXPathObjectPtr xmlXPathNewCString (const char *val);
Daniel Veillardba0b8c92001-05-15 09:43:47 +0000435xmlXPathObjectPtr xmlXPathWrapString (xmlChar *val);
436xmlXPathObjectPtr xmlXPathWrapCString (char *val);
Owen Taylor3473f882001-02-23 17:55:21 +0000437xmlXPathObjectPtr xmlXPathNewFloat (double val);
438xmlXPathObjectPtr xmlXPathNewBoolean (int val);
439xmlXPathObjectPtr xmlXPathNewNodeSet (xmlNodePtr val);
440xmlXPathObjectPtr xmlXPathNewValueTree (xmlNodePtr val);
441void xmlXPathNodeSetAdd (xmlNodeSetPtr cur,
442 xmlNodePtr val);
Daniel Veillard56a4cb82001-03-24 17:00:36 +0000443void xmlXPathNodeSetAddUnique (xmlNodeSetPtr cur,
444 xmlNodePtr val);
445void xmlXPathNodeSetSort (xmlNodeSetPtr set);
Owen Taylor3473f882001-02-23 17:55:21 +0000446
447void xmlXPathIdFunction (xmlXPathParserContextPtr ctxt,
448 int nargs);
449void xmlXPathRoot (xmlXPathParserContextPtr ctxt);
450void xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt);
451xmlChar * xmlXPathParseName (xmlXPathParserContextPtr ctxt);
452xmlChar * xmlXPathParseNCName (xmlXPathParserContextPtr ctxt);
453
454/*
455 * Debug
456 */
457#ifdef LIBXML_DEBUG_ENABLED
Owen Taylor3473f882001-02-23 17:55:21 +0000458void xmlXPathDebugDumpObject(FILE *output, xmlXPathObjectPtr cur, int depth);
459#endif
460/*
461 * Existing functions
462 */
Daniel Veillard017b1082001-06-21 11:20:21 +0000463double xmlXPathStringEvalNumber(const xmlChar *str);
Owen Taylor3473f882001-02-23 17:55:21 +0000464int xmlXPathEvaluatePredicateResult(xmlXPathParserContextPtr ctxt,
465 xmlXPathObjectPtr res);
466void xmlXPathInit(void);
467void xmlXPathStringFunction(xmlXPathParserContextPtr ctxt, int nargs);
468void xmlXPathRegisterAllFunctions(xmlXPathContextPtr ctxt);
469xmlNodeSetPtr xmlXPathNodeSetCreate(xmlNodePtr val);
470void xmlXPathNodeSetAdd(xmlNodeSetPtr cur, xmlNodePtr val);
471xmlNodeSetPtr xmlXPathNodeSetMerge(xmlNodeSetPtr val1, xmlNodeSetPtr val2);
472void xmlXPathNodeSetDel(xmlNodeSetPtr cur, xmlNodePtr val);
473void xmlXPathNodeSetRemove(xmlNodeSetPtr cur, int val);
474void xmlXPathFreeNodeSet(xmlNodeSetPtr obj);
475xmlXPathObjectPtr xmlXPathNewNodeSet(xmlNodePtr val);
476xmlXPathObjectPtr xmlXPathNewNodeSetList(xmlNodeSetPtr val);
477xmlXPathObjectPtr xmlXPathWrapNodeSet(xmlNodeSetPtr val);
Thomas Broyerf06a3d82001-07-16 04:52:57 +0000478 xmlXPathObjectPtr xmlXPathWrapExternal(void *val);
Owen Taylor3473f882001-02-23 17:55:21 +0000479void xmlXPathFreeNodeSetList(xmlXPathObjectPtr obj);
480
481
482xmlXPathObjectPtr xmlXPathNewFloat(double val);
483xmlXPathObjectPtr xmlXPathNewBoolean(int val);
484xmlXPathObjectPtr xmlXPathNewString(const xmlChar *val);
485xmlXPathObjectPtr xmlXPathNewCString(const char *val);
486void xmlXPathFreeObject(xmlXPathObjectPtr obj);
487xmlXPathContextPtr xmlXPathNewContext(xmlDocPtr doc);
488void xmlXPathFreeContext(xmlXPathContextPtr ctxt);
489
490int xmlXPathEqualValues(xmlXPathParserContextPtr ctxt);
491int xmlXPathCompareValues(xmlXPathParserContextPtr ctxt, int inf, int strict);
492void xmlXPathValueFlipSign(xmlXPathParserContextPtr ctxt);
493void xmlXPathAddValues(xmlXPathParserContextPtr ctxt);
494void xmlXPathSubValues(xmlXPathParserContextPtr ctxt);
495void xmlXPathMultValues(xmlXPathParserContextPtr ctxt);
496void xmlXPathDivValues(xmlXPathParserContextPtr ctxt);
497void xmlXPathModValues(xmlXPathParserContextPtr ctxt);
498
Daniel Veillard56a4cb82001-03-24 17:00:36 +0000499int xmlXPathIsNodeType(const xmlChar *name);
Owen Taylor3473f882001-02-23 17:55:21 +0000500
501/*
502 * Some of the axis navigation routines
503 */
Daniel Veillard56a4cb82001-03-24 17:00:36 +0000504xmlNodePtr xmlXPathNextSelf(xmlXPathParserContextPtr ctxt,
505 xmlNodePtr cur);
506xmlNodePtr xmlXPathNextChild(xmlXPathParserContextPtr ctxt,
507 xmlNodePtr cur);
508xmlNodePtr xmlXPathNextDescendant(xmlXPathParserContextPtr ctxt,
509 xmlNodePtr cur);
510xmlNodePtr xmlXPathNextDescendantOrSelf(xmlXPathParserContextPtr ctxt,
511 xmlNodePtr cur);
512xmlNodePtr xmlXPathNextParent(xmlXPathParserContextPtr ctxt,
513 xmlNodePtr cur);
514xmlNodePtr xmlXPathNextAncestorOrSelf(xmlXPathParserContextPtr ctxt,
515 xmlNodePtr cur);
516xmlNodePtr xmlXPathNextFollowingSibling(xmlXPathParserContextPtr ctxt,
517 xmlNodePtr cur);
518xmlNodePtr xmlXPathNextFollowing(xmlXPathParserContextPtr ctxt,
519 xmlNodePtr cur);
520xmlNodePtr xmlXPathNextNamespace(xmlXPathParserContextPtr ctxt,
521 xmlNodePtr cur);
522xmlNodePtr xmlXPathNextAttribute(xmlXPathParserContextPtr ctxt,
523 xmlNodePtr cur);
524xmlNodePtr xmlXPathNextPreceding(xmlXPathParserContextPtr ctxt,
525 xmlNodePtr cur);
526xmlNodePtr xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt,
527 xmlNodePtr cur);
528xmlNodePtr xmlXPathNextPrecedingSibling(xmlXPathParserContextPtr ctxt,
529 xmlNodePtr cur);
Owen Taylor3473f882001-02-23 17:55:21 +0000530/*
531 * The official core of XPath functions
532 */
533void xmlXPathRoot(xmlXPathParserContextPtr ctxt);
534void xmlXPathLastFunction(xmlXPathParserContextPtr ctxt, int nargs);
535void xmlXPathPositionFunction(xmlXPathParserContextPtr ctxt, int nargs);
536void xmlXPathCountFunction(xmlXPathParserContextPtr ctxt, int nargs);
537void xmlXPathIdFunction(xmlXPathParserContextPtr ctxt, int nargs);
538void xmlXPathLocalNameFunction(xmlXPathParserContextPtr ctxt, int nargs);
539void xmlXPathNamespaceURIFunction(xmlXPathParserContextPtr ctxt, int nargs);
540void xmlXPathStringFunction(xmlXPathParserContextPtr ctxt, int nargs);
541void xmlXPathStringLengthFunction(xmlXPathParserContextPtr ctxt, int nargs);
542void xmlXPathConcatFunction(xmlXPathParserContextPtr ctxt, int nargs);
543void xmlXPathContainsFunction(xmlXPathParserContextPtr ctxt, int nargs);
544void xmlXPathStartsWithFunction(xmlXPathParserContextPtr ctxt, int nargs);
545void xmlXPathSubstringFunction(xmlXPathParserContextPtr ctxt, int nargs);
546void xmlXPathSubstringBeforeFunction(xmlXPathParserContextPtr ctxt, int nargs);
547void xmlXPathSubstringAfterFunction(xmlXPathParserContextPtr ctxt, int nargs);
548void xmlXPathNormalizeFunction(xmlXPathParserContextPtr ctxt, int nargs);
549void xmlXPathTranslateFunction(xmlXPathParserContextPtr ctxt, int nargs);
550void xmlXPathNotFunction(xmlXPathParserContextPtr ctxt, int nargs);
551void xmlXPathTrueFunction(xmlXPathParserContextPtr ctxt, int nargs);
552void xmlXPathFalseFunction(xmlXPathParserContextPtr ctxt, int nargs);
553void xmlXPathLangFunction(xmlXPathParserContextPtr ctxt, int nargs);
554void xmlXPathNumberFunction(xmlXPathParserContextPtr ctxt, int nargs);
555void xmlXPathSumFunction(xmlXPathParserContextPtr ctxt, int nargs);
556void xmlXPathFloorFunction(xmlXPathParserContextPtr ctxt, int nargs);
557void xmlXPathCeilingFunction(xmlXPathParserContextPtr ctxt, int nargs);
558void xmlXPathRoundFunction(xmlXPathParserContextPtr ctxt, int nargs);
559void xmlXPathBooleanFunction(xmlXPathParserContextPtr ctxt, int nargs);
560#ifdef __cplusplus
561}
562#endif
563#endif /* ! __XML_XPATH_INTERNALS_H__ */