blob: 1574e786925492c5624179264ca69aca3a461a8e [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 *
67 * Returns the context error
68 */
69#define xmlXPathGetError(ctxt) ((ctxt)->error)
Daniel Veillard8fcc4942001-07-17 20:07:33 +000070
Thomas Broyerf06a3d82001-07-16 04:52:57 +000071/**
72 * xmlXPathCheckError:
73 * @ctxt: an XPath parser context
74 *
75 * Returns true if an error has been raised, false otherwise.
76 */
77#define xmlXPathCheckError(ctxt) ((ctxt)->error != XPATH_EXPRESSION_OK)
78
79/**
80 * xmlXPathGetDocument:
81 * @ctxt: an XPath parser context
82 *
83 * Returns the context document
84 */
85#define xmlXPathGetDocument(ctxt) ((ctxt)->context->doc)
Daniel Veillard8fcc4942001-07-17 20:07:33 +000086
Thomas Broyerf06a3d82001-07-16 04:52:57 +000087/**
88 * xmlXPathGetContextNode:
89 * @ctxt: an XPath parser context
90 *
91 * Returns the context node
92 */
93#define xmlXPathGetContextNode(ctxt) ((ctxt)->context->node)
94
95int xmlXPathPopBoolean (xmlXPathParserContextPtr ctxt);
96double xmlXPathPopNumber (xmlXPathParserContextPtr ctxt);
97xmlChar * xmlXPathPopString (xmlXPathParserContextPtr ctxt);
98xmlNodeSetPtr xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt);
99void * xmlXPathPopExternal (xmlXPathParserContextPtr ctxt);
100
101/**
102 * xmlXPathReturnBoolean:
103 * @ctxt: an XPath parser context
104 * @val: a boolean
105 *
106 * Pushes the boolean @val on the context stack
107 */
108#define xmlXPathReturnBoolean(ctxt, val) \
109 valuePush((ctxt), xmlXPathNewBoolean(val))
Daniel Veillard8fcc4942001-07-17 20:07:33 +0000110
Thomas Broyerf06a3d82001-07-16 04:52:57 +0000111/**
112 * xmlXPathReturnTrue:
113 * @ctxt: an XPath parser context
114 *
115 * Pushes true on the context stack
116 */
117#define xmlXPathReturnTrue(ctxt) xmlXPathReturnBoolean((ctxt), 1)
Daniel Veillard8fcc4942001-07-17 20:07:33 +0000118
Thomas Broyerf06a3d82001-07-16 04:52:57 +0000119/**
120 * xmlXPathReturnFalse:
121 * @ctxt: an XPath parser context
122 *
123 * Pushes false on the context stack
124 */
125#define xmlXPathReturnFalse(ctxt) xmlXPathReturnBoolean((ctxt), 0)
Daniel Veillard8fcc4942001-07-17 20:07:33 +0000126
Thomas Broyerf06a3d82001-07-16 04:52:57 +0000127/**
128 * xmlXPathReturnNumber:
129 * @ctxt: an XPath parser context
130 * @val: a double
131 *
132 * Pushes the double @val on the context stack
133 */
134#define xmlXPathReturnNumber(ctxt, val) \
135 valuePush((ctxt), xmlXPathNewFloat(val))
Daniel Veillard8fcc4942001-07-17 20:07:33 +0000136
Thomas Broyerf06a3d82001-07-16 04:52:57 +0000137/**
138 * xmlXPathReturnString:
139 * @ctxt: an XPath parser context
140 * @str: a string
141 *
142 * Pushes the string @str on the context stack
143 */
144#define xmlXPathReturnString(ctxt, str) \
145 valuePush((ctxt), xmlXPathWrapString(str))
Daniel Veillard8fcc4942001-07-17 20:07:33 +0000146
Thomas Broyerf06a3d82001-07-16 04:52:57 +0000147/**
148 * xmlXPathReturnEmptyString:
149 * @ctxt: an XPath parser context
150 *
151 * Pushes an empty string on the stack
152 */
153#define xmlXPathReturnEmptyString(ctxt) \
154 valuePush((ctxt), xmlXPathNewCString(""))
Daniel Veillard8fcc4942001-07-17 20:07:33 +0000155
Thomas Broyerf06a3d82001-07-16 04:52:57 +0000156/**
157 * xmlXPathReturnNodeSet:
158 * @ctxt: an XPath parser context
159 * @ns: a node-set
160 *
161 * Pushes the node-set @ns on the context stack
162 */
163#define xmlXPathReturnNodeSet(ctxt, ns) \
164 valuePush((ctxt), xmlXPathWrapNodeSet(ns))
Daniel Veillard8fcc4942001-07-17 20:07:33 +0000165
Thomas Broyerf06a3d82001-07-16 04:52:57 +0000166/**
167 * xmlXPathReturnEmptyNodeSet:
168 * @ctxt: an XPath parser context
169 *
170 * Pushes an empty node-set on the context stack
171 */
172#define xmlXPathReturnEmptyNodeSet(ctxt, ns) \
173 valuePush((ctxt), xmlXPathNewNodeSet(NULL))
Daniel Veillard8fcc4942001-07-17 20:07:33 +0000174
Thomas Broyerf06a3d82001-07-16 04:52:57 +0000175/**
176 * xmlXPathReturnExternal:
177 * @ctxt: an XPath parser context
178 * @val: user data
179 *
180 * Pushes user data on the context stack
181 */
182#define xmlXPathReturnExternal(ctxt, val) \
183 valuePush((ctxt), xmlXPathWrapExternal(val))
184
185/**
186 * xmlXPathStackIsNodeSet:
187 * @ctxt: an XPath parser context
188 *
189 * Returns true if the current object on the stack is a node-set
190 */
191#define xmlXPathStackIsNodeSet(ctxt) \
192 (((ctxt)->value != NULL) \
193 && (((ctxt)->value->type == XPATH_NODESET) \
194 || ((ctxt)->value->type == XPATH_XSLT_TREE)))
195
196/**
197 * xmlXPathEmptyNodeSet:
198 * @ns: a node-set
199 *
200 * Empties a node-set
201 */
202#define xmlXPathEmptyNodeSet(ns) \
203 { while ((ns)->nodeNr > 0) (ns)->nodeTab[(ns)->nodeNr--] = NULL; }
204
Daniel Veillardbed7b052001-05-19 14:59:49 +0000205/**
206 * CHECK_ERROR:
207 *
208 * macro to return from the function if an XPath error was detected
209 */
Owen Taylor3473f882001-02-23 17:55:21 +0000210#define CHECK_ERROR \
211 if (ctxt->error != XPATH_EXPRESSION_OK) return
212
Daniel Veillardbed7b052001-05-19 14:59:49 +0000213/**
214 * CHECK_ERROR0:
215 *
216 * macro to return 0 from the function if an XPath error was detected
217 */
Owen Taylor3473f882001-02-23 17:55:21 +0000218#define CHECK_ERROR0 \
219 if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
220
Daniel Veillardbed7b052001-05-19 14:59:49 +0000221/**
222 * XP_ERROR:
223 * @X: the error code
224 *
225 * Macro to raise an XPath error and return
226 */
Owen Taylor3473f882001-02-23 17:55:21 +0000227#define XP_ERROR(X) \
228 { xmlXPatherror(ctxt, __FILE__, __LINE__, X); \
229 ctxt->error = (X); return; }
230
Daniel Veillardbed7b052001-05-19 14:59:49 +0000231/**
232 * XP_ERROR0:
233 * @X: the error code
234 *
235 * Macro to raise an XPath error and return 0
236 */
Owen Taylor3473f882001-02-23 17:55:21 +0000237#define XP_ERROR0(X) \
238 { xmlXPatherror(ctxt, __FILE__, __LINE__, X); \
239 ctxt->error = (X); return(0); }
240
Daniel Veillardbed7b052001-05-19 14:59:49 +0000241/**
242 * CHECK_TYPE:
243 * @typeval: the XPath type
244 *
245 * Macro to check that the value on top of the XPath stack is of a given
246 * type.
247 */
Owen Taylor3473f882001-02-23 17:55:21 +0000248#define CHECK_TYPE(typeval) \
249 if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \
250 XP_ERROR(XPATH_INVALID_TYPE)
251
Daniel Veillardbed7b052001-05-19 14:59:49 +0000252/**
Daniel Veillardf06307e2001-07-03 10:35:50 +0000253 * CHECK_TYPE0:
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. return(0) in case of failure
258 */
259#define CHECK_TYPE0(typeval) \
260 if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \
261 XP_ERROR0(XPATH_INVALID_TYPE)
262
263/**
Daniel Veillardbed7b052001-05-19 14:59:49 +0000264 * CHECK_ARITY:
265 * @x: the number of expected args
266 *
267 * Macro to check that the number of args passed to an XPath function matches
268 */
Owen Taylor3473f882001-02-23 17:55:21 +0000269#define CHECK_ARITY(x) \
270 if (nargs != (x)) \
271 XP_ERROR(XPATH_INVALID_ARITY);
272
Daniel Veillardbed7b052001-05-19 14:59:49 +0000273/**
274 * CAST_TO_STRING:
275 *
276 * Macro to try to cast the value on the top of the XPath stack to a string
277 */
Owen Taylor3473f882001-02-23 17:55:21 +0000278#define CAST_TO_STRING \
279 if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING)) \
280 xmlXPathStringFunction(ctxt, 1);
281
Daniel Veillardbed7b052001-05-19 14:59:49 +0000282/**
283 * CAST_TO_NUMBER:
284 *
285 * Macro to try to cast the value on the top of the XPath stack to a number
286 */
Owen Taylor3473f882001-02-23 17:55:21 +0000287#define CAST_TO_NUMBER \
288 if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER)) \
289 xmlXPathNumberFunction(ctxt, 1);
290
Daniel Veillardbed7b052001-05-19 14:59:49 +0000291/**
292 * CAST_TO_BOOLEAN:
293 *
294 * Macro to try to cast the value on the top of the XPath stack to a boolean
295 */
Owen Taylor3473f882001-02-23 17:55:21 +0000296#define CAST_TO_BOOLEAN \
297 if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_BOOLEAN)) \
298 xmlXPathBooleanFunction(ctxt, 1);
299
300/*
Thomas Broyerf06a3d82001-07-16 04:52:57 +0000301 * Variable Lookup forwarding
Owen Taylor3473f882001-02-23 17:55:21 +0000302 */
303typedef xmlXPathObjectPtr
304 (*xmlXPathVariableLookupFunc) (void *ctxt,
305 const xmlChar *name,
306 const xmlChar *ns_uri);
307
308void xmlXPathRegisterVariableLookup (xmlXPathContextPtr ctxt,
309 xmlXPathVariableLookupFunc f,
310 void *varCtxt);
311
312/*
313 * Error reporting
314 */
315void xmlXPatherror (xmlXPathParserContextPtr ctxt,
316 const char *file,
317 int line,
318 int no);
319
320void xmlXPathDebugDumpObject (FILE *output,
321 xmlXPathObjectPtr cur,
322 int depth);
Daniel Veillard56a4cb82001-03-24 17:00:36 +0000323void xmlXPathDebugDumpCompExpr(FILE *output,
324 xmlXPathCompExprPtr comp,
325 int depth);
Thomas Broyerf06a3d82001-07-16 04:52:57 +0000326
327/**
328 * NodeSet handling
329 */
330xmlNodeSetPtr xmlXPathDifference (xmlNodeSetPtr nodes1,
331 xmlNodeSetPtr nodes2);
332xmlNodeSetPtr xmlXPathIntersection (xmlNodeSetPtr nodes1,
333 xmlNodeSetPtr nodes2);
334
335xmlNodeSetPtr xmlXPathDistinctSorted (xmlNodeSetPtr nodes);
336xmlNodeSetPtr xmlXPathDistinct (xmlNodeSetPtr nodes);
337
338int xmlXPathHasSameNodes (xmlNodeSetPtr nodes1,
339 xmlNodeSetPtr nodes2);
340
341xmlNodeSetPtr xmlXPathNodeLeadingSorted (xmlNodeSetPtr nodes,
342 xmlNodePtr node);
343xmlNodeSetPtr xmlXPathLeadingSorted (xmlNodeSetPtr nodes1,
344 xmlNodeSetPtr nodes2);
345xmlNodeSetPtr xmlXPathNodeLeading (xmlNodeSetPtr nodes,
346 xmlNodePtr node);
347xmlNodeSetPtr xmlXPathLeading (xmlNodeSetPtr nodes1,
348 xmlNodeSetPtr nodes2);
349
350xmlNodeSetPtr xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes,
351 xmlNodePtr node);
352xmlNodeSetPtr xmlXPathTrailingSorted (xmlNodeSetPtr nodes1,
353 xmlNodeSetPtr nodes2);
354xmlNodeSetPtr xmlXPathNodeTrailing (xmlNodeSetPtr nodes,
355 xmlNodePtr node);
356xmlNodeSetPtr xmlXPathTrailing (xmlNodeSetPtr nodes1,
357 xmlNodeSetPtr nodes2);
358
359
Owen Taylor3473f882001-02-23 17:55:21 +0000360/**
361 * Extending a context
362 */
363
364int xmlXPathRegisterNs (xmlXPathContextPtr ctxt,
365 const xmlChar *prefix,
366 const xmlChar *ns_uri);
367const xmlChar * xmlXPathNsLookup (xmlXPathContextPtr ctxt,
368 const xmlChar *ns_uri);
369void xmlXPathRegisteredNsCleanup (xmlXPathContextPtr ctxt);
370
371int xmlXPathRegisterFunc (xmlXPathContextPtr ctxt,
372 const xmlChar *name,
373 xmlXPathFunction f);
374int xmlXPathRegisterFuncNS (xmlXPathContextPtr ctxt,
375 const xmlChar *name,
376 const xmlChar *ns_uri,
377 xmlXPathFunction f);
378int xmlXPathRegisterVariable (xmlXPathContextPtr ctxt,
379 const xmlChar *name,
380 xmlXPathObjectPtr value);
381int xmlXPathRegisterVariableNS (xmlXPathContextPtr ctxt,
382 const xmlChar *name,
383 const xmlChar *ns_uri,
384 xmlXPathObjectPtr value);
385xmlXPathFunction xmlXPathFunctionLookup (xmlXPathContextPtr ctxt,
386 const xmlChar *name);
387xmlXPathFunction xmlXPathFunctionLookupNS (xmlXPathContextPtr ctxt,
388 const xmlChar *name,
389 const xmlChar *ns_uri);
390void xmlXPathRegisteredFuncsCleanup(xmlXPathContextPtr ctxt);
391xmlXPathObjectPtr xmlXPathVariableLookup (xmlXPathContextPtr ctxt,
392 const xmlChar *name);
393xmlXPathObjectPtr xmlXPathVariableLookupNS (xmlXPathContextPtr ctxt,
394 const xmlChar *name,
395 const xmlChar *ns_uri);
396void xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt);
397
398/**
399 * Utilities to extend XPath
400 */
401xmlXPathParserContextPtr
402 xmlXPathNewParserContext (const xmlChar *str,
403 xmlXPathContextPtr ctxt);
404void xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt);
405
406/* TODO: remap to xmlXPathValuePop and Push */
407xmlXPathObjectPtr valuePop (xmlXPathParserContextPtr ctxt);
408int valuePush (xmlXPathParserContextPtr ctxt,
409 xmlXPathObjectPtr value);
410
411xmlXPathObjectPtr xmlXPathNewString (const xmlChar *val);
412xmlXPathObjectPtr xmlXPathNewCString (const char *val);
Daniel Veillardba0b8c92001-05-15 09:43:47 +0000413xmlXPathObjectPtr xmlXPathWrapString (xmlChar *val);
414xmlXPathObjectPtr xmlXPathWrapCString (char *val);
Owen Taylor3473f882001-02-23 17:55:21 +0000415xmlXPathObjectPtr xmlXPathNewFloat (double val);
416xmlXPathObjectPtr xmlXPathNewBoolean (int val);
417xmlXPathObjectPtr xmlXPathNewNodeSet (xmlNodePtr val);
418xmlXPathObjectPtr xmlXPathNewValueTree (xmlNodePtr val);
419void xmlXPathNodeSetAdd (xmlNodeSetPtr cur,
420 xmlNodePtr val);
Daniel Veillard56a4cb82001-03-24 17:00:36 +0000421void xmlXPathNodeSetAddUnique (xmlNodeSetPtr cur,
422 xmlNodePtr val);
423void xmlXPathNodeSetSort (xmlNodeSetPtr set);
Owen Taylor3473f882001-02-23 17:55:21 +0000424
425void xmlXPathIdFunction (xmlXPathParserContextPtr ctxt,
426 int nargs);
427void xmlXPathRoot (xmlXPathParserContextPtr ctxt);
428void xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt);
429xmlChar * xmlXPathParseName (xmlXPathParserContextPtr ctxt);
430xmlChar * xmlXPathParseNCName (xmlXPathParserContextPtr ctxt);
431
432/*
433 * Debug
434 */
435#ifdef LIBXML_DEBUG_ENABLED
Owen Taylor3473f882001-02-23 17:55:21 +0000436void xmlXPathDebugDumpObject(FILE *output, xmlXPathObjectPtr cur, int depth);
437#endif
438/*
439 * Existing functions
440 */
Daniel Veillard017b1082001-06-21 11:20:21 +0000441double xmlXPathStringEvalNumber(const xmlChar *str);
Owen Taylor3473f882001-02-23 17:55:21 +0000442int xmlXPathEvaluatePredicateResult(xmlXPathParserContextPtr ctxt,
443 xmlXPathObjectPtr res);
444void xmlXPathInit(void);
445void xmlXPathStringFunction(xmlXPathParserContextPtr ctxt, int nargs);
446void xmlXPathRegisterAllFunctions(xmlXPathContextPtr ctxt);
447xmlNodeSetPtr xmlXPathNodeSetCreate(xmlNodePtr val);
448void xmlXPathNodeSetAdd(xmlNodeSetPtr cur, xmlNodePtr val);
449xmlNodeSetPtr xmlXPathNodeSetMerge(xmlNodeSetPtr val1, xmlNodeSetPtr val2);
450void xmlXPathNodeSetDel(xmlNodeSetPtr cur, xmlNodePtr val);
451void xmlXPathNodeSetRemove(xmlNodeSetPtr cur, int val);
452void xmlXPathFreeNodeSet(xmlNodeSetPtr obj);
453xmlXPathObjectPtr xmlXPathNewNodeSet(xmlNodePtr val);
454xmlXPathObjectPtr xmlXPathNewNodeSetList(xmlNodeSetPtr val);
455xmlXPathObjectPtr xmlXPathWrapNodeSet(xmlNodeSetPtr val);
Thomas Broyerf06a3d82001-07-16 04:52:57 +0000456 xmlXPathObjectPtr xmlXPathWrapExternal(void *val);
Owen Taylor3473f882001-02-23 17:55:21 +0000457void xmlXPathFreeNodeSetList(xmlXPathObjectPtr obj);
458
459
460xmlXPathObjectPtr xmlXPathNewFloat(double val);
461xmlXPathObjectPtr xmlXPathNewBoolean(int val);
462xmlXPathObjectPtr xmlXPathNewString(const xmlChar *val);
463xmlXPathObjectPtr xmlXPathNewCString(const char *val);
464void xmlXPathFreeObject(xmlXPathObjectPtr obj);
465xmlXPathContextPtr xmlXPathNewContext(xmlDocPtr doc);
466void xmlXPathFreeContext(xmlXPathContextPtr ctxt);
467
468int xmlXPathEqualValues(xmlXPathParserContextPtr ctxt);
469int xmlXPathCompareValues(xmlXPathParserContextPtr ctxt, int inf, int strict);
470void xmlXPathValueFlipSign(xmlXPathParserContextPtr ctxt);
471void xmlXPathAddValues(xmlXPathParserContextPtr ctxt);
472void xmlXPathSubValues(xmlXPathParserContextPtr ctxt);
473void xmlXPathMultValues(xmlXPathParserContextPtr ctxt);
474void xmlXPathDivValues(xmlXPathParserContextPtr ctxt);
475void xmlXPathModValues(xmlXPathParserContextPtr ctxt);
476
Daniel Veillard56a4cb82001-03-24 17:00:36 +0000477int xmlXPathIsNodeType(const xmlChar *name);
Owen Taylor3473f882001-02-23 17:55:21 +0000478
479/*
480 * Some of the axis navigation routines
481 */
Daniel Veillard56a4cb82001-03-24 17:00:36 +0000482xmlNodePtr xmlXPathNextSelf(xmlXPathParserContextPtr ctxt,
483 xmlNodePtr cur);
484xmlNodePtr xmlXPathNextChild(xmlXPathParserContextPtr ctxt,
485 xmlNodePtr cur);
486xmlNodePtr xmlXPathNextDescendant(xmlXPathParserContextPtr ctxt,
487 xmlNodePtr cur);
488xmlNodePtr xmlXPathNextDescendantOrSelf(xmlXPathParserContextPtr ctxt,
489 xmlNodePtr cur);
490xmlNodePtr xmlXPathNextParent(xmlXPathParserContextPtr ctxt,
491 xmlNodePtr cur);
492xmlNodePtr xmlXPathNextAncestorOrSelf(xmlXPathParserContextPtr ctxt,
493 xmlNodePtr cur);
494xmlNodePtr xmlXPathNextFollowingSibling(xmlXPathParserContextPtr ctxt,
495 xmlNodePtr cur);
496xmlNodePtr xmlXPathNextFollowing(xmlXPathParserContextPtr ctxt,
497 xmlNodePtr cur);
498xmlNodePtr xmlXPathNextNamespace(xmlXPathParserContextPtr ctxt,
499 xmlNodePtr cur);
500xmlNodePtr xmlXPathNextAttribute(xmlXPathParserContextPtr ctxt,
501 xmlNodePtr cur);
502xmlNodePtr xmlXPathNextPreceding(xmlXPathParserContextPtr ctxt,
503 xmlNodePtr cur);
504xmlNodePtr xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt,
505 xmlNodePtr cur);
506xmlNodePtr xmlXPathNextPrecedingSibling(xmlXPathParserContextPtr ctxt,
507 xmlNodePtr cur);
Owen Taylor3473f882001-02-23 17:55:21 +0000508/*
509 * The official core of XPath functions
510 */
511void xmlXPathRoot(xmlXPathParserContextPtr ctxt);
512void xmlXPathLastFunction(xmlXPathParserContextPtr ctxt, int nargs);
513void xmlXPathPositionFunction(xmlXPathParserContextPtr ctxt, int nargs);
514void xmlXPathCountFunction(xmlXPathParserContextPtr ctxt, int nargs);
515void xmlXPathIdFunction(xmlXPathParserContextPtr ctxt, int nargs);
516void xmlXPathLocalNameFunction(xmlXPathParserContextPtr ctxt, int nargs);
517void xmlXPathNamespaceURIFunction(xmlXPathParserContextPtr ctxt, int nargs);
518void xmlXPathStringFunction(xmlXPathParserContextPtr ctxt, int nargs);
519void xmlXPathStringLengthFunction(xmlXPathParserContextPtr ctxt, int nargs);
520void xmlXPathConcatFunction(xmlXPathParserContextPtr ctxt, int nargs);
521void xmlXPathContainsFunction(xmlXPathParserContextPtr ctxt, int nargs);
522void xmlXPathStartsWithFunction(xmlXPathParserContextPtr ctxt, int nargs);
523void xmlXPathSubstringFunction(xmlXPathParserContextPtr ctxt, int nargs);
524void xmlXPathSubstringBeforeFunction(xmlXPathParserContextPtr ctxt, int nargs);
525void xmlXPathSubstringAfterFunction(xmlXPathParserContextPtr ctxt, int nargs);
526void xmlXPathNormalizeFunction(xmlXPathParserContextPtr ctxt, int nargs);
527void xmlXPathTranslateFunction(xmlXPathParserContextPtr ctxt, int nargs);
528void xmlXPathNotFunction(xmlXPathParserContextPtr ctxt, int nargs);
529void xmlXPathTrueFunction(xmlXPathParserContextPtr ctxt, int nargs);
530void xmlXPathFalseFunction(xmlXPathParserContextPtr ctxt, int nargs);
531void xmlXPathLangFunction(xmlXPathParserContextPtr ctxt, int nargs);
532void xmlXPathNumberFunction(xmlXPathParserContextPtr ctxt, int nargs);
533void xmlXPathSumFunction(xmlXPathParserContextPtr ctxt, int nargs);
534void xmlXPathFloorFunction(xmlXPathParserContextPtr ctxt, int nargs);
535void xmlXPathCeilingFunction(xmlXPathParserContextPtr ctxt, int nargs);
536void xmlXPathRoundFunction(xmlXPathParserContextPtr ctxt, int nargs);
537void xmlXPathBooleanFunction(xmlXPathParserContextPtr ctxt, int nargs);
538#ifdef __cplusplus
539}
540#endif
541#endif /* ! __XML_XPATH_INTERNALS_H__ */