Hash :
2ad1dfff
Author :
Date :
2003-11-15T10:35:20
rebuilt the generated pages (again), manually restored doc/html/index.html * doc/Makefile.am doc/*.html doc/html/*.html: rebuilt the generated pages (again), manually restored doc/html/index.html and manually edited generated file doc/gnome-xml.xml to put in appropriate headings. * doc/docdescr.doc: new file to describe details of the document generation (helps my memory for the next time) * genChRanges.py,chvalid.c,include/libxml/chvalid.h: minor enhancement to please the automatic documentation generation.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338
<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.48"><meta name="generator" content="GTK-Doc V1.1 (XML mode)"><style type="text/css">
.synopsis, .classsynopsis {
background: #eeeeee;
border: solid 1px #aaaaaa;
padding: 0.5em;
}
.programlisting {
background: #eeeeff;
border: solid 1px #aaaaff;
padding: 0.5em;
}
.variablelist {
padding: 4px;
margin-left: 3em;
}
.navigation {
background: #ffeeee;
border: solid 1px #ffaaaa;
margin-top: 0.5em;
margin-bottom: 0.5em;
}
.navigation a {
color: #770000;
}
.navigation a:visited {
color: #550000;
}
.navigation .title {
font-size: 200%;
}
</style><link rel="home" href="index.html" title="Gnome XML Library Reference Manual "><link rel="up" href="ch01.html" title="Libxml Programming Notes"><link rel="previous" href="libxml-xmlIO.html" title="xmlIO"><link rel="next" href="libxml-chvalid.html" title="chvalid"></head><body text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-xmlIO.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">Gnome XML Library Reference Manual </th><td><a accesskey="n" href="libxml-chvalid.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="refentry"><a name="libxml-xpath"></a><div class="titlepage"></div><div class="refnamediv"><h2>xpath</h2><p>xpath — </p></div><div class="refsynopsisdiv"><h2><h1 class="title"><a name="id2591929"></a>Synopsis</h1></h2><pre class="synopsis">
struct <a href="libxml-xpath.html#xmlXPathContext">xmlXPathContext</a>;
typedef <a href="libxml-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a>;
struct <a href="libxml-xpath.html#xmlXPathParserContext">xmlXPathParserContext</a>;
typedef <a href="libxml-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a>;
enum <a href="libxml-xpath.html#xmlXPathError">xmlXPathError</a>;
struct <a href="libxml-xpath.html#xmlNodeSet">xmlNodeSet</a>;
typedef <a href="libxml-xpath.html#xmlNodeSetPtr">xmlNodeSetPtr</a>;
enum <a href="libxml-xpath.html#xmlXPathObjectType">xmlXPathObjectType</a>;
struct <a href="libxml-xpath.html#xmlXPathObject">xmlXPathObject</a>;
typedef <a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>;
int (<a href="libxml-xpath.html#xmlXPathConvertFunc">*xmlXPathConvertFunc</a>) (<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> obj,
int type);
struct <a href="libxml-xpath.html#xmlXPathType">xmlXPathType</a>;
typedef <a href="libxml-xpath.html#xmlXPathTypePtr">xmlXPathTypePtr</a>;
struct <a href="libxml-xpath.html#xmlXPathVariable">xmlXPathVariable</a>;
typedef <a href="libxml-xpath.html#xmlXPathVariablePtr">xmlXPathVariablePtr</a>;
void (<a href="libxml-xpath.html#xmlXPathEvalFunc">*xmlXPathEvalFunc</a>) (<a href="libxml-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt,
int nargs);
struct <a href="libxml-xpath.html#xmlXPathFunct">xmlXPathFunct</a>;
typedef <a href="libxml-xpath.html#xmlXPathFuncPtr">xmlXPathFuncPtr</a>;
<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,
<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> cur);
struct <a href="libxml-xpath.html#xmlXPathAxis">xmlXPathAxis</a>;
typedef <a href="libxml-xpath.html#xmlXPathAxisPtr">xmlXPathAxisPtr</a>;
struct <a href="libxml-xpath.html#xmlXPathCompExpr">xmlXPathCompExpr</a>;
typedef <a href="libxml-xpath.html#xmlXPathCompExprPtr">xmlXPathCompExprPtr</a>;
void (<a href="libxml-xpath.html#xmlXPathFunction">*xmlXPathFunction</a>) (<a href="libxml-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt,
int nargs);
extern double <a href="libxml-xpath.html#xmlXPathNAN">xmlXPathNAN</a>;
extern double <a href="libxml-xpath.html#xmlXPathPINF">xmlXPathPINF</a>;
extern double <a href="libxml-xpath.html#xmlXPathNINF">xmlXPathNINF</a>;
#define <a href="libxml-xpath.html#xmlXPathNodeSetGetLength">xmlXPathNodeSetGetLength</a> (ns)
#define <a href="libxml-xpath.html#xmlXPathNodeSetItem">xmlXPathNodeSetItem</a> (ns, index)
#define <a href="libxml-xpath.html#xmlXPathNodeSetIsEmpty">xmlXPathNodeSetIsEmpty</a> (ns)
</pre></div><div class="refsect1"><h2>Description</h2><p>
</p></div><div class="refsect1"><h2>Details</h2><div class="refsect2"><h3><a name="xmlXPathContext"></a>struct xmlXPathContext</h3><pre class="programlisting">struct xmlXPathContext {
xmlDocPtr doc; /* The current document */
xmlNodePtr node; /* The current node */
int nb_variables_unused; /* unused (hash table) */
int max_variables_unused; /* unused (hash table) */
xmlHashTablePtr varHash; /* Hash table of defined variables */
int nb_types; /* number of defined types */
int max_types; /* max number of types */
xmlXPathTypePtr types; /* Array of defined types */
int nb_funcs_unused; /* unused (hash table) */
int max_funcs_unused; /* unused (hash table) */
xmlHashTablePtr funcHash; /* Hash table of defined funcs */
int nb_axis; /* number of defined axis */
int max_axis; /* max number of axis */
xmlXPathAxisPtr axis; /* Array of defined axis */
/* the namespace nodes of the context node */
xmlNsPtr *namespaces; /* Array of namespaces */
int nsNr; /* number of namespace in scope */
void *user; /* function to free */
/* extra variables */
int contextSize; /* the context size */
int proximityPosition; /* the proximity position */
/* extra stuff for XPointer */
int xptr; /* it this an XPointer context */
xmlNodePtr here; /* for here() */
xmlNodePtr origin; /* for origin() */
/* the set of namespace declarations in scope for the expression */
xmlHashTablePtr nsHash; /* The namespaces hash table */
void *varLookupFunc; /* variable lookup func */
void *varLookupData; /* variable lookup data */
/* Possibility to link in an extra item */
void *extra; /* needed for XSLT */
/* The function name and URI when calling a function */
const xmlChar *function;
const xmlChar *functionURI;
/* function lookup function and data */
void *funcLookupFunc; /* function lookup func */
void *funcLookupData; /* function lookup data */
/* temporary namespace lists kept for walking the namespace axis */
xmlNsPtr *tmpNsList; /* Array of namespaces */
int tmpNsNr; /* number of namespace in scope */
/* error reporting mechanism */
void *userData; /* user specific data block */
xmlStructuredErrorFunc error; /* the callback in case of errors */
xmlError lastError; /* the last error */
xmlNodePtr debugNode; /* the source node XSLT */
};
</pre><p>
Expression evaluation occurs with respect to a context.
he context consists of:
- a node (the context node)
- a node list (the context node list)
- a set of variable bindings
- a function library
- the set of namespace declarations in scope for the expression
Following the switch to hash tables, this need to be trimmed up at
the next binary incompatible release.</p><p>
</p></div><hr><div class="refsect2"><h3><a name="xmlXPathContextPtr"></a>xmlXPathContextPtr</h3><pre class="programlisting">typedef xmlXPathContext *xmlXPathContextPtr;
</pre><p>
</p></div><hr><div class="refsect2"><h3><a name="xmlXPathParserContext"></a>struct xmlXPathParserContext</h3><pre class="programlisting">struct xmlXPathParserContext {
const xmlChar *cur; /* the current char being parsed */
const xmlChar *base; /* the full expression */
int error; /* error code */
xmlXPathContextPtr context; /* the evaluation context */
xmlXPathObjectPtr value; /* the current value */
int valueNr; /* number of values stacked */
int valueMax; /* max number of values stacked */
xmlXPathObjectPtr *valueTab; /* stack of values */
xmlXPathCompExprPtr comp; /* the precompiled expression */
int xptr; /* it this an XPointer expression */
xmlNodePtr ancestor; /* used for walking preceding axis */
};
</pre><p>
An XPath parser context. It contains pure parsing informations,
an xmlXPathContext, and the stack of objects.</p><p>
</p></div><hr><div class="refsect2"><h3><a name="xmlXPathParserContextPtr"></a>xmlXPathParserContextPtr</h3><pre class="programlisting">typedef xmlXPathParserContext *xmlXPathParserContextPtr;
</pre><p>
</p></div><hr><div class="refsect2"><h3><a name="xmlXPathError"></a>enum xmlXPathError</h3><pre class="programlisting">typedef enum {
XPATH_EXPRESSION_OK = 0,
XPATH_NUMBER_ERROR,
XPATH_UNFINISHED_LITERAL_ERROR,
XPATH_START_LITERAL_ERROR,
XPATH_VARIABLE_REF_ERROR,
XPATH_UNDEF_VARIABLE_ERROR,
XPATH_INVALID_PREDICATE_ERROR,
XPATH_EXPR_ERROR,
XPATH_UNCLOSED_ERROR,
XPATH_UNKNOWN_FUNC_ERROR,
XPATH_INVALID_OPERAND,
XPATH_INVALID_TYPE,
XPATH_INVALID_ARITY,
XPATH_INVALID_CTXT_SIZE,
XPATH_INVALID_CTXT_POSITION,
XPATH_MEMORY_ERROR,
XPTR_SYNTAX_ERROR,
XPTR_RESOURCE_ERROR,
XPTR_SUB_RESOURCE_ERROR,
XPATH_UNDEF_PREFIX_ERROR,
XPATH_ENCODING_ERROR,
XPATH_INVALID_CHAR_ERROR
} xmlXPathError;
</pre><p>
</p></div><hr><div class="refsect2"><h3><a name="xmlNodeSet"></a>struct xmlNodeSet</h3><pre class="programlisting">struct xmlNodeSet {
int nodeNr; /* number of nodes in the set */
int nodeMax; /* size of the array as allocated */
xmlNodePtr *nodeTab; /* array of nodes in no particular order */
/* @@ with_ns to check wether namespace nodes should be looked at @@ */
};
</pre><p>
</p></div><hr><div class="refsect2"><h3><a name="xmlNodeSetPtr"></a>xmlNodeSetPtr</h3><pre class="programlisting">typedef xmlNodeSet *xmlNodeSetPtr;
</pre><p>
</p></div><hr><div class="refsect2"><h3><a name="xmlXPathObjectType"></a>enum xmlXPathObjectType</h3><pre class="programlisting">typedef enum {
XPATH_UNDEFINED = 0,
XPATH_NODESET = 1,
XPATH_BOOLEAN = 2,
XPATH_NUMBER = 3,
XPATH_STRING = 4,
XPATH_POINT = 5,
XPATH_RANGE = 6,
XPATH_LOCATIONSET = 7,
XPATH_USERS = 8,
XPATH_XSLT_TREE = 9 /* An XSLT value tree, non modifiable */
} xmlXPathObjectType;
</pre><p>
</p></div><hr><div class="refsect2"><h3><a name="xmlXPathObject"></a>struct xmlXPathObject</h3><pre class="programlisting">struct xmlXPathObject {
xmlXPathObjectType type;
xmlNodeSetPtr nodesetval;
int boolval;
double floatval;
xmlChar *stringval;
void *user;
int index;
void *user2;
int index2;
};
</pre><p>
</p></div><hr><div class="refsect2"><h3><a name="xmlXPathObjectPtr"></a>xmlXPathObjectPtr</h3><pre class="programlisting">typedef xmlXPathObject *xmlXPathObjectPtr;
</pre><p>
</p></div><hr><div class="refsect2"><h3><a name="xmlXPathConvertFunc"></a>xmlXPathConvertFunc ()</h3><pre class="programlisting">int (*xmlXPathConvertFunc) (<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> obj,
int type);</pre><p>
A conversion function is associated to a type and used to cast
the new type to primitive values.</p><p>
</p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>obj</tt></i>:</span></td><td> an XPath object
</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td> the number of the target type
</td></tr><tr><td><span class="term"><span class="emphasis"><i>Returns</i></span> :</span></td><td>-1 in case of error, 0 otherwise
</td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="xmlXPathType"></a>struct xmlXPathType</h3><pre class="programlisting">struct xmlXPathType {
const xmlChar *name; /* the type name */
xmlXPathConvertFunc func; /* the conversion function */
};
</pre><p>
</p></div><hr><div class="refsect2"><h3><a name="xmlXPathTypePtr"></a>xmlXPathTypePtr</h3><pre class="programlisting">typedef xmlXPathType *xmlXPathTypePtr;
</pre><p>
</p></div><hr><div class="refsect2"><h3><a name="xmlXPathVariable"></a>struct xmlXPathVariable</h3><pre class="programlisting">struct xmlXPathVariable {
const xmlChar *name; /* the variable name */
xmlXPathObjectPtr value; /* the value */
};
</pre><p>
</p></div><hr><div class="refsect2"><h3><a name="xmlXPathVariablePtr"></a>xmlXPathVariablePtr</h3><pre class="programlisting">typedef xmlXPathVariable *xmlXPathVariablePtr;
</pre><p>
</p></div><hr><div class="refsect2"><h3><a name="xmlXPathEvalFunc"></a>xmlXPathEvalFunc ()</h3><pre class="programlisting">void (*xmlXPathEvalFunc) (<a href="libxml-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt,
int nargs);</pre><p>
An XPath evaluation function, the parameters are on the XPath context stack.</p><p>
</p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td> an XPath parser context
</td></tr><tr><td><span class="term"><i><tt>nargs</tt></i>:</span></td><td> the number of arguments passed to the function
</td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="xmlXPathFunct"></a>struct xmlXPathFunct</h3><pre class="programlisting">struct xmlXPathFunct {
const xmlChar *name; /* the function name */
xmlXPathEvalFunc func; /* the evaluation function */
};
</pre><p>
</p></div><hr><div class="refsect2"><h3><a name="xmlXPathFuncPtr"></a>xmlXPathFuncPtr</h3><pre class="programlisting">typedef xmlXPathFunct *xmlXPathFuncPtr;
</pre><p>
</p></div><hr><div class="refsect2"><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,
<a href="libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> cur);</pre><p>
An axis traversal function. To traverse an axis, the engine calls
the first time with cur == NULL and repeat until the function returns
NULL indicating the end of the axis traversal.</p><p>
</p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td> the XPath interpreter context
</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td> the previous node being explored on that axis
</td></tr><tr><td><span class="term"><span class="emphasis"><i>Returns</i></span> :</span></td><td>the next node in that axis or NULL if at the end of the axis.
</td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="xmlXPathAxis"></a>struct xmlXPathAxis</h3><pre class="programlisting">struct xmlXPathAxis {
const xmlChar *name; /* the axis name */
xmlXPathAxisFunc func; /* the search function */
};
</pre><p>
</p></div><hr><div class="refsect2"><h3><a name="xmlXPathAxisPtr"></a>xmlXPathAxisPtr</h3><pre class="programlisting">typedef xmlXPathAxis *xmlXPathAxisPtr;
</pre><p>
</p></div><hr><div class="refsect2"><h3><a name="xmlXPathCompExpr"></a>struct xmlXPathCompExpr</h3><pre class="programlisting">struct xmlXPathCompExpr;</pre><p>
</p></div><hr><div class="refsect2"><h3><a name="xmlXPathCompExprPtr"></a>xmlXPathCompExprPtr</h3><pre class="programlisting">typedef xmlXPathCompExpr *xmlXPathCompExprPtr;
</pre><p>
</p></div><hr><div class="refsect2"><h3><a name="xmlXPathFunction"></a>xmlXPathFunction ()</h3><pre class="programlisting">void (*xmlXPathFunction) (<a href="libxml-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt,
int nargs);</pre><p>
An XPath function.
The arguments (if any) are popped out from the context stack
and the result is pushed on the stack.</p><p>
</p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td> the XPath interprestation context
</td></tr><tr><td><span class="term"><i><tt>nargs</tt></i>:</span></td><td> the number of arguments
</td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="xmlXPathNAN"></a>xmlXPathNAN</h3><pre class="programlisting">extern double xmlXPathNAN;
</pre><p>
</p></div><hr><div class="refsect2"><h3><a name="xmlXPathPINF"></a>xmlXPathPINF</h3><pre class="programlisting">extern double xmlXPathPINF;
</pre><p>
</p></div><hr><div class="refsect2"><h3><a name="xmlXPathNINF"></a>xmlXPathNINF</h3><pre class="programlisting">extern double xmlXPathNINF;
</pre><p>
</p></div><hr><div class="refsect2"><h3><a name="xmlXPathNodeSetGetLength"></a>xmlXPathNodeSetGetLength()</h3><pre class="programlisting">#define xmlXPathNodeSetGetLength(ns) ((ns) ? (ns)->nodeNr : 0)
</pre><p>
Implement a functionality similar to the DOM NodeList.length.</p><p>
</p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ns</tt></i>:</span></td><td> a node-set
</td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="xmlXPathNodeSetItem"></a>xmlXPathNodeSetItem()</h3><pre class="programlisting">#define xmlXPathNodeSetItem(ns, index)</pre><p>
Implements a functionality similar to the DOM NodeList.<GTKDOCLINK HREF="item">item</GTKDOCLINK>().</p><p>
</p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ns</tt></i>:</span></td><td> a node-set
</td></tr><tr><td><span class="term"><i><tt>index</tt></i>:</span></td><td> index of a node in the set
</td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="xmlXPathNodeSetIsEmpty"></a>xmlXPathNodeSetIsEmpty()</h3><pre class="programlisting">#define xmlXPathNodeSetIsEmpty(ns)</pre><p>
Checks whether <i><tt>ns</tt></i> is empty or not.</p><p>
</p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ns</tt></i>:</span></td><td> a node-set
</td></tr></tbody></table></div></div></div></div><table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="libxml-xmlIO.html"><b><< xmlIO</b></a></td><td align="right"><a accesskey="n" href="libxml-chvalid.html"><b>chvalid >></b></a></td></tr></table></body></html>