blob: 70c8013d7d18d7ff5650eb69c290c50a0b96d72a [file] [log] [blame]
Daniel Veillardd4330462003-04-29 12:40:16 +00001<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>xpath</title><meta name="generator" content="DocBook XSL Stylesheets V1.58.1"><style xmlns="http://www.w3.org/TR/xhtml1/transitional" type="text/css">
2 .synopsis, .classsynopsis {
3 background: #eeeeee;
4 border: solid 1px #aaaaaa;
5 padding: 0.5em;
6 }
7 .programlisting {
8 background: #eeeeff;
9 border: solid 1px #aaaaff;
10 padding: 0.5em;
11 }
12 .variablelist {
13 padding: 4px;
14 margin-left: 3em;
15 }
16 .navigation {
17 background: #ffeeee;
18 border: solid 1px #ffaaaa;
19 margin-top: 0.5em;
20 margin-bottom: 0.5em;
21 }
22 .navigation a {
23 color: #770000;
24 }
25 .navigation a:visited {
26 color: #550000;
27 }
28 .navigation .title {
29 font-size: 200%;
30 }
31 </style><link rel="home" href="index.html" title="Gnome XML Library Reference Manual"><link rel="up" href="libxml-lib.html" title="Libxml Library Reference"><link rel="previous" href="libxml-HTMLtree.html" title="HTMLtree"><link rel="next" href="libxml-xpathInternals.html" title="xpathInternals"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-HTMLtree.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></img></a></td><td><a accesskey="u" href="libxml-lib.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></img></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></img></a></td><th width="100%" align="center">Gnome XML Library Reference Manual</th><td><a accesskey="n" href="libxml-xpathInternals.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></img></a></td></tr></table><div class="refentry" lang="en"><a name="libxml-xpath"></a><div class="titlepage"></div><div class="refnamediv"><h2>xpath</h2><p>xpath &#8212; </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
Daniel Veillard1566d3a1999-07-15 14:24:29 +000032
Daniel Veillardd4330462003-04-29 12:40:16 +000033
34
35struct <a href="libxml-xpath.html#xmlXPathContext">xmlXPathContext</a>;
36typedef <a href="libxml-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a>;
37struct <a href="libxml-xpath.html#xmlXPathParserContext">xmlXPathParserContext</a>;
38typedef <a href="libxml-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a>;
39enum <a href="libxml-xpath.html#xmlXPathError">xmlXPathError</a>;
40struct <a href="libxml-xpath.html#xmlNodeSet">xmlNodeSet</a>;
41typedef <a href="libxml-xpath.html#xmlNodeSetPtr">xmlNodeSetPtr</a>;
42enum <a href="libxml-xpath.html#xmlXPathObjectType">xmlXPathObjectType</a>;
43struct <a href="libxml-xpath.html#xmlXPathObject">xmlXPathObject</a>;
44typedef <a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>;
45int (<a href="libxml-xpath.html#xmlXPathConvertFunc">*xmlXPathConvertFunc</a>) (<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> obj,
Daniel Veillard7f7d1111999-09-22 09:46:25 +000046 int type);
Daniel Veillardd4330462003-04-29 12:40:16 +000047struct <a href="libxml-xpath.html#xmlXPathType">xmlXPathType</a>;
48typedef <a href="libxml-xpath.html#xmlXPathTypePtr">xmlXPathTypePtr</a>;
49struct <a href="libxml-xpath.html#xmlXPathVariable">xmlXPathVariable</a>;
50typedef <a href="libxml-xpath.html#xmlXPathVariablePtr">xmlXPathVariablePtr</a>;
51void (<a href="libxml-xpath.html#xmlXPathEvalFunc">*xmlXPathEvalFunc</a>) (<a href="libxml-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt,
Daniel Veillard7f7d1111999-09-22 09:46:25 +000052 int nargs);
Daniel Veillardd4330462003-04-29 12:40:16 +000053struct <a href="libxml-xpath.html#xmlXPathFunct">xmlXPathFunct</a>;
54typedef <a href="libxml-xpath.html#xmlXPathFuncPtr">xmlXPathFuncPtr</a>;
55<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> (<a href="libxml-xpath.html#xmlXPathAxisFunc">*xmlXPathAxisFunc</a>) (<a href="libxml-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt,
56 <a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> cur);
57struct <a href="libxml-xpath.html#xmlXPathAxis">xmlXPathAxis</a>;
58typedef <a href="libxml-xpath.html#xmlXPathAxisPtr">xmlXPathAxisPtr</a>;
59struct <a href="libxml-xpath.html#xmlXPathCompExpr">xmlXPathCompExpr</a>;
60typedef <a href="libxml-xpath.html#xmlXPathCompExprPtr">xmlXPathCompExprPtr</a>;
61void (<a href="libxml-xpath.html#xmlXPathFunction">*xmlXPathFunction</a>) (<a href="libxml-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt,
Daniel Veillard06622df2002-01-21 17:53:42 +000062 int nargs);
Daniel Veillardd4330462003-04-29 12:40:16 +000063int <a href="libxml-xpath.html#xmlXPathIsNaN">xmlXPathIsNaN</a> (<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="double">double</GTKDOCLINK> val);
64int <a href="libxml-xpath.html#xmlXPathIsInf">xmlXPathIsInf</a> (<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="double">double</GTKDOCLINK> val);
65#define <a href="libxml-xpath.html#xmlXPathNodeSetGetLength">xmlXPathNodeSetGetLength</a> (ns)
66#define <a href="libxml-xpath.html#xmlXPathNodeSetItem">xmlXPathNodeSetItem</a> (ns, index)
67#define <a href="libxml-xpath.html#xmlXPathNodeSetIsEmpty">xmlXPathNodeSetIsEmpty</a> (ns)
68void <a href="libxml-xpath.html#xmlXPathFreeObject">xmlXPathFreeObject</a> (<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> obj);
69<a href="libxml-xpath.html#xmlNodeSetPtr">xmlNodeSetPtr</a> <a href="libxml-xpath.html#xmlXPathNodeSetCreate">xmlXPathNodeSetCreate</a> (<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> val);
70void <a href="libxml-xpath.html#xmlXPathFreeNodeSetList">xmlXPathFreeNodeSetList</a> (<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> obj);
71void <a href="libxml-xpath.html#xmlXPathFreeNodeSet">xmlXPathFreeNodeSet</a> (<a href="libxml-xpath.html#xmlNodeSetPtr">xmlNodeSetPtr</a> obj);
72<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> <a href="libxml-xpath.html#xmlXPathObjectCopy">xmlXPathObjectCopy</a> (<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> val);
73int <a href="libxml-xpath.html#xmlXPathCmpNodes">xmlXPathCmpNodes</a> (<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node1,
74 <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node2);
75int <a href="libxml-xpath.html#xmlXPathCastNumberToBoolean">xmlXPathCastNumberToBoolean</a> (<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="double">double</GTKDOCLINK> val);
76int <a href="libxml-xpath.html#xmlXPathCastStringToBoolean">xmlXPathCastStringToBoolean</a> (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *val);
77int <a href="libxml-xpath.html#xmlXPathCastNodeSetToBoolean">xmlXPathCastNodeSetToBoolean</a> (<a href="libxml-xpath.html#xmlNodeSetPtr">xmlNodeSetPtr</a> ns);
78int <a href="libxml-xpath.html#xmlXPathCastToBoolean">xmlXPathCastToBoolean</a> (<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> val);
79<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="double">double</GTKDOCLINK> <a href="libxml-xpath.html#xmlXPathCastBooleanToNumber">xmlXPathCastBooleanToNumber</a> (int val);
80<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="double">double</GTKDOCLINK> <a href="libxml-xpath.html#xmlXPathCastStringToNumber">xmlXPathCastStringToNumber</a> (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *val);
81<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="double">double</GTKDOCLINK> <a href="libxml-xpath.html#xmlXPathCastNodeToNumber">xmlXPathCastNodeToNumber</a> (<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node);
82<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="double">double</GTKDOCLINK> <a href="libxml-xpath.html#xmlXPathCastNodeSetToNumber">xmlXPathCastNodeSetToNumber</a> (<a href="libxml-xpath.html#xmlNodeSetPtr">xmlNodeSetPtr</a> ns);
83<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="double">double</GTKDOCLINK> <a href="libxml-xpath.html#xmlXPathCastToNumber">xmlXPathCastToNumber</a> (<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> val);
84<a href="libxml-tree.html#xmlChar">xmlChar</a>* <a href="libxml-xpath.html#xmlXPathCastBooleanToString">xmlXPathCastBooleanToString</a> (int val);
85<a href="libxml-tree.html#xmlChar">xmlChar</a>* <a href="libxml-xpath.html#xmlXPathCastNumberToString">xmlXPathCastNumberToString</a> (<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="double">double</GTKDOCLINK> val);
86<a href="libxml-tree.html#xmlChar">xmlChar</a>* <a href="libxml-xpath.html#xmlXPathCastNodeToString">xmlXPathCastNodeToString</a> (<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node);
87<a href="libxml-tree.html#xmlChar">xmlChar</a>* <a href="libxml-xpath.html#xmlXPathCastNodeSetToString">xmlXPathCastNodeSetToString</a> (<a href="libxml-xpath.html#xmlNodeSetPtr">xmlNodeSetPtr</a> ns);
88<a href="libxml-tree.html#xmlChar">xmlChar</a>* <a href="libxml-xpath.html#xmlXPathCastToString">xmlXPathCastToString</a> (<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> val);
89<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> <a href="libxml-xpath.html#xmlXPathConvertBoolean">xmlXPathConvertBoolean</a> (<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> val);
90<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> <a href="libxml-xpath.html#xmlXPathConvertNumber">xmlXPathConvertNumber</a> (<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> val);
91<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> <a href="libxml-xpath.html#xmlXPathConvertString">xmlXPathConvertString</a> (<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> val);
92void <a href="libxml-xpath.html#xmlXPathInit">xmlXPathInit</a> (void);
93<a href="libxml-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> <a href="libxml-xpath.html#xmlXPathNewContext">xmlXPathNewContext</a> (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc);
94void <a href="libxml-xpath.html#xmlXPathFreeContext">xmlXPathFreeContext</a> (<a href="libxml-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> ctxt);
95<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="long">long</GTKDOCLINK> <a href="libxml-xpath.html#xmlXPathOrderDocElems">xmlXPathOrderDocElems</a> (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc);
96<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> <a href="libxml-xpath.html#xmlXPathEval">xmlXPathEval</a> (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str,
97 <a href="libxml-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> ctx);
98<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> <a href="libxml-xpath.html#xmlXPathEvalExpression">xmlXPathEvalExpression</a> (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str,
99 <a href="libxml-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> ctxt);
100int <a href="libxml-xpath.html#xmlXPathEvalPredicate">xmlXPathEvalPredicate</a> (<a href="libxml-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> ctxt,
101 <a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> res);
102<a href="libxml-xpath.html#xmlXPathCompExprPtr">xmlXPathCompExprPtr</a> <a href="libxml-xpath.html#xmlXPathCompile">xmlXPathCompile</a> (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str);
103<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> <a href="libxml-xpath.html#xmlXPathCompiledEval">xmlXPathCompiledEval</a> (<a href="libxml-xpath.html#xmlXPathCompExprPtr">xmlXPathCompExprPtr</a> comp,
104 <a href="libxml-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> ctx);
105void <a href="libxml-xpath.html#xmlXPathFreeCompExpr">xmlXPathFreeCompExpr</a> (<a href="libxml-xpath.html#xmlXPathCompExprPtr">xmlXPathCompExprPtr</a> comp);
106</pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
107
108</p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="xmlXPathContext"></a>struct xmlXPathContext</h3><pre class="programlisting">struct xmlXPathContext {
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000109 xmlDocPtr doc; /* The current document */
110 xmlNodePtr node; /* The current node */
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000111
Daniel Veillard29a11cc2000-10-25 13:32:39 +0000112 int nb_variables_unused; /* unused (hash table) */
113 int max_variables_unused; /* unused (hash table) */
114 xmlHashTablePtr varHash; /* Hash table of defined variables */
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000115
116 int nb_types; /* number of defined types */
117 int max_types; /* max number of types */
Daniel Veillardb732a0e2000-10-15 11:27:01 +0000118 xmlXPathTypePtr types; /* Array of defined types */
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000119
Daniel Veillard29a11cc2000-10-25 13:32:39 +0000120 int nb_funcs_unused; /* unused (hash table) */
121 int max_funcs_unused; /* unused (hash table) */
122 xmlHashTablePtr funcHash; /* Hash table of defined funcs */
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000123
124 int nb_axis; /* number of defined axis */
125 int max_axis; /* max number of axis */
Daniel Veillardb732a0e2000-10-15 11:27:01 +0000126 xmlXPathAxisPtr axis; /* Array of defined axis */
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000127
Daniel Veillard503b8932001-01-05 06:36:31 +0000128 /* the namespace nodes of the context node */
129 xmlNsPtr *namespaces; /* Array of namespaces */
130 int nsNr; /* number of namespace in scope */
131 void *user; /* function to free */
Daniel Veillard3bff2b02000-10-01 20:33:47 +0000132
133 /* extra variables */
134 int contextSize; /* the context size */
135 int proximityPosition; /* the proximity position */
Daniel Veillard7e99c632000-10-06 12:59:53 +0000136
137 /* extra stuff for XPointer */
138 int xptr; /* it this an XPointer context */
139 xmlNodePtr here; /* for here() */
140 xmlNodePtr origin; /* for origin() */
Daniel Veillard503b8932001-01-05 06:36:31 +0000141
142 /* the set of namespace declarations in scope for the expression */
143 xmlHashTablePtr nsHash; /* The namespaces hash table */
Daniel Veillard9cb5ff42001-01-29 08:22:21 +0000144 void *varLookupFunc; /* variable lookup func */
145 void *varLookupData; /* variable lookup data */
146
147 /* Possibility to link in an extra item */
148 void *extra; /* needed for XSLT */
Daniel Veillard4ec885a2001-06-17 10:31:07 +0000149
150 /* The function name and URI when calling a function */
151 const xmlChar *function;
152 const xmlChar *functionURI;
Daniel Veillarde7ead2d2001-08-22 23:44:09 +0000153
154 /* function lookup function and data */
155 void *funcLookupFunc; /* function lookup func */
156 void *funcLookupData; /* function lookup data */
157
158 /* temporary namespace lists kept for walking the namespace axis */
159 xmlNsPtr *tmpNsList; /* Array of namespaces */
160 int tmpNsNr; /* number of namespace in scope */
Daniel Veillardd4330462003-04-29 12:40:16 +0000161};
162</pre><p>
163Expression evaluation occurs with respect to a context.
Daniel Veillarde7ead2d2001-08-22 23:44:09 +0000164he context consists of:
Daniel Veillardaec63562003-03-23 20:42:17 +0000165 - a node (the context node)
166 - a node list (the context node list)
167 - a set of variable bindings
168 - a function library
169 - the set of namespace declarations in scope for the expression
Daniel Veillarde7ead2d2001-08-22 23:44:09 +0000170Following the switch to hash tables, this need to be trimmed up at
Daniel Veillardd4330462003-04-29 12:40:16 +0000171the next binary incompatible release.</p><p>
172
Daniel Veillardd7cec922003-06-13 12:30:10 +0000173</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathContextPtr"></a>xmlXPathContextPtr</h3><pre class="programlisting">typedef xmlXPathContext *xmlXPathContextPtr;
174</pre><p>
Daniel Veillardd4330462003-04-29 12:40:16 +0000175
176</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathParserContext"></a>struct xmlXPathParserContext</h3><pre class="programlisting">struct xmlXPathParserContext {
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000177 const xmlChar *cur; /* the current char being parsed */
178 const xmlChar *base; /* the full expression */
179
180 int error; /* error code */
181
182 xmlXPathContextPtr context; /* the evaluation context */
183 xmlXPathObjectPtr value; /* the current value */
184 int valueNr; /* number of values stacked */
185 int valueMax; /* max number of values stacked */
186 xmlXPathObjectPtr *valueTab; /* stack of values */
Daniel Veillardc7ad7ce2001-03-22 21:45:29 +0000187
188 xmlXPathCompExprPtr comp; /* the precompiled expression */
189 int xptr; /* it this an XPointer expression */
Daniel Veillard4b8328d2001-07-05 22:48:42 +0000190 xmlNodePtr ancestor; /* used for walking preceding axis */
Daniel Veillardd4330462003-04-29 12:40:16 +0000191};
192</pre><p>
193An XPath parser context. It contains pure parsing informations,
194an xmlXPathContext, and the stack of objects.</p><p>
195
Daniel Veillardd7cec922003-06-13 12:30:10 +0000196</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathParserContextPtr"></a>xmlXPathParserContextPtr</h3><pre class="programlisting">typedef xmlXPathParserContext *xmlXPathParserContextPtr;
197</pre><p>
Daniel Veillardd4330462003-04-29 12:40:16 +0000198
199</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathError"></a>enum xmlXPathError</h3><pre class="programlisting">typedef enum {
Daniel Veillard7e99c632000-10-06 12:59:53 +0000200 XPATH_EXPRESSION_OK = 0,
201 XPATH_NUMBER_ERROR,
202 XPATH_UNFINISHED_LITERAL_ERROR,
203 XPATH_START_LITERAL_ERROR,
204 XPATH_VARIABLE_REF_ERROR,
205 XPATH_UNDEF_VARIABLE_ERROR,
206 XPATH_INVALID_PREDICATE_ERROR,
207 XPATH_EXPR_ERROR,
208 XPATH_UNCLOSED_ERROR,
209 XPATH_UNKNOWN_FUNC_ERROR,
210 XPATH_INVALID_OPERAND,
211 XPATH_INVALID_TYPE,
212 XPATH_INVALID_ARITY,
213 XPATH_INVALID_CTXT_SIZE,
Daniel Veillardb732a0e2000-10-15 11:27:01 +0000214 XPATH_INVALID_CTXT_POSITION,
215 XPATH_MEMORY_ERROR,
216 XPTR_SYNTAX_ERROR,
217 XPTR_RESOURCE_ERROR,
Daniel Veillard503b8932001-01-05 06:36:31 +0000218 XPTR_SUB_RESOURCE_ERROR,
Daniel Veillard3bbbe6f2001-05-03 11:15:37 +0000219 XPATH_UNDEF_PREFIX_ERROR,
220 XPATH_ENCODING_ERROR,
221 XPATH_INVALID_CHAR_ERROR
Daniel Veillardd4330462003-04-29 12:40:16 +0000222} xmlXPathError;
223</pre><p>
224
225</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNodeSet"></a>struct xmlNodeSet</h3><pre class="programlisting">struct xmlNodeSet {
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000226 int nodeNr; /* number of nodes in the set */
227 int nodeMax; /* size of the array as allocated */
228 xmlNodePtr *nodeTab; /* array of nodes in no particular order */
Daniel Veillardaf43f632002-03-08 15:05:20 +0000229 /* @@ with_ns to check wether namespace nodes should be looked at @@ */
Daniel Veillardd4330462003-04-29 12:40:16 +0000230};
231</pre><p>
232
Daniel Veillardd7cec922003-06-13 12:30:10 +0000233</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNodeSetPtr"></a>xmlNodeSetPtr</h3><pre class="programlisting">typedef xmlNodeSet *xmlNodeSetPtr;
234</pre><p>
Daniel Veillardd4330462003-04-29 12:40:16 +0000235
236</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathObjectType"></a>enum xmlXPathObjectType</h3><pre class="programlisting">typedef enum {
Daniel Veillard3bff2b02000-10-01 20:33:47 +0000237 XPATH_UNDEFINED = 0,
238 XPATH_NODESET = 1,
239 XPATH_BOOLEAN = 2,
240 XPATH_NUMBER = 3,
241 XPATH_STRING = 4,
Daniel Veillard7e99c632000-10-06 12:59:53 +0000242 XPATH_POINT = 5,
243 XPATH_RANGE = 6,
244 XPATH_LOCATIONSET = 7,
Daniel Veillard9cb5ff42001-01-29 08:22:21 +0000245 XPATH_USERS = 8,
246 XPATH_XSLT_TREE = 9 /* An XSLT value tree, non modifiable */
Daniel Veillardd4330462003-04-29 12:40:16 +0000247} xmlXPathObjectType;
248</pre><p>
249
250</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathObject"></a>struct xmlXPathObject</h3><pre class="programlisting">struct xmlXPathObject {
Daniel Veillard3bff2b02000-10-01 20:33:47 +0000251 xmlXPathObjectType type;
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000252 xmlNodeSetPtr nodesetval;
253 int boolval;
254 double floatval;
255 xmlChar *stringval;
256 void *user;
Daniel Veillard7e99c632000-10-06 12:59:53 +0000257 int index;
258 void *user2;
259 int index2;
Daniel Veillardd4330462003-04-29 12:40:16 +0000260};
261</pre><p>
262
Daniel Veillardd7cec922003-06-13 12:30:10 +0000263</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathObjectPtr"></a>xmlXPathObjectPtr</h3><pre class="programlisting">typedef xmlXPathObject *xmlXPathObjectPtr;
264</pre><p>
Daniel Veillardd4330462003-04-29 12:40:16 +0000265
266</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathConvertFunc"></a>xmlXPathConvertFunc ()</h3><pre class="programlisting">int (*xmlXPathConvertFunc) (<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> obj,
267 int type);</pre><p>
268A conversion function is associated to a type and used to cast
269the new type to primitive values.</p><p>
270
Daniel Veillardd7cec922003-06-13 12:30:10 +0000271</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>obj</tt></i> :</span></td><td> an XPath object
272</td></tr><tr><td><span class="term"><i><tt>type</tt></i> :</span></td><td> the number of the target type
273</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>-1 in case of error, 0 otherwise
Daniel Veillardd4330462003-04-29 12:40:16 +0000274</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathType"></a>struct xmlXPathType</h3><pre class="programlisting">struct xmlXPathType {
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000275 const xmlChar *name; /* the type name */
276 xmlXPathConvertFunc func; /* the conversion function */
Daniel Veillardd4330462003-04-29 12:40:16 +0000277};
278</pre><p>
279
Daniel Veillardd7cec922003-06-13 12:30:10 +0000280</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathTypePtr"></a>xmlXPathTypePtr</h3><pre class="programlisting">typedef xmlXPathType *xmlXPathTypePtr;
281</pre><p>
Daniel Veillardd4330462003-04-29 12:40:16 +0000282
283</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathVariable"></a>struct xmlXPathVariable</h3><pre class="programlisting">struct xmlXPathVariable {
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000284 const xmlChar *name; /* the variable name */
285 xmlXPathObjectPtr value; /* the value */
Daniel Veillardd4330462003-04-29 12:40:16 +0000286};
287</pre><p>
288
Daniel Veillardd7cec922003-06-13 12:30:10 +0000289</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathVariablePtr"></a>xmlXPathVariablePtr</h3><pre class="programlisting">typedef xmlXPathVariable *xmlXPathVariablePtr;
290</pre><p>
Daniel Veillardd4330462003-04-29 12:40:16 +0000291
292</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathEvalFunc"></a>xmlXPathEvalFunc ()</h3><pre class="programlisting">void (*xmlXPathEvalFunc) (<a href="libxml-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt,
293 int nargs);</pre><p>
294An XPath evaluation function, the parameters are on the XPath context stack.</p><p>
295
Daniel Veillardd7cec922003-06-13 12:30:10 +0000296</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i> :</span></td><td> an XPath parser context
297</td></tr><tr><td><span class="term"><i><tt>nargs</tt></i> :</span></td><td> the number of arguments passed to the function
Daniel Veillardd4330462003-04-29 12:40:16 +0000298</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathFunct"></a>struct xmlXPathFunct</h3><pre class="programlisting">struct xmlXPathFunct {
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000299 const xmlChar *name; /* the function name */
300 xmlXPathEvalFunc func; /* the evaluation function */
Daniel Veillardd4330462003-04-29 12:40:16 +0000301};
302</pre><p>
303
Daniel Veillardd7cec922003-06-13 12:30:10 +0000304</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathFuncPtr"></a>xmlXPathFuncPtr</h3><pre class="programlisting">typedef xmlXPathFunct *xmlXPathFuncPtr;
305</pre><p>
Daniel Veillardd4330462003-04-29 12:40:16 +0000306
307</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathAxisFunc"></a>xmlXPathAxisFunc ()</h3><pre class="programlisting"><a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> (*xmlXPathAxisFunc) (<a href="libxml-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt,
308 <a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> cur);</pre><p>
309An axis traversal function. To traverse an axis, the engine calls
Daniel Veillard5f4b5992002-02-20 10:22:49 +0000310the first time with cur == NULL and repeat until the function returns
Daniel Veillardd4330462003-04-29 12:40:16 +0000311NULL indicating the end of the axis traversal.</p><p>
312
Daniel Veillardd7cec922003-06-13 12:30:10 +0000313</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i> :</span></td><td> the XPath interpreter context
314</td></tr><tr><td><span class="term"><i><tt>cur</tt></i> :</span></td><td> the previous node being explored on that axis
315</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the next node in that axis or NULL if at the end of the axis.
Daniel Veillardd4330462003-04-29 12:40:16 +0000316</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathAxis"></a>struct xmlXPathAxis</h3><pre class="programlisting">struct xmlXPathAxis {
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000317 const xmlChar *name; /* the axis name */
318 xmlXPathAxisFunc func; /* the search function */
Daniel Veillardd4330462003-04-29 12:40:16 +0000319};
320</pre><p>
321
Daniel Veillardd7cec922003-06-13 12:30:10 +0000322</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathAxisPtr"></a>xmlXPathAxisPtr</h3><pre class="programlisting">typedef xmlXPathAxis *xmlXPathAxisPtr;
323</pre><p>
Daniel Veillardd4330462003-04-29 12:40:16 +0000324
325</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathCompExpr"></a>struct xmlXPathCompExpr</h3><pre class="programlisting">struct xmlXPathCompExpr;</pre><p>
326
Daniel Veillardd7cec922003-06-13 12:30:10 +0000327</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathCompExprPtr"></a>xmlXPathCompExprPtr</h3><pre class="programlisting">typedef xmlXPathCompExpr *xmlXPathCompExprPtr;
328</pre><p>
Daniel Veillardd4330462003-04-29 12:40:16 +0000329
330</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathFunction"></a>xmlXPathFunction ()</h3><pre class="programlisting">void (*xmlXPathFunction) (<a href="libxml-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt,
331 int nargs);</pre><p>
332An XPath function.
Daniel Veillard5f4b5992002-02-20 10:22:49 +0000333The arguments (if any) are popped out from the context stack
Daniel Veillardd4330462003-04-29 12:40:16 +0000334and the result is pushed on the stack.</p><p>
335
Daniel Veillardd7cec922003-06-13 12:30:10 +0000336</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i> :</span></td><td> the XPath interprestation context
337</td></tr><tr><td><span class="term"><i><tt>nargs</tt></i> :</span></td><td> the number of arguments
Daniel Veillardd4330462003-04-29 12:40:16 +0000338</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathIsNaN"></a>xmlXPathIsNaN ()</h3><pre class="programlisting">int xmlXPathIsNaN (<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="double">double</GTKDOCLINK> val);</pre><p>
339Provides a portable <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="isnan">isnan</GTKDOCLINK>() function to detect whether a double
Daniel Veillarde7ead2d2001-08-22 23:44:09 +0000340is a NotaNumber. Based on trio code
Daniel Veillardd4330462003-04-29 12:40:16 +0000341http://sourceforge.net/projects/ctrio/</p><p>
342
Daniel Veillardd7cec922003-06-13 12:30:10 +0000343</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>val</tt></i> :</span></td><td> a double value
344</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>1 if the value is a NaN, 0 otherwise
Daniel Veillardd4330462003-04-29 12:40:16 +0000345</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathIsInf"></a>xmlXPathIsInf ()</h3><pre class="programlisting">int xmlXPathIsInf (<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="double">double</GTKDOCLINK> val);</pre><p>
346Provides a portable <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="isinf">isinf</GTKDOCLINK>() function to detect whether a double
Daniel Veillarde7ead2d2001-08-22 23:44:09 +0000347is a +Infinite or -Infinite. Based on trio code
Daniel Veillardd4330462003-04-29 12:40:16 +0000348http://sourceforge.net/projects/ctrio/</p><p>
349
Daniel Veillardd7cec922003-06-13 12:30:10 +0000350</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>val</tt></i> :</span></td><td> a double value
351</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>1 vi the value is +Infinite, -1 if -Infinite, 0 otherwise
352</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathNodeSetGetLength"></a>xmlXPathNodeSetGetLength()</h3><pre class="programlisting">#define xmlXPathNodeSetGetLength(ns) ((ns) ? (ns)-&gt;nodeNr : 0)
353</pre><p>
Daniel Veillardd4330462003-04-29 12:40:16 +0000354Implement a functionality similar to the DOM NodeList.length.</p><p>
355
Daniel Veillardd7cec922003-06-13 12:30:10 +0000356</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ns</tt></i> :</span></td><td> a node-set
Daniel Veillardd4330462003-04-29 12:40:16 +0000357</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathNodeSetItem"></a>xmlXPathNodeSetItem()</h3><pre class="programlisting">#define xmlXPathNodeSetItem(ns, index)</pre><p>
358Implements a functionality similar to the DOM NodeList.<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="item">item</GTKDOCLINK>().</p><p>
359
Daniel Veillardd7cec922003-06-13 12:30:10 +0000360</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ns</tt></i> :</span></td><td> a node-set
361</td></tr><tr><td><span class="term"><i><tt>index</tt></i> :</span></td><td> index of a node in the set
Daniel Veillardd4330462003-04-29 12:40:16 +0000362</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathNodeSetIsEmpty"></a>xmlXPathNodeSetIsEmpty()</h3><pre class="programlisting">#define xmlXPathNodeSetIsEmpty(ns)</pre><p>
363Checks whether <i><tt>ns</tt></i> is empty or not.</p><p>
364
Daniel Veillardd7cec922003-06-13 12:30:10 +0000365</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ns</tt></i> :</span></td><td> a node-set
Daniel Veillardd4330462003-04-29 12:40:16 +0000366</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathFreeObject"></a>xmlXPathFreeObject ()</h3><pre class="programlisting">void xmlXPathFreeObject (<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> obj);</pre><p>
367Free up an xmlXPathObjectPtr object.</p><p>
368
Daniel Veillardd7cec922003-06-13 12:30:10 +0000369</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>obj</tt></i> :</span></td><td> the object to free
Daniel Veillardd4330462003-04-29 12:40:16 +0000370</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathNodeSetCreate"></a>xmlXPathNodeSetCreate ()</h3><pre class="programlisting"><a href="libxml-xpath.html#xmlNodeSetPtr">xmlNodeSetPtr</a> xmlXPathNodeSetCreate (<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> val);</pre><p>
371Create a new xmlNodeSetPtr of type double and of value <i><tt>val</tt></i></p><p>
372
Daniel Veillardd7cec922003-06-13 12:30:10 +0000373</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>val</tt></i> :</span></td><td> an initial xmlNodePtr, or NULL
374</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the newly created object.
Daniel Veillardd4330462003-04-29 12:40:16 +0000375</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathFreeNodeSetList"></a>xmlXPathFreeNodeSetList ()</h3><pre class="programlisting">void xmlXPathFreeNodeSetList (<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> obj);</pre><p>
376Free up the xmlXPathObjectPtr <i><tt>obj</tt></i> but don't deallocate the objects in
377the list contrary to <a href="libxml-xpath.html#xmlXPathFreeObject">xmlXPathFreeObject</a>().</p><p>
378
Daniel Veillardd7cec922003-06-13 12:30:10 +0000379</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>obj</tt></i> :</span></td><td> an existing NodeSetList object
Daniel Veillardd4330462003-04-29 12:40:16 +0000380</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathFreeNodeSet"></a>xmlXPathFreeNodeSet ()</h3><pre class="programlisting">void xmlXPathFreeNodeSet (<a href="libxml-xpath.html#xmlNodeSetPtr">xmlNodeSetPtr</a> obj);</pre><p>
381Free the NodeSet compound (not the actual nodes !).</p><p>
382
Daniel Veillardd7cec922003-06-13 12:30:10 +0000383</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>obj</tt></i> :</span></td><td> the xmlNodeSetPtr to free
Daniel Veillardd4330462003-04-29 12:40:16 +0000384</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathObjectCopy"></a>xmlXPathObjectCopy ()</h3><pre class="programlisting"><a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> xmlXPathObjectCopy (<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> val);</pre><p>
385allocate a new copy of a given object</p><p>
386
Daniel Veillardd7cec922003-06-13 12:30:10 +0000387</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>val</tt></i> :</span></td><td> the original object
388</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the newly created object.
Daniel Veillardd4330462003-04-29 12:40:16 +0000389</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathCmpNodes"></a>xmlXPathCmpNodes ()</h3><pre class="programlisting">int xmlXPathCmpNodes (<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node1,
390 <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node2);</pre><p>
391Compare two nodes w.r.t document order</p><p>
392
Daniel Veillardd7cec922003-06-13 12:30:10 +0000393</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>node1</tt></i> :</span></td><td> the first node
394</td></tr><tr><td><span class="term"><i><tt>node2</tt></i> :</span></td><td> the second node
395</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>-2 in case of error 1 if first point &lt; second point, 0 if
396 that's the same node, -1 otherwise
Daniel Veillardd4330462003-04-29 12:40:16 +0000397</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathCastNumberToBoolean"></a>xmlXPathCastNumberToBoolean ()</h3><pre class="programlisting">int xmlXPathCastNumberToBoolean (<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="double">double</GTKDOCLINK> val);</pre><p>
398Converts a number to its boolean value</p><p>
399
Daniel Veillardd7cec922003-06-13 12:30:10 +0000400</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>val</tt></i> :</span></td><td> a number
401</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the boolean value
Daniel Veillardd4330462003-04-29 12:40:16 +0000402</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathCastStringToBoolean"></a>xmlXPathCastStringToBoolean ()</h3><pre class="programlisting">int xmlXPathCastStringToBoolean (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *val);</pre><p>
403Converts a string to its boolean value</p><p>
404
Daniel Veillardd7cec922003-06-13 12:30:10 +0000405</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>val</tt></i> :</span></td><td> a string
406</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the boolean value
Daniel Veillardd4330462003-04-29 12:40:16 +0000407</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathCastNodeSetToBoolean"></a>xmlXPathCastNodeSetToBoolean ()</h3><pre class="programlisting">int xmlXPathCastNodeSetToBoolean (<a href="libxml-xpath.html#xmlNodeSetPtr">xmlNodeSetPtr</a> ns);</pre><p>
408Converts a node-set to its boolean value</p><p>
409
Daniel Veillardd7cec922003-06-13 12:30:10 +0000410</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ns</tt></i> :</span></td><td> a node-set
411</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the boolean value
Daniel Veillardd4330462003-04-29 12:40:16 +0000412</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathCastToBoolean"></a>xmlXPathCastToBoolean ()</h3><pre class="programlisting">int xmlXPathCastToBoolean (<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> val);</pre><p>
413Converts an XPath object to its boolean value</p><p>
414
Daniel Veillardd7cec922003-06-13 12:30:10 +0000415</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>val</tt></i> :</span></td><td> an XPath object
416</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the boolean value
Daniel Veillardd4330462003-04-29 12:40:16 +0000417</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathCastBooleanToNumber"></a>xmlXPathCastBooleanToNumber ()</h3><pre class="programlisting"><GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="double">double</GTKDOCLINK> xmlXPathCastBooleanToNumber (int val);</pre><p>
418Converts a boolean to its number value</p><p>
419
Daniel Veillardd7cec922003-06-13 12:30:10 +0000420</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>val</tt></i> :</span></td><td> a boolean
421</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the number value
Daniel Veillardd4330462003-04-29 12:40:16 +0000422</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathCastStringToNumber"></a>xmlXPathCastStringToNumber ()</h3><pre class="programlisting"><GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="double">double</GTKDOCLINK> xmlXPathCastStringToNumber (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *val);</pre><p>
423Converts a string to its number value</p><p>
424
Daniel Veillardd7cec922003-06-13 12:30:10 +0000425</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>val</tt></i> :</span></td><td> a string
426</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the number value
Daniel Veillardd4330462003-04-29 12:40:16 +0000427</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathCastNodeToNumber"></a>xmlXPathCastNodeToNumber ()</h3><pre class="programlisting"><GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="double">double</GTKDOCLINK> xmlXPathCastNodeToNumber (<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node);</pre><p>
428Converts a node to its number value</p><p>
429
Daniel Veillardd7cec922003-06-13 12:30:10 +0000430</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>node</tt></i> :</span></td><td> a node
431</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the number value
Daniel Veillardd4330462003-04-29 12:40:16 +0000432</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathCastNodeSetToNumber"></a>xmlXPathCastNodeSetToNumber ()</h3><pre class="programlisting"><GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="double">double</GTKDOCLINK> xmlXPathCastNodeSetToNumber (<a href="libxml-xpath.html#xmlNodeSetPtr">xmlNodeSetPtr</a> ns);</pre><p>
433Converts a node-set to its number value</p><p>
434
Daniel Veillardd7cec922003-06-13 12:30:10 +0000435</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ns</tt></i> :</span></td><td> a node-set
436</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the number value
Daniel Veillardd4330462003-04-29 12:40:16 +0000437</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathCastToNumber"></a>xmlXPathCastToNumber ()</h3><pre class="programlisting"><GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="double">double</GTKDOCLINK> xmlXPathCastToNumber (<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> val);</pre><p>
438Converts an XPath object to its number value</p><p>
439
Daniel Veillardd7cec922003-06-13 12:30:10 +0000440</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>val</tt></i> :</span></td><td> an XPath object
441</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the number value
Daniel Veillardd4330462003-04-29 12:40:16 +0000442</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathCastBooleanToString"></a>xmlXPathCastBooleanToString ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlChar">xmlChar</a>* xmlXPathCastBooleanToString (int val);</pre><p>
443Converts a boolean to its string value.</p><p>
444
Daniel Veillardd7cec922003-06-13 12:30:10 +0000445</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>val</tt></i> :</span></td><td> a boolean
446</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a newly allocated string.
Daniel Veillardd4330462003-04-29 12:40:16 +0000447</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathCastNumberToString"></a>xmlXPathCastNumberToString ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlChar">xmlChar</a>* xmlXPathCastNumberToString (<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="double">double</GTKDOCLINK> val);</pre><p>
448Converts a number to its string value.</p><p>
449
Daniel Veillardd7cec922003-06-13 12:30:10 +0000450</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>val</tt></i> :</span></td><td> a number
451</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a newly allocated string.
Daniel Veillardd4330462003-04-29 12:40:16 +0000452</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathCastNodeToString"></a>xmlXPathCastNodeToString ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlChar">xmlChar</a>* xmlXPathCastNodeToString (<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node);</pre><p>
453Converts a node to its string value.</p><p>
454
Daniel Veillardd7cec922003-06-13 12:30:10 +0000455</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>node</tt></i> :</span></td><td> a node
456</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a newly allocated string.
Daniel Veillardd4330462003-04-29 12:40:16 +0000457</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathCastNodeSetToString"></a>xmlXPathCastNodeSetToString ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlChar">xmlChar</a>* xmlXPathCastNodeSetToString (<a href="libxml-xpath.html#xmlNodeSetPtr">xmlNodeSetPtr</a> ns);</pre><p>
458Converts a node-set to its string value.</p><p>
459
Daniel Veillardd7cec922003-06-13 12:30:10 +0000460</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ns</tt></i> :</span></td><td> a node-set
461</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a newly allocated string.
Daniel Veillardd4330462003-04-29 12:40:16 +0000462</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathCastToString"></a>xmlXPathCastToString ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlChar">xmlChar</a>* xmlXPathCastToString (<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> val);</pre><p>
463Converts an existing object to its <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="string">string</GTKDOCLINK>() equivalent</p><p>
464
Daniel Veillardd7cec922003-06-13 12:30:10 +0000465</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>val</tt></i> :</span></td><td> an XPath object
466</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the string value of the object, NULL in case of error.
467 A new string is allocated only if needed (<i><tt>val</tt></i> isn't a
468 string object).
Daniel Veillardd4330462003-04-29 12:40:16 +0000469</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathConvertBoolean"></a>xmlXPathConvertBoolean ()</h3><pre class="programlisting"><a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> xmlXPathConvertBoolean (<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> val);</pre><p>
470Converts an existing object to its <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="boolean">boolean</GTKDOCLINK>() equivalent</p><p>
471
Daniel Veillardd7cec922003-06-13 12:30:10 +0000472</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>val</tt></i> :</span></td><td> an XPath object
473</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the new object, the old one is freed (or the operation
474 is done directly on <i><tt>val</tt></i>)
Daniel Veillardd4330462003-04-29 12:40:16 +0000475</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathConvertNumber"></a>xmlXPathConvertNumber ()</h3><pre class="programlisting"><a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> xmlXPathConvertNumber (<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> val);</pre><p>
476Converts an existing object to its <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="number">number</GTKDOCLINK>() equivalent</p><p>
477
Daniel Veillardd7cec922003-06-13 12:30:10 +0000478</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>val</tt></i> :</span></td><td> an XPath object
479</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the new object, the old one is freed (or the operation
480 is done directly on <i><tt>val</tt></i>)
Daniel Veillardd4330462003-04-29 12:40:16 +0000481</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathConvertString"></a>xmlXPathConvertString ()</h3><pre class="programlisting"><a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> xmlXPathConvertString (<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> val);</pre><p>
482Converts an existing object to its <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="string">string</GTKDOCLINK>() equivalent</p><p>
483
Daniel Veillardd7cec922003-06-13 12:30:10 +0000484</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>val</tt></i> :</span></td><td> an XPath object
485</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the new object, the old one is freed (or the operation
486 is done directly on <i><tt>val</tt></i>)
Daniel Veillardd4330462003-04-29 12:40:16 +0000487</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathInit"></a>xmlXPathInit ()</h3><pre class="programlisting">void xmlXPathInit (void);</pre><p>
488Initialize the XPath environment</p><p>
489
490</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathNewContext"></a>xmlXPathNewContext ()</h3><pre class="programlisting"><a href="libxml-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> xmlXPathNewContext (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc);</pre><p>
491Create a new xmlXPathContext</p><p>
492
Daniel Veillardd7cec922003-06-13 12:30:10 +0000493</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>doc</tt></i> :</span></td><td> the XML document
494</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the xmlXPathContext just allocated. The caller will need to free it.
Daniel Veillardd4330462003-04-29 12:40:16 +0000495</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathFreeContext"></a>xmlXPathFreeContext ()</h3><pre class="programlisting">void xmlXPathFreeContext (<a href="libxml-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> ctxt);</pre><p>
496Free up an xmlXPathContext</p><p>
497
Daniel Veillardd7cec922003-06-13 12:30:10 +0000498</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i> :</span></td><td> the context to free
Daniel Veillardd4330462003-04-29 12:40:16 +0000499</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathOrderDocElems"></a>xmlXPathOrderDocElems ()</h3><pre class="programlisting"><GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="long">long</GTKDOCLINK> xmlXPathOrderDocElems (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc);</pre><p>
500Call this routine to speed up XPath computation on static documents.
Daniel Veillardc2d4a932003-04-01 11:13:05 +0000501This stamps all the element nodes with the document order
502Like for line information, the order is kept in the element-&gt;content
503field, the value stored is actually - the node number (startting at -1)
Daniel Veillardd4330462003-04-29 12:40:16 +0000504to be able to differenciate from line numbers.</p><p>
505
Daniel Veillardd7cec922003-06-13 12:30:10 +0000506</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>doc</tt></i> :</span></td><td> an input document
507</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the number of element found in the document or -1 in case
508 of error.
Daniel Veillardd4330462003-04-29 12:40:16 +0000509</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathEval"></a>xmlXPathEval ()</h3><pre class="programlisting"><a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> xmlXPathEval (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str,
510 <a href="libxml-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> ctx);</pre><p>
511Evaluate the XPath Location Path in the given context.</p><p>
512
Daniel Veillardd7cec922003-06-13 12:30:10 +0000513</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>str</tt></i> :</span></td><td> the XPath expression
514</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td> the XPath context
515</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the xmlXPathObjectPtr resulting from the evaluation or NULL.
516 the caller has to free the object.
Daniel Veillardd4330462003-04-29 12:40:16 +0000517</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathEvalExpression"></a>xmlXPathEvalExpression ()</h3><pre class="programlisting"><a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> xmlXPathEvalExpression (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str,
518 <a href="libxml-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> ctxt);</pre><p>
519Evaluate the XPath expression in the given context.</p><p>
520
Daniel Veillardd7cec922003-06-13 12:30:10 +0000521</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>str</tt></i> :</span></td><td> the XPath expression
522</td></tr><tr><td><span class="term"><i><tt>ctxt</tt></i> :</span></td><td> the XPath context
523</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the xmlXPathObjectPtr resulting from the evaluation or NULL.
524 the caller has to free the object.
Daniel Veillardd4330462003-04-29 12:40:16 +0000525</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathEvalPredicate"></a>xmlXPathEvalPredicate ()</h3><pre class="programlisting">int xmlXPathEvalPredicate (<a href="libxml-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> ctxt,
526 <a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> res);</pre><p>
527Evaluate a predicate result for the current node.
Daniel Veillardc7ad7ce2001-03-22 21:45:29 +0000528A PredicateExpr is evaluated by evaluating the Expr and converting
529the result to a boolean. If the result is a number, the result will
530be converted to true if the number is equal to the position of the
531context node in the context node list (as returned by the position
532function) and will be converted to false otherwise; if the result
533is not a number, then the result will be converted as if by a call
Daniel Veillardd4330462003-04-29 12:40:16 +0000534to the boolean function.</p><p>
535
Daniel Veillardd7cec922003-06-13 12:30:10 +0000536</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i> :</span></td><td> the XPath context
537</td></tr><tr><td><span class="term"><i><tt>res</tt></i> :</span></td><td> the Predicate Expression evaluation result
538</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>1 if predicate is true, 0 otherwise
Daniel Veillardd4330462003-04-29 12:40:16 +0000539</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathCompile"></a>xmlXPathCompile ()</h3><pre class="programlisting"><a href="libxml-xpath.html#xmlXPathCompExprPtr">xmlXPathCompExprPtr</a> xmlXPathCompile (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str);</pre><p>
540Compile an XPath expression</p><p>
541
Daniel Veillardd7cec922003-06-13 12:30:10 +0000542</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>str</tt></i> :</span></td><td> the XPath expression
543</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the xmlXPathCompExprPtr resulting from the compilation or NULL.
544 the caller has to free the object.
Daniel Veillardd4330462003-04-29 12:40:16 +0000545</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathCompiledEval"></a>xmlXPathCompiledEval ()</h3><pre class="programlisting"><a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> xmlXPathCompiledEval (<a href="libxml-xpath.html#xmlXPathCompExprPtr">xmlXPathCompExprPtr</a> comp,
546 <a href="libxml-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> ctx);</pre><p>
547Evaluate the Precompiled XPath expression in the given context.</p><p>
548
Daniel Veillardd7cec922003-06-13 12:30:10 +0000549</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>comp</tt></i> :</span></td><td> the compiled XPath expression
550</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td> the XPath context
551</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the xmlXPathObjectPtr resulting from the evaluation or NULL.
552 the caller has to free the object.
Daniel Veillardd4330462003-04-29 12:40:16 +0000553</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlXPathFreeCompExpr"></a>xmlXPathFreeCompExpr ()</h3><pre class="programlisting">void xmlXPathFreeCompExpr (<a href="libxml-xpath.html#xmlXPathCompExprPtr">xmlXPathCompExprPtr</a> comp);</pre><p>
554Free up the memory allocated by <i><tt>comp</tt></i></p><p>
555
Daniel Veillardd7cec922003-06-13 12:30:10 +0000556</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>comp</tt></i> :</span></td><td> an XPATH comp
Daniel Veillardd4330462003-04-29 12:40:16 +0000557</td></tr></tbody></table></div></div></div></div><table xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="libxml-HTMLtree.html"><b>&lt;&lt; HTMLtree</b></a></td><td align="right"><a accesskey="n" href="libxml-xpathInternals.html"><b>xpathInternals &gt;&gt;</b></a></td></tr></table></body></html>