Daniel Veillard | 1566d3a | 1999-07-15 14:24:29 +0000 | [diff] [blame] | 1 | /* |
| 2 | * xpath.c: interface for XML Path Language implementation |
| 3 | * |
| 4 | * Reference: W3C Working Draft 5 July 1999 |
| 5 | * http://www.w3.org/Style/XSL/Group/1999/07/xpath-19990705.html |
| 6 | * |
| 7 | * See COPYRIGHT for the status of this software |
| 8 | * |
| 9 | * Author: Daniel.Veillard@w3.org |
| 10 | */ |
| 11 | |
| 12 | #ifndef __XML_XPATH_H__ |
| 13 | #define __XML_XPATH_H__ |
| 14 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 15 | #include <libxml/tree.h> |
Daniel Veillard | 52afe80 | 2000-10-22 16:56:02 +0000 | [diff] [blame] | 16 | #include <libxml/hash.h> |
Daniel Veillard | b24054a | 1999-12-18 15:32:46 +0000 | [diff] [blame] | 17 | |
Daniel Veillard | e4e5131 | 1999-12-18 15:32:46 +0000 | [diff] [blame] | 18 | #ifdef __cplusplus |
Daniel Veillard | 5cb5ab8 | 1999-12-21 15:35:29 +0000 | [diff] [blame] | 19 | extern "C" { |
Daniel Veillard | e4e5131 | 1999-12-18 15:32:46 +0000 | [diff] [blame] | 20 | #endif |
Daniel Veillard | 1566d3a | 1999-07-15 14:24:29 +0000 | [diff] [blame] | 21 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 22 | typedef struct _xmlXPathContext xmlXPathContext; |
| 23 | typedef xmlXPathContext *xmlXPathContextPtr; |
| 24 | typedef struct _xmlXPathParserContext xmlXPathParserContext; |
| 25 | typedef xmlXPathParserContext *xmlXPathParserContextPtr; |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 26 | |
Daniel Veillard | 55b91f2 | 2000-10-05 16:30:11 +0000 | [diff] [blame] | 27 | /** |
| 28 | * The set of XPath error codes |
| 29 | */ |
| 30 | |
| 31 | typedef enum { |
| 32 | XPATH_EXPRESSION_OK = 0, |
| 33 | XPATH_NUMBER_ERROR, |
| 34 | XPATH_UNFINISHED_LITERAL_ERROR, |
| 35 | XPATH_START_LITERAL_ERROR, |
| 36 | XPATH_VARIABLE_REF_ERROR, |
| 37 | XPATH_UNDEF_VARIABLE_ERROR, |
| 38 | XPATH_INVALID_PREDICATE_ERROR, |
| 39 | XPATH_EXPR_ERROR, |
| 40 | XPATH_UNCLOSED_ERROR, |
| 41 | XPATH_UNKNOWN_FUNC_ERROR, |
| 42 | XPATH_INVALID_OPERAND, |
| 43 | XPATH_INVALID_TYPE, |
| 44 | XPATH_INVALID_ARITY, |
| 45 | XPATH_INVALID_CTXT_SIZE, |
Daniel Veillard | b71379b | 2000-10-09 12:30:39 +0000 | [diff] [blame] | 46 | XPATH_INVALID_CTXT_POSITION, |
| 47 | XPATH_MEMORY_ERROR, |
| 48 | XPTR_SYNTAX_ERROR, |
| 49 | XPTR_RESOURCE_ERROR, |
| 50 | XPTR_SUB_RESOURCE_ERROR |
Daniel Veillard | 55b91f2 | 2000-10-05 16:30:11 +0000 | [diff] [blame] | 51 | } xmlXPathError; |
| 52 | |
Daniel Veillard | 1566d3a | 1999-07-15 14:24:29 +0000 | [diff] [blame] | 53 | /* |
| 54 | * A node-set (an unordered collection of nodes without duplicates) |
| 55 | */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 56 | typedef struct _xmlNodeSet xmlNodeSet; |
| 57 | typedef xmlNodeSet *xmlNodeSetPtr; |
| 58 | struct _xmlNodeSet { |
Daniel Veillard | be80396 | 2000-06-28 23:40:59 +0000 | [diff] [blame] | 59 | int nodeNr; /* number of nodes in the set */ |
| 60 | int nodeMax; /* size of the array as allocated */ |
Daniel Veillard | 1566d3a | 1999-07-15 14:24:29 +0000 | [diff] [blame] | 61 | xmlNodePtr *nodeTab; /* array of nodes in no particular order */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 62 | }; |
Daniel Veillard | 1566d3a | 1999-07-15 14:24:29 +0000 | [diff] [blame] | 63 | |
| 64 | /* |
| 65 | * An expression is evaluated to yield an object, which |
| 66 | * has one of the following four basic types: |
| 67 | * - node-set |
| 68 | * - boolean |
| 69 | * - number |
| 70 | * - string |
Daniel Veillard | be80396 | 2000-06-28 23:40:59 +0000 | [diff] [blame] | 71 | * |
| 72 | * @@ XPointer will add more types ! |
Daniel Veillard | 1566d3a | 1999-07-15 14:24:29 +0000 | [diff] [blame] | 73 | */ |
| 74 | |
Daniel Veillard | f09e7e3 | 2000-10-01 15:53:30 +0000 | [diff] [blame] | 75 | typedef enum { |
| 76 | XPATH_UNDEFINED = 0, |
| 77 | XPATH_NODESET = 1, |
| 78 | XPATH_BOOLEAN = 2, |
| 79 | XPATH_NUMBER = 3, |
| 80 | XPATH_STRING = 4, |
Daniel Veillard | ac26030 | 2000-10-04 13:33:43 +0000 | [diff] [blame] | 81 | XPATH_POINT = 5, |
| 82 | XPATH_RANGE = 6, |
| 83 | XPATH_LOCATIONSET = 7, |
| 84 | XPATH_USERS = 8 |
Daniel Veillard | f09e7e3 | 2000-10-01 15:53:30 +0000 | [diff] [blame] | 85 | } xmlXPathObjectType; |
Daniel Veillard | 1566d3a | 1999-07-15 14:24:29 +0000 | [diff] [blame] | 86 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 87 | typedef struct _xmlXPathObject xmlXPathObject; |
| 88 | typedef xmlXPathObject *xmlXPathObjectPtr; |
| 89 | struct _xmlXPathObject { |
Daniel Veillard | f09e7e3 | 2000-10-01 15:53:30 +0000 | [diff] [blame] | 90 | xmlXPathObjectType type; |
Daniel Veillard | 1566d3a | 1999-07-15 14:24:29 +0000 | [diff] [blame] | 91 | xmlNodeSetPtr nodesetval; |
| 92 | int boolval; |
Daniel Veillard | e2d034d | 1999-07-27 19:52:06 +0000 | [diff] [blame] | 93 | double floatval; |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 94 | xmlChar *stringval; |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 95 | void *user; |
Daniel Veillard | ac26030 | 2000-10-04 13:33:43 +0000 | [diff] [blame] | 96 | int index; |
| 97 | void *user2; |
| 98 | int index2; |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 99 | }; |
Daniel Veillard | 1566d3a | 1999-07-15 14:24:29 +0000 | [diff] [blame] | 100 | |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 101 | /* |
| 102 | * A conversion function is associated to a type and used to cast |
| 103 | * the new type to primitive values. |
| 104 | */ |
| 105 | typedef int (*xmlXPathConvertFunc) (xmlXPathObjectPtr obj, int type); |
| 106 | |
| 107 | /* |
| 108 | * Extra type: a name and a conversion function. |
| 109 | */ |
| 110 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 111 | typedef struct _xmlXPathType xmlXPathType; |
| 112 | typedef xmlXPathType *xmlXPathTypePtr; |
| 113 | struct _xmlXPathType { |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 114 | const xmlChar *name; /* the type name */ |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 115 | xmlXPathConvertFunc func; /* the conversion function */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 116 | }; |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 117 | |
| 118 | /* |
| 119 | * Extra variable: a name and a value. |
| 120 | */ |
| 121 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 122 | typedef struct _xmlXPathVariable xmlXPathVariable; |
| 123 | typedef xmlXPathVariable *xmlXPathVariablePtr; |
| 124 | struct _xmlXPathVariable { |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 125 | const xmlChar *name; /* the variable name */ |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 126 | xmlXPathObjectPtr value; /* the value */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 127 | }; |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 128 | |
| 129 | /* |
| 130 | * an evaluation function, the parameters are on the context stack |
| 131 | */ |
| 132 | |
| 133 | typedef void (*xmlXPathEvalFunc)(xmlXPathParserContextPtr ctxt, int nargs); |
| 134 | |
| 135 | /* |
| 136 | * Extra function: a name and a evaluation function. |
| 137 | */ |
| 138 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 139 | typedef struct _xmlXPathFunct xmlXPathFunct; |
| 140 | typedef xmlXPathFunct *xmlXPathFuncPtr; |
| 141 | struct _xmlXPathFunct { |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 142 | const xmlChar *name; /* the function name */ |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 143 | xmlXPathEvalFunc func; /* the evaluation function */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 144 | }; |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 145 | |
| 146 | /* |
| 147 | * An axis traversal function. To traverse an axis, the engine calls |
| 148 | * the first time with cur == NULL and repeat until the function returns |
| 149 | * NULL indicating the end of the axis traversal. |
| 150 | */ |
| 151 | |
| 152 | typedef xmlXPathObjectPtr (*xmlXPathAxisFunc) (xmlXPathParserContextPtr ctxt, |
| 153 | xmlXPathObjectPtr cur); |
| 154 | |
| 155 | /* |
| 156 | * Extra axis: a name and an axis function. |
| 157 | */ |
| 158 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 159 | typedef struct _xmlXPathAxis xmlXPathAxis; |
| 160 | typedef xmlXPathAxis *xmlXPathAxisPtr; |
| 161 | struct _xmlXPathAxis { |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 162 | const xmlChar *name; /* the axis name */ |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 163 | xmlXPathAxisFunc func; /* the search function */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 164 | }; |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 165 | |
Daniel Veillard | 1566d3a | 1999-07-15 14:24:29 +0000 | [diff] [blame] | 166 | /* |
| 167 | * Expression evaluation occurs with respect to a context. |
| 168 | * he context consists of: |
| 169 | * - a node (the context node) |
| 170 | * - a node list (the context node list) |
| 171 | * - a set of variable bindings |
| 172 | * - a function library |
| 173 | * - the set of namespace declarations in scope for the expression |
| 174 | */ |
| 175 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 176 | struct _xmlXPathContext { |
Daniel Veillard | 1566d3a | 1999-07-15 14:24:29 +0000 | [diff] [blame] | 177 | xmlDocPtr doc; /* The current document */ |
| 178 | xmlNodePtr node; /* The current node */ |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 179 | |
Daniel Veillard | 126f279 | 2000-10-24 17:10:12 +0000 | [diff] [blame^] | 180 | int nb_variables_unused; /* unused (hash table) */ |
| 181 | int max_variables_unused; /* unused (hash table) */ |
| 182 | xmlHashTablePtr varHash; /* Hash table of defined variables */ |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 183 | |
| 184 | int nb_types; /* number of defined types */ |
| 185 | int max_types; /* max number of types */ |
Daniel Veillard | c2df4cd | 2000-10-12 23:15:24 +0000 | [diff] [blame] | 186 | xmlXPathTypePtr types; /* Array of defined types */ |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 187 | |
Daniel Veillard | 52afe80 | 2000-10-22 16:56:02 +0000 | [diff] [blame] | 188 | int nb_funcs_unused; /* unused (hash table) */ |
| 189 | int max_funcs_unused; /* unused (hash table) */ |
| 190 | xmlHashTablePtr funcHash; /* Hash table of defined funcs */ |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 191 | |
| 192 | int nb_axis; /* number of defined axis */ |
| 193 | int max_axis; /* max number of axis */ |
Daniel Veillard | c2df4cd | 2000-10-12 23:15:24 +0000 | [diff] [blame] | 194 | xmlXPathAxisPtr axis; /* Array of defined axis */ |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 195 | |
| 196 | /* Namespace traversal should be implemented with user */ |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 197 | xmlNsPtr *namespaces; /* The namespaces lookup */ |
| 198 | int nsNr; /* the current Namespace index */ |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 199 | void *user; /* user defined extra info */ |
Daniel Veillard | f09e7e3 | 2000-10-01 15:53:30 +0000 | [diff] [blame] | 200 | |
| 201 | /* extra variables */ |
| 202 | int contextSize; /* the context size */ |
| 203 | int proximityPosition; /* the proximity position */ |
Daniel Veillard | ac26030 | 2000-10-04 13:33:43 +0000 | [diff] [blame] | 204 | |
| 205 | /* extra stuff for XPointer */ |
| 206 | int xptr; /* it this an XPointer context */ |
| 207 | xmlNodePtr here; /* for here() */ |
| 208 | xmlNodePtr origin; /* for origin() */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 209 | }; |
Daniel Veillard | 1566d3a | 1999-07-15 14:24:29 +0000 | [diff] [blame] | 210 | |
| 211 | /* |
| 212 | * An XPath parser context, it contains pure parsing informations, |
| 213 | * an xmlXPathContext, and the stack of objects. |
| 214 | */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 215 | struct _xmlXPathParserContext { |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 216 | const xmlChar *cur; /* the current char being parsed */ |
| 217 | const xmlChar *base; /* the full expression */ |
Daniel Veillard | 1566d3a | 1999-07-15 14:24:29 +0000 | [diff] [blame] | 218 | |
| 219 | int error; /* error code */ |
| 220 | |
| 221 | xmlXPathContextPtr context; /* the evaluation context */ |
| 222 | xmlXPathObjectPtr value; /* the current value */ |
| 223 | int valueNr; /* number of values stacked */ |
| 224 | int valueMax; /* max number of values stacked */ |
| 225 | xmlXPathObjectPtr *valueTab; /* stack of values */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 226 | }; |
Daniel Veillard | 1566d3a | 1999-07-15 14:24:29 +0000 | [diff] [blame] | 227 | |
| 228 | /* |
| 229 | * An XPath function |
| 230 | * The arguments (if any) are popped out of the context stack |
| 231 | * and the result is pushed on the stack. |
| 232 | */ |
| 233 | |
| 234 | typedef void (*xmlXPathFunction) (xmlXPathParserContextPtr ctxt, int nargs); |
| 235 | |
| 236 | /************************************************************************ |
| 237 | * * |
Daniel Veillard | 55b91f2 | 2000-10-05 16:30:11 +0000 | [diff] [blame] | 238 | * Helpers * |
| 239 | * * |
| 240 | ************************************************************************/ |
| 241 | |
| 242 | #define CHECK_ERROR \ |
| 243 | if (ctxt->error != XPATH_EXPRESSION_OK) return |
| 244 | |
| 245 | #define CHECK_ERROR0 \ |
| 246 | if (ctxt->error != XPATH_EXPRESSION_OK) return(0) |
| 247 | |
| 248 | #define XP_ERROR(X) \ |
| 249 | { xmlXPatherror(ctxt, __FILE__, __LINE__, X); \ |
| 250 | ctxt->error = (X); return; } |
| 251 | |
| 252 | #define XP_ERROR0(X) \ |
| 253 | { xmlXPatherror(ctxt, __FILE__, __LINE__, X); \ |
| 254 | ctxt->error = (X); return(0); } |
| 255 | |
| 256 | #define CHECK_TYPE(typeval) \ |
| 257 | if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \ |
| 258 | XP_ERROR(XPATH_INVALID_TYPE) \ |
| 259 | |
| 260 | #define CHECK_ARITY(x) \ |
| 261 | if (nargs != (x)) { \ |
| 262 | XP_ERROR(XPATH_INVALID_ARITY); \ |
| 263 | } \ |
| 264 | |
| 265 | void xmlXPatherror (xmlXPathParserContextPtr ctxt, |
| 266 | const char *file, |
| 267 | int line, |
| 268 | int no); |
| 269 | |
Daniel Veillard | c2df4cd | 2000-10-12 23:15:24 +0000 | [diff] [blame] | 270 | void xmlXPathDebugDumpObject (FILE *output, |
| 271 | xmlXPathObjectPtr cur, |
| 272 | int depth); |
| 273 | |
Daniel Veillard | 55b91f2 | 2000-10-05 16:30:11 +0000 | [diff] [blame] | 274 | /** |
Daniel Veillard | b71379b | 2000-10-09 12:30:39 +0000 | [diff] [blame] | 275 | * Utilities to extend XPath (XPointer) |
Daniel Veillard | 55b91f2 | 2000-10-05 16:30:11 +0000 | [diff] [blame] | 276 | */ |
Daniel Veillard | b71379b | 2000-10-09 12:30:39 +0000 | [diff] [blame] | 277 | xmlXPathParserContextPtr |
| 278 | xmlXPathNewParserContext (const xmlChar *str, |
| 279 | xmlXPathContextPtr ctxt); |
| 280 | void xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt); |
| 281 | |
Daniel Veillard | 55b91f2 | 2000-10-05 16:30:11 +0000 | [diff] [blame] | 282 | xmlXPathObjectPtr valuePop (xmlXPathParserContextPtr ctxt); |
| 283 | int valuePush (xmlXPathParserContextPtr ctxt, |
Daniel Veillard | 7e99c63 | 2000-10-06 12:59:53 +0000 | [diff] [blame] | 284 | xmlXPathObjectPtr value); |
| 285 | |
| 286 | xmlXPathObjectPtr xmlXPathNewString (const xmlChar *val); |
Daniel Veillard | 683cb02 | 2000-10-22 12:04:13 +0000 | [diff] [blame] | 287 | xmlXPathObjectPtr xmlXPathNewCString (const char *val); |
| 288 | xmlXPathObjectPtr xmlXPathNewFloat (double val); |
| 289 | xmlXPathObjectPtr xmlXPathNewBoolean (int val); |
Daniel Veillard | 7e99c63 | 2000-10-06 12:59:53 +0000 | [diff] [blame] | 290 | xmlXPathObjectPtr xmlXPathNewNodeSet (xmlNodePtr val); |
| 291 | void xmlXPathNodeSetAdd (xmlNodeSetPtr cur, |
| 292 | xmlNodePtr val); |
| 293 | |
| 294 | |
| 295 | void xmlXPathIdFunction (xmlXPathParserContextPtr ctxt, |
| 296 | int nargs); |
| 297 | void xmlXPathRoot (xmlXPathParserContextPtr ctxt); |
| 298 | void xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt); |
Daniel Veillard | 2d38f04 | 2000-10-11 10:54:10 +0000 | [diff] [blame] | 299 | xmlChar * xmlXPathParseName (xmlXPathParserContextPtr ctxt); |
Daniel Veillard | 55b91f2 | 2000-10-05 16:30:11 +0000 | [diff] [blame] | 300 | |
| 301 | /************************************************************************ |
| 302 | * * |
Daniel Veillard | 1566d3a | 1999-07-15 14:24:29 +0000 | [diff] [blame] | 303 | * Public API * |
| 304 | * * |
| 305 | ************************************************************************/ |
| 306 | |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 307 | /** |
Daniel Veillard | 2d38f04 | 2000-10-11 10:54:10 +0000 | [diff] [blame] | 308 | * Extending a context |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 309 | */ |
Daniel Veillard | 2d38f04 | 2000-10-11 10:54:10 +0000 | [diff] [blame] | 310 | int xmlXPathRegisterFunc (xmlXPathContextPtr ctxt, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 311 | const xmlChar *name, |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 312 | xmlXPathFunction f); |
Daniel Veillard | 2d38f04 | 2000-10-11 10:54:10 +0000 | [diff] [blame] | 313 | int xmlXPathRegisterVariable (xmlXPathContextPtr ctxt, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 314 | const xmlChar *name, |
Daniel Veillard | 2d38f04 | 2000-10-11 10:54:10 +0000 | [diff] [blame] | 315 | xmlXPathObjectPtr value); |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 316 | |
| 317 | /** |
| 318 | * Evaluation functions. |
| 319 | */ |
Daniel Veillard | ac26030 | 2000-10-04 13:33:43 +0000 | [diff] [blame] | 320 | void xmlXPathInit (void); |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 321 | xmlXPathContextPtr xmlXPathNewContext (xmlDocPtr doc); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 322 | void xmlXPathFreeContext (xmlXPathContextPtr ctxt); |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 323 | xmlXPathObjectPtr xmlXPathEval (const xmlChar *str, |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 324 | xmlXPathContextPtr ctxt); |
Daniel Veillard | ac26030 | 2000-10-04 13:33:43 +0000 | [diff] [blame] | 325 | xmlXPathObjectPtr xmlXPathEvalXPtrExpr (const xmlChar *str, |
| 326 | xmlXPathContextPtr ctxt); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 327 | void xmlXPathFreeObject (xmlXPathObjectPtr obj); |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 328 | xmlXPathObjectPtr xmlXPathEvalExpression (const xmlChar *str, |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 329 | xmlXPathContextPtr ctxt); |
Daniel Veillard | dbfd641 | 1999-12-28 16:35:14 +0000 | [diff] [blame] | 330 | xmlNodeSetPtr xmlXPathNodeSetCreate (xmlNodePtr val); |
| 331 | void xmlXPathFreeNodeSetList (xmlXPathObjectPtr obj); |
| 332 | void xmlXPathFreeNodeSet (xmlNodeSetPtr obj); |
Daniel Veillard | 2d38f04 | 2000-10-11 10:54:10 +0000 | [diff] [blame] | 333 | xmlXPathObjectPtr xmlXPathObjectCopy (xmlXPathObjectPtr val); |
Daniel Veillard | 1566d3a | 1999-07-15 14:24:29 +0000 | [diff] [blame] | 334 | |
Daniel Veillard | 55b91f2 | 2000-10-05 16:30:11 +0000 | [diff] [blame] | 335 | |
Daniel Veillard | e4e5131 | 1999-12-18 15:32:46 +0000 | [diff] [blame] | 336 | #ifdef __cplusplus |
| 337 | } |
| 338 | #endif |
Daniel Veillard | 1566d3a | 1999-07-15 14:24:29 +0000 | [diff] [blame] | 339 | #endif /* ! __XML_XPATH_H__ */ |