Blame doc/html/libxml-xpath.html

Packit 423ecb
Packit 423ecb
Packit 423ecb
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><link rel="SHORTCUT ICON" href="/favicon.ico" /><style type="text/css">
Packit 423ecb
TD {font-family: Verdana,Arial,Helvetica}
Packit 423ecb
BODY {font-family: Verdana,Arial,Helvetica; margin-top: 2em; margin-left: 0em; margin-right: 0em}
Packit 423ecb
H1 {font-family: Verdana,Arial,Helvetica}
Packit 423ecb
H2 {font-family: Verdana,Arial,Helvetica}
Packit 423ecb
H3 {font-family: Verdana,Arial,Helvetica}
Packit 423ecb
A:link, A:visited, A:active { text-decoration: underline }
Packit 423ecb
</style><style type="text/css">
Packit 423ecb
      div.deprecated pre.programlisting {border-style: double;border-color:red}
Packit 423ecb
      pre.programlisting {border-style: double;background: #EECFA1}
Packit 423ecb
    </style><title>Module xpath from libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000">
Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
Made with Libxml2 Logo

Module xpath from libxml2

<center>API Menu</center>
<form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form>
<center>API Indexes</center>
<center>Related links</center>

API for the XML Path Language implementation XML Path Language implementation XPath is a language for addressing parts of an XML document, designed to be used by both XSLT and XPointer

Table of Contents

#define XML_XPATH_CHECKNS
#define XML_XPATH_NOVAR
#define xmlXPathNodeSetGetLength
#define xmlXPathNodeSetIsEmpty
#define xmlXPathNodeSetItem
Structure xmlNodeSet
struct _xmlNodeSet
Packit 423ecb
Typedef xmlNodeSet * xmlNodeSetPtr
Packit 423ecb
Structure xmlXPathAxis
struct _xmlXPathAxis
Packit 423ecb
Typedef xmlXPathAxis * xmlXPathAxisPtr
Packit 423ecb
Structure xmlXPathCompExpr
struct _xmlXPathCompExpr
Packit 423ecb
The content of this structure is not made public by the API.
Packit 423ecb
Typedef xmlXPathCompExpr * xmlXPathCompExprPtr
Packit 423ecb
Structure xmlXPathContext
struct _xmlXPathContext
Packit 423ecb
Typedef xmlXPathContext * xmlXPathContextPtr
Packit 423ecb
Enum xmlXPathError
Packit 423ecb
Typedef xmlXPathFunct * xmlXPathFuncPtr
Packit 423ecb
Structure xmlXPathFunct
struct _xmlXPathFunct
Packit 423ecb
Structure xmlXPathObject
struct _xmlXPathObject
Packit 423ecb
Typedef xmlXPathObject * xmlXPathObjectPtr
Packit 423ecb
Enum xmlXPathObjectType
Packit 423ecb
Structure xmlXPathParserContext
struct _xmlXPathParserContext
Packit 423ecb
Typedef xmlXPathParserContext * xmlXPathParserContextPtr
Packit 423ecb
Structure xmlXPathType
struct _xmlXPathType
Packit 423ecb
Typedef xmlXPathType * xmlXPathTypePtr
Packit 423ecb
Structure xmlXPathVariable
struct _xmlXPathVariable
Packit 423ecb
Typedef xmlXPathVariable * xmlXPathVariablePtr
Packit 423ecb
Function type: xmlXPathAxisFunc
Packit 423ecb
xmlXPathObjectPtr	xmlXPathAxisFunc	(xmlXPathParserContextPtr ctxt, 
xmlXPathObjectPtr cur)
Packit 423ecb
Packit 423ecb
double	xmlXPathCastBooleanToNumber	(int val)
Packit 423ecb
xmlChar *	xmlXPathCastBooleanToString	(int val)
Packit 423ecb
int	xmlXPathCastNodeSetToBoolean	(xmlNodeSetPtr ns)
Packit 423ecb
double	xmlXPathCastNodeSetToNumber	(xmlNodeSetPtr ns)
Packit 423ecb
xmlChar *	xmlXPathCastNodeSetToString	(xmlNodeSetPtr ns)
Packit 423ecb
double	xmlXPathCastNodeToNumber	(xmlNodePtr node)
Packit 423ecb
xmlChar *	xmlXPathCastNodeToString	(xmlNodePtr node)
Packit 423ecb
int	xmlXPathCastNumberToBoolean	(double val)
Packit 423ecb
xmlChar *	xmlXPathCastNumberToString	(double val)
Packit 423ecb
int	xmlXPathCastStringToBoolean	(const xmlChar * val)
Packit 423ecb
double	xmlXPathCastStringToNumber	(const xmlChar * val)
Packit 423ecb
int	xmlXPathCastToBoolean		(xmlXPathObjectPtr val)
Packit 423ecb
double	xmlXPathCastToNumber		(xmlXPathObjectPtr val)
Packit 423ecb
xmlChar *	xmlXPathCastToString	(xmlXPathObjectPtr val)
Packit 423ecb
int	xmlXPathCmpNodes		(xmlNodePtr node1, 
xmlNodePtr node2)
Packit 423ecb
xmlXPathCompExprPtr	xmlXPathCompile	(const xmlChar * str)
Packit 423ecb
xmlXPathObjectPtr	xmlXPathCompiledEval	(xmlXPathCompExprPtr comp, 
xmlXPathContextPtr ctx)
Packit 423ecb
int	xmlXPathCompiledEvalToBoolean	(xmlXPathCompExprPtr comp, 
xmlXPathContextPtr ctxt)
Packit 423ecb
int	xmlXPathContextSetCache		(xmlXPathContextPtr ctxt, 
int active,
int value,
int options)
Packit 423ecb
xmlXPathObjectPtr	xmlXPathConvertBoolean	(xmlXPathObjectPtr val)
Packit 423ecb
Function type: xmlXPathConvertFunc
Packit 423ecb
int	xmlXPathConvertFunc		(xmlXPathObjectPtr obj, 
int type)
Packit 423ecb
Packit 423ecb
xmlXPathObjectPtr	xmlXPathConvertNumber	(xmlXPathObjectPtr val)
Packit 423ecb
xmlXPathObjectPtr	xmlXPathConvertString	(xmlXPathObjectPtr val)
Packit 423ecb
xmlXPathCompExprPtr	xmlXPathCtxtCompile	(xmlXPathContextPtr ctxt, 
const xmlChar * str)
Packit 423ecb
xmlXPathObjectPtr	xmlXPathEval	(const xmlChar * str, 
xmlXPathContextPtr ctx)
Packit 423ecb
xmlXPathObjectPtr	xmlXPathEvalExpression	(const xmlChar * str, 
xmlXPathContextPtr ctxt)
Packit 423ecb
Function type: xmlXPathEvalFunc
Packit 423ecb
void	xmlXPathEvalFunc		(xmlXPathParserContextPtr ctxt, 
int nargs)
Packit 423ecb
Packit 423ecb
int	xmlXPathEvalPredicate		(xmlXPathContextPtr ctxt, 
xmlXPathObjectPtr res)
Packit 423ecb
void	xmlXPathFreeCompExpr		(xmlXPathCompExprPtr comp)
Packit 423ecb
void	xmlXPathFreeContext		(xmlXPathContextPtr ctxt)
Packit 423ecb
void	xmlXPathFreeNodeSet		(xmlNodeSetPtr obj)
Packit 423ecb
void	xmlXPathFreeNodeSetList		(xmlXPathObjectPtr obj)
Packit 423ecb
void	xmlXPathFreeObject		(xmlXPathObjectPtr obj)
Packit 423ecb
Function type: xmlXPathFuncLookupFunc
Packit 423ecb
xmlXPathFunction	xmlXPathFuncLookupFunc	(void * ctxt, 
const xmlChar * name,
const xmlChar * ns_uri)
Packit 423ecb
Packit 423ecb
Function type: xmlXPathFunction
Packit 423ecb
void	xmlXPathFunction		(xmlXPathParserContextPtr ctxt, 
int nargs)
Packit 423ecb
Packit 423ecb
void	xmlXPathInit			(void)
Packit 423ecb
int	xmlXPathIsInf			(double val)
Packit 423ecb
int	xmlXPathIsNaN			(double val)
Packit 423ecb
xmlXPathContextPtr	xmlXPathNewContext	(xmlDocPtr doc)
Packit 423ecb
xmlXPathObjectPtr	xmlXPathNodeEval	(xmlNodePtr node, 
const xmlChar * str,
xmlXPathContextPtr ctx)
Packit 423ecb
xmlNodeSetPtr	xmlXPathNodeSetCreate	(xmlNodePtr val)
Packit 423ecb
xmlXPathObjectPtr	xmlXPathObjectCopy	(xmlXPathObjectPtr val)
Packit 423ecb
long	xmlXPathOrderDocElems		(xmlDocPtr doc)
Packit 423ecb
int	xmlXPathSetContextNode		(xmlNodePtr node, 
xmlXPathContextPtr ctx)
Packit 423ecb
Function type: xmlXPathVariableLookupFunc
Packit 423ecb
xmlXPathObjectPtr	xmlXPathVariableLookupFunc	(void * ctxt, 
const xmlChar * name,
const xmlChar * ns_uri)
Packit 423ecb
Packit 423ecb

Description

Packit 423ecb

Macro: XML_XPATH_CHECKNS

#define XML_XPATH_CHECKNS

check namespaces at compilation

Packit 423ecb

Macro: XML_XPATH_NOVAR

#define XML_XPATH_NOVAR

forbid variables in expression

Packit 423ecb

Macro: xmlXPathNodeSetGetLength

#define xmlXPathNodeSetGetLength

Implement a functionality similar to the DOM NodeList.length. Returns the number of nodes in the node-set.

Packit 423ecb

Macro: xmlXPathNodeSetIsEmpty

#define xmlXPathNodeSetIsEmpty

Checks whether @ns is empty or not. Returns %TRUE if @ns is an empty node-set.

Packit 423ecb

Macro: xmlXPathNodeSetItem

#define xmlXPathNodeSetItem

Implements a functionality similar to the DOM NodeList.item(). Returns the xmlNodePtr at the given @index in @ns or NULL if @index is out of range (0 to length-1)

Packit 423ecb

Structure xmlNodeSet

Structure xmlNodeSet
struct _xmlNodeSet {
Packit 423ecb
    int	nodeNr	: number of nodes in the set
Packit 423ecb
    int	nodeMax	: size of the array as allocated
Packit 423ecb
    xmlNodePtr *	nodeTab	: array of nodes in no particular order @
Packit 423ecb
}

Structure xmlXPathAxis

Structure xmlXPathAxis
struct _xmlXPathAxis {
Packit 423ecb
    const xmlChar *	name	: the axis name
Packit 423ecb
    xmlXPathAxisFunc	func	: the search function
Packit 423ecb
}

Structure xmlXPathCompExpr

Structure xmlXPathCompExpr
struct _xmlXPathCompExpr {
Packit 423ecb
The content of this structure is not made public by the API.
Packit 423ecb
}

Structure xmlXPathContext

Structure xmlXPathContext
struct _xmlXPathContext {
Packit 423ecb
    xmlDocPtr	doc	: The current document
Packit 423ecb
    xmlNodePtr	node	: The current node
Packit 423ecb
    int	nb_variables_unused	: unused (hash table)
Packit 423ecb
    int	max_variables_unused	: unused (hash table)
Packit 423ecb
    xmlHashTablePtr	varHash	: Hash table of defined variables
Packit 423ecb
    int	nb_types	: number of defined types
Packit 423ecb
    int	max_types	: max number of types
Packit 423ecb
    xmlXPathTypePtr	types	: Array of defined types
Packit 423ecb
    int	nb_funcs_unused	: unused (hash table)
Packit 423ecb
    int	max_funcs_unused	: unused (hash table)
Packit 423ecb
    xmlHashTablePtr	funcHash	: Hash table of defined funcs
Packit 423ecb
    int	nb_axis	: number of defined axis
Packit 423ecb
    int	max_axis	: max number of axis
Packit 423ecb
    xmlXPathAxisPtr	axis	: Array of defined axis the namespace nod
Packit 423ecb
    xmlNsPtr *	namespaces	: Array of namespaces
Packit 423ecb
    int	nsNr	: number of namespace in scope
Packit 423ecb
    void *	user	: function to free extra variables
Packit 423ecb
    int	contextSize	: the context size
Packit 423ecb
    int	proximityPosition	: the proximity position extra stuff for
Packit 423ecb
    int	xptr	: is this an XPointer context?
Packit 423ecb
    xmlNodePtr	here	: for here()
Packit 423ecb
    xmlNodePtr	origin	: for origin() the set of namespace decla
Packit 423ecb
    xmlHashTablePtr	nsHash	: The namespaces hash table
Packit 423ecb
    xmlXPathVariableLookupFunc	varLookupFunc	: variable lookup func
Packit 423ecb
    void *	varLookupData	: variable lookup data Possibility to lin
Packit 423ecb
    void *	extra	: needed for XSLT The function name and U
Packit 423ecb
    const xmlChar *	function
Packit 423ecb
    const xmlChar *	functionURI	: function lookup function and data
Packit 423ecb
    xmlXPathFuncLookupFunc	funcLookupFunc	: function lookup func
Packit 423ecb
    void *	funcLookupData	: function lookup data temporary namespac
Packit 423ecb
    xmlNsPtr *	tmpNsList	: Array of namespaces
Packit 423ecb
    int	tmpNsNr	: number of namespaces in scope error rep
Packit 423ecb
    void *	userData	: user specific data block
Packit 423ecb
    xmlStructuredErrorFunc	error	: the callback in case of errors
Packit 423ecb
    xmlError	lastError	: the last error
Packit 423ecb
    xmlNodePtr	debugNode	: the source node XSLT dictionary
Packit 423ecb
    xmlDictPtr	dict	: dictionary if any
Packit 423ecb
    int	flags	: flags to control compilation Cache for
Packit 423ecb
    void *	cache
Packit 423ecb
}

Enum xmlXPathError

Enum xmlXPathError {
Packit 423ecb
    XPATH_EXPRESSION_OK = 0
Packit 423ecb
    XPATH_NUMBER_ERROR = 1
Packit 423ecb
    XPATH_UNFINISHED_LITERAL_ERROR = 2
Packit 423ecb
    XPATH_START_LITERAL_ERROR = 3
Packit 423ecb
    XPATH_VARIABLE_REF_ERROR = 4
Packit 423ecb
    XPATH_UNDEF_VARIABLE_ERROR = 5
Packit 423ecb
    XPATH_INVALID_PREDICATE_ERROR = 6
Packit 423ecb
    XPATH_EXPR_ERROR = 7
Packit 423ecb
    XPATH_UNCLOSED_ERROR = 8
Packit 423ecb
    XPATH_UNKNOWN_FUNC_ERROR = 9
Packit 423ecb
    XPATH_INVALID_OPERAND = 10
Packit 423ecb
    XPATH_INVALID_TYPE = 11
Packit 423ecb
    XPATH_INVALID_ARITY = 12
Packit 423ecb
    XPATH_INVALID_CTXT_SIZE = 13
Packit 423ecb
    XPATH_INVALID_CTXT_POSITION = 14
Packit 423ecb
    XPATH_MEMORY_ERROR = 15
Packit 423ecb
    XPTR_SYNTAX_ERROR = 16
Packit 423ecb
    XPTR_RESOURCE_ERROR = 17
Packit 423ecb
    XPTR_SUB_RESOURCE_ERROR = 18
Packit 423ecb
    XPATH_UNDEF_PREFIX_ERROR = 19
Packit 423ecb
    XPATH_ENCODING_ERROR = 20
Packit 423ecb
    XPATH_INVALID_CHAR_ERROR = 21
Packit 423ecb
    XPATH_INVALID_CTXT = 22
Packit 423ecb
    XPATH_STACK_ERROR = 23
Packit 423ecb
    XPATH_FORBID_VARIABLE_ERROR = 24
Packit 423ecb
}
Packit 423ecb

Structure xmlXPathFunct

Structure xmlXPathFunct
struct _xmlXPathFunct {
Packit 423ecb
    const xmlChar *	name	: the function name
Packit 423ecb
    xmlXPathEvalFunc	func	: the evaluation function
Packit 423ecb
}

Structure xmlXPathObject

Structure xmlXPathObject
struct _xmlXPathObject {
Packit 423ecb
    xmlXPathObjectType	type
Packit 423ecb
    xmlNodeSetPtr	nodesetval
Packit 423ecb
    int	boolval
Packit 423ecb
    double	floatval
Packit 423ecb
    xmlChar *	stringval
Packit 423ecb
    void *	user
Packit 423ecb
    int	index
Packit 423ecb
    void *	user2
Packit 423ecb
    int	index2
Packit 423ecb
}

Enum xmlXPathObjectType

Enum xmlXPathObjectType {
Packit 423ecb
    XPATH_UNDEFINED = 0
Packit 423ecb
    XPATH_NODESET = 1
Packit 423ecb
    XPATH_BOOLEAN = 2
Packit 423ecb
    XPATH_NUMBER = 3
Packit 423ecb
    XPATH_STRING = 4
Packit 423ecb
    XPATH_POINT = 5
Packit 423ecb
    XPATH_RANGE = 6
Packit 423ecb
    XPATH_LOCATIONSET = 7
Packit 423ecb
    XPATH_USERS = 8
Packit 423ecb
    XPATH_XSLT_TREE = 9 : An XSLT value tree, non modifiable
Packit 423ecb
}
Packit 423ecb

Structure xmlXPathParserContext

Structure xmlXPathParserContext
struct _xmlXPathParserContext {
Packit 423ecb
    const xmlChar *	cur	: the current char being parsed
Packit 423ecb
    const xmlChar *	base	: the full expression
Packit 423ecb
    int	error	: error code
Packit 423ecb
    xmlXPathContextPtr	context	: the evaluation context
Packit 423ecb
    xmlXPathObjectPtr	value	: the current value
Packit 423ecb
    int	valueNr	: number of values stacked
Packit 423ecb
    int	valueMax	: max number of values stacked
Packit 423ecb
    xmlXPathObjectPtr *	valueTab	: stack of values
Packit 423ecb
    xmlXPathCompExprPtr	comp	: the precompiled expression
Packit 423ecb
    int	xptr	: it this an XPointer expression
Packit 423ecb
    xmlNodePtr	ancestor	: used for walking preceding axis
Packit 423ecb
    int	valueFrame	: used to limit Pop on the stack
Packit 423ecb
}

Structure xmlXPathType

Structure xmlXPathType
struct _xmlXPathType {
Packit 423ecb
    const xmlChar *	name	: the type name
Packit 423ecb
    xmlXPathConvertFunc	func	: the conversion function
Packit 423ecb
}

Structure xmlXPathVariable

Structure xmlXPathVariable
struct _xmlXPathVariable {
Packit 423ecb
    const xmlChar *	name	: the variable name
Packit 423ecb
    xmlXPathObjectPtr	value	: the value
Packit 423ecb
}

Function type: xmlXPathAxisFunc

Function type: xmlXPathAxisFunc
Packit 423ecb
xmlXPathObjectPtr	xmlXPathAxisFunc	(xmlXPathParserContextPtr ctxt, 
xmlXPathObjectPtr cur)
Packit 423ecb

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.

<tt>ctxt</tt>:the XPath interpreter context
<tt>cur</tt>:the previous node being explored on that axis
<tt>Returns</tt>:the next node in that axis or NULL if at the end of the axis.

Packit 423ecb

Function: xmlXPathCastBooleanToNumber

double	xmlXPathCastBooleanToNumber	(int val)
Packit 423ecb

Converts a boolean to its number value

Packit 423ecb
<tt>val</tt>:a boolean
<tt>Returns</tt>:the number value

Function: xmlXPathCastBooleanToString

xmlChar *	xmlXPathCastBooleanToString	(int val)
Packit 423ecb

Converts a boolean to its string value.

Packit 423ecb
<tt>val</tt>:a boolean
<tt>Returns</tt>:a newly allocated string.

Function: xmlXPathCastNodeSetToBoolean

int	xmlXPathCastNodeSetToBoolean	(xmlNodeSetPtr ns)
Packit 423ecb

Converts a node-set to its boolean value

Packit 423ecb
<tt>ns</tt>:a node-set
<tt>Returns</tt>:the boolean value

Function: xmlXPathCastNodeSetToNumber

double	xmlXPathCastNodeSetToNumber	(xmlNodeSetPtr ns)
Packit 423ecb

Converts a node-set to its number value

Packit 423ecb
<tt>ns</tt>:a node-set
<tt>Returns</tt>:the number value

Function: xmlXPathCastNodeSetToString

xmlChar *	xmlXPathCastNodeSetToString	(xmlNodeSetPtr ns)
Packit 423ecb

Converts a node-set to its string value.

Packit 423ecb
<tt>ns</tt>:a node-set
<tt>Returns</tt>:a newly allocated string.

Function: xmlXPathCastNodeToNumber

double	xmlXPathCastNodeToNumber	(xmlNodePtr node)
Packit 423ecb

Converts a node to its number value

Packit 423ecb
<tt>node</tt>:a node
<tt>Returns</tt>:the number value

Function: xmlXPathCastNodeToString

xmlChar *	xmlXPathCastNodeToString	(xmlNodePtr node)
Packit 423ecb

Converts a node to its string value.

Packit 423ecb
<tt>node</tt>:a node
<tt>Returns</tt>:a newly allocated string.

Function: xmlXPathCastNumberToBoolean

int	xmlXPathCastNumberToBoolean	(double val)
Packit 423ecb

Converts a number to its boolean value

Packit 423ecb
<tt>val</tt>:a number
<tt>Returns</tt>:the boolean value

Function: xmlXPathCastNumberToString

xmlChar *	xmlXPathCastNumberToString	(double val)
Packit 423ecb

Converts a number to its string value.

Packit 423ecb
<tt>val</tt>:a number
<tt>Returns</tt>:a newly allocated string.

Function: xmlXPathCastStringToBoolean

int	xmlXPathCastStringToBoolean	(const xmlChar * val)
Packit 423ecb

Converts a string to its boolean value

Packit 423ecb
<tt>val</tt>:a string
<tt>Returns</tt>:the boolean value

Function: xmlXPathCastStringToNumber

double	xmlXPathCastStringToNumber	(const xmlChar * val)
Packit 423ecb

Converts a string to its number value

Packit 423ecb
<tt>val</tt>:a string
<tt>Returns</tt>:the number value

Function: xmlXPathCastToBoolean

int	xmlXPathCastToBoolean		(xmlXPathObjectPtr val)
Packit 423ecb

Converts an XPath object to its boolean value

Packit 423ecb
<tt>val</tt>:an XPath object
<tt>Returns</tt>:the boolean value

Function: xmlXPathCastToNumber

double	xmlXPathCastToNumber		(xmlXPathObjectPtr val)
Packit 423ecb

Converts an XPath object to its number value

Packit 423ecb
<tt>val</tt>:an XPath object
<tt>Returns</tt>:the number value

Function: xmlXPathCastToString

xmlChar *	xmlXPathCastToString	(xmlXPathObjectPtr val)
Packit 423ecb

Converts an existing object to its string() equivalent

Packit 423ecb
<tt>val</tt>:an XPath object
<tt>Returns</tt>:the allocated string value of the object, NULL in case of error. It's up to the caller to free the string memory with xmlFree().

Function: xmlXPathCmpNodes

int	xmlXPathCmpNodes		(xmlNodePtr node1, 
xmlNodePtr node2)
Packit 423ecb

Compare two nodes w.r.t document order

Packit 423ecb
<tt>node1</tt>:the first node
<tt>node2</tt>:the second node
<tt>Returns</tt>:-2 in case of error 1 if first point < second point, 0 if it's the same node, -1 otherwise

Function: xmlXPathCompile

xmlXPathCompExprPtr	xmlXPathCompile	(const xmlChar * str)
Packit 423ecb

Compile an XPath expression

Packit 423ecb
<tt>str</tt>:the XPath expression
<tt>Returns</tt>:the xmlXPathCompExprPtr resulting from the compilation or NULL. the caller has to free the object.

Function: xmlXPathCompiledEval

xmlXPathObjectPtr	xmlXPathCompiledEval	(xmlXPathCompExprPtr comp, 
xmlXPathContextPtr ctx)
Packit 423ecb

Evaluate the Precompiled XPath expression in the given context.

Packit 423ecb
<tt>comp</tt>:the compiled XPath expression
<tt>ctx</tt>:the XPath context
<tt>Returns</tt>:the xmlXPathObjectPtr resulting from the evaluation or NULL. the caller has to free the object.

Function: xmlXPathCompiledEvalToBoolean

int	xmlXPathCompiledEvalToBoolean	(xmlXPathCompExprPtr comp, 
xmlXPathContextPtr ctxt)
Packit 423ecb

Applies the XPath boolean() function on the result of the given compiled expression.

Packit 423ecb
<tt>comp</tt>:the compiled XPath expression
<tt>ctxt</tt>:the XPath context
<tt>Returns</tt>:1 if the expression evaluated to true, 0 if to false and -1 in API and internal errors.

Function: xmlXPathContextSetCache

int	xmlXPathContextSetCache		(xmlXPathContextPtr ctxt, 
int active,
int value,
int options)
Packit 423ecb

Creates/frees an object cache on the XPath context. If activates XPath objects (xmlXPathObject) will be cached internally to be reused. @options: 0: This will set the XPath object caching: @value: This will set the maximum number of XPath objects to be cached per slot There are 5 slots for: node-set, string, number, boolean, and misc objects. Use <0 for the default number (100). Other values for @options have currently no effect.

Packit 423ecb
<tt>ctxt</tt>:the XPath context
<tt>active</tt>:enables/disables (creates/frees) the cache
<tt>value</tt>:a value with semantics dependant on @options
<tt>options</tt>:options (currently only the value 0 is used)
<tt>Returns</tt>:0 if the setting succeeded, and -1 on API or internal errors.

Function: xmlXPathConvertBoolean

xmlXPathObjectPtr	xmlXPathConvertBoolean	(xmlXPathObjectPtr val)
Packit 423ecb

Converts an existing object to its boolean() equivalent

Packit 423ecb
<tt>val</tt>:an XPath object
<tt>Returns</tt>:the new object, the old one is freed (or the operation is done directly on @val)

Function type: xmlXPathConvertFunc

Function type: xmlXPathConvertFunc
Packit 423ecb
int	xmlXPathConvertFunc		(xmlXPathObjectPtr obj, 
int type)
Packit 423ecb

A conversion function is associated to a type and used to cast the new type to primitive values.

<tt>obj</tt>:an XPath object
<tt>type</tt>:the number of the target type
<tt>Returns</tt>:-1 in case of error, 0 otherwise

Packit 423ecb

Function: xmlXPathConvertNumber

xmlXPathObjectPtr	xmlXPathConvertNumber	(xmlXPathObjectPtr val)
Packit 423ecb

Converts an existing object to its number() equivalent

Packit 423ecb
<tt>val</tt>:an XPath object
<tt>Returns</tt>:the new object, the old one is freed (or the operation is done directly on @val)

Function: xmlXPathConvertString

xmlXPathObjectPtr	xmlXPathConvertString	(xmlXPathObjectPtr val)
Packit 423ecb

Converts an existing object to its string() equivalent

Packit 423ecb
<tt>val</tt>:an XPath object
<tt>Returns</tt>:the new object, the old one is freed (or the operation is done directly on @val)

Function: xmlXPathCtxtCompile

xmlXPathCompExprPtr	xmlXPathCtxtCompile	(xmlXPathContextPtr ctxt, 
const xmlChar * str)
Packit 423ecb

Compile an XPath expression

Packit 423ecb
<tt>ctxt</tt>:an XPath context
<tt>str</tt>:the XPath expression
<tt>Returns</tt>:the xmlXPathCompExprPtr resulting from the compilation or NULL. the caller has to free the object.

Function: xmlXPathEval

xmlXPathObjectPtr	xmlXPathEval	(const xmlChar * str, 
xmlXPathContextPtr ctx)
Packit 423ecb

Evaluate the XPath Location Path in the given context.

Packit 423ecb
<tt>str</tt>:the XPath expression
<tt>ctx</tt>:the XPath context
<tt>Returns</tt>:the xmlXPathObjectPtr resulting from the evaluation or NULL. the caller has to free the object.

Function: xmlXPathEvalExpression

xmlXPathObjectPtr	xmlXPathEvalExpression	(const xmlChar * str, 
xmlXPathContextPtr ctxt)
Packit 423ecb

Alias for xmlXPathEval().

Packit 423ecb
<tt>str</tt>:the XPath expression
<tt>ctxt</tt>:the XPath context
<tt>Returns</tt>:the xmlXPathObjectPtr resulting from the evaluation or NULL. the caller has to free the object.

Function type: xmlXPathEvalFunc

Function type: xmlXPathEvalFunc
Packit 423ecb
void	xmlXPathEvalFunc		(xmlXPathParserContextPtr ctxt, 
int nargs)
Packit 423ecb

An XPath evaluation function, the parameters are on the XPath context stack.

<tt>ctxt</tt>:an XPath parser context
<tt>nargs</tt>:the number of arguments passed to the function

Packit 423ecb

Function: xmlXPathEvalPredicate

int	xmlXPathEvalPredicate		(xmlXPathContextPtr ctxt, 
xmlXPathObjectPtr res)
Packit 423ecb

Evaluate a predicate result for the current node. A PredicateExpr is evaluated by evaluating the Expr and converting the result to a boolean. If the result is a number, the result will be converted to true if the number is equal to the position of the context node in the context node list (as returned by the position function) and will be converted to false otherwise; if the result is not a number, then the result will be converted as if by a call to the boolean function.

Packit 423ecb
<tt>ctxt</tt>:the XPath context
<tt>res</tt>:the Predicate Expression evaluation result
<tt>Returns</tt>:1 if predicate is true, 0 otherwise

Function: xmlXPathFreeCompExpr

void	xmlXPathFreeCompExpr		(xmlXPathCompExprPtr comp)
Packit 423ecb

Free up the memory allocated by @comp

Packit 423ecb
<tt>comp</tt>:an XPATH comp

Function: xmlXPathFreeContext

void	xmlXPathFreeContext		(xmlXPathContextPtr ctxt)
Packit 423ecb

Free up an xmlXPathContext

Packit 423ecb
<tt>ctxt</tt>:the context to free

Function: xmlXPathFreeNodeSet

void	xmlXPathFreeNodeSet		(xmlNodeSetPtr obj)
Packit 423ecb

Free the NodeSet compound (not the actual nodes !).

Packit 423ecb
<tt>obj</tt>:the xmlNodeSetPtr to free

Function: xmlXPathFreeNodeSetList

void	xmlXPathFreeNodeSetList		(xmlXPathObjectPtr obj)
Packit 423ecb

Free up the xmlXPathObjectPtr @obj but don't deallocate the objects in the list contrary to xmlXPathFreeObject().

Packit 423ecb
<tt>obj</tt>:an existing NodeSetList object

Function: xmlXPathFreeObject

void	xmlXPathFreeObject		(xmlXPathObjectPtr obj)
Packit 423ecb

Free up an xmlXPathObjectPtr object.

Packit 423ecb
<tt>obj</tt>:the object to free

Function type: xmlXPathFuncLookupFunc

Function type: xmlXPathFuncLookupFunc
Packit 423ecb
xmlXPathFunction	xmlXPathFuncLookupFunc	(void * ctxt, 
const xmlChar * name,
const xmlChar * ns_uri)
Packit 423ecb

Prototype for callbacks used to plug function lookup in the XPath engine.

<tt>ctxt</tt>:an XPath context
<tt>name</tt>:name of the function
<tt>ns_uri</tt>:the namespace name hosting this function
<tt>Returns</tt>:the XPath function or NULL if not found.

Packit 423ecb

Function type: xmlXPathFunction

Function type: xmlXPathFunction
Packit 423ecb
void	xmlXPathFunction		(xmlXPathParserContextPtr ctxt, 
int nargs)
Packit 423ecb

An XPath function. The arguments (if any) are popped out from the context stack and the result is pushed on the stack.

<tt>ctxt</tt>:the XPath interprestation context
<tt>nargs</tt>:the number of arguments

Packit 423ecb

Function: xmlXPathInit

void	xmlXPathInit			(void)
Packit 423ecb

Initialize the XPath environment

Packit 423ecb

Function: xmlXPathIsInf

int	xmlXPathIsInf			(double val)
Packit 423ecb

Provides a portable isinf() function to detect whether a double is a +Infinite or -Infinite. Based on trio code http://sourceforge.net/projects/ctrio/

Packit 423ecb
<tt>val</tt>:a double value
<tt>Returns</tt>:1 vi the value is +Infinite, -1 if -Infinite, 0 otherwise

Function: xmlXPathIsNaN

int	xmlXPathIsNaN			(double val)
Packit 423ecb

Provides a portable isnan() function to detect whether a double is a NotaNumber. Based on trio code http://sourceforge.net/projects/ctrio/

Packit 423ecb
<tt>val</tt>:a double value
<tt>Returns</tt>:1 if the value is a NaN, 0 otherwise

Function: xmlXPathNewContext

xmlXPathContextPtr	xmlXPathNewContext	(xmlDocPtr doc)
Packit 423ecb

Create a new xmlXPathContext

Packit 423ecb
<tt>doc</tt>:the XML document
<tt>Returns</tt>:the xmlXPathContext just allocated. The caller will need to free it.

Function: xmlXPathNodeEval

xmlXPathObjectPtr	xmlXPathNodeEval	(xmlNodePtr node, 
const xmlChar * str,
xmlXPathContextPtr ctx)
Packit 423ecb

Evaluate the XPath Location Path in the given context. The node 'node' is set as the context node. The context node is not restored.

Packit 423ecb
<tt>node</tt>:the node to to use as the context node
<tt>str</tt>:the XPath expression
<tt>ctx</tt>:the XPath context
<tt>Returns</tt>:the xmlXPathObjectPtr resulting from the evaluation or NULL. the caller has to free the object.

Function: xmlXPathNodeSetCreate

xmlNodeSetPtr	xmlXPathNodeSetCreate	(xmlNodePtr val)
Packit 423ecb

Create a new xmlNodeSetPtr of type double and of value @val

Packit 423ecb
<tt>val</tt>:an initial xmlNodePtr, or NULL
<tt>Returns</tt>:the newly created object.

Function: xmlXPathObjectCopy

xmlXPathObjectPtr	xmlXPathObjectCopy	(xmlXPathObjectPtr val)
Packit 423ecb

allocate a new copy of a given object

Packit 423ecb
<tt>val</tt>:the original object
<tt>Returns</tt>:the newly created object.

Function: xmlXPathOrderDocElems

long	xmlXPathOrderDocElems		(xmlDocPtr doc)
Packit 423ecb

Call this routine to speed up XPath computation on static documents. This stamps all the element nodes with the document order Like for line information, the order is kept in the element->content field, the value stored is actually - the node number (starting at -1) to be able to differentiate from line numbers.

Packit 423ecb
<tt>doc</tt>:an input document
<tt>Returns</tt>:the number of elements found in the document or -1 in case of error.

Function: xmlXPathSetContextNode

int	xmlXPathSetContextNode		(xmlNodePtr node, 
xmlXPathContextPtr ctx)
Packit 423ecb

Sets 'node' as the context node. The node must be in the same document as that associated with the context.

Packit 423ecb
<tt>node</tt>:the node to to use as the context node
<tt>ctx</tt>:the XPath context
<tt>Returns</tt>:-1 in case of error or 0 if successful

Function type: xmlXPathVariableLookupFunc

Function type: xmlXPathVariableLookupFunc
Packit 423ecb
xmlXPathObjectPtr	xmlXPathVariableLookupFunc	(void * ctxt, 
const xmlChar * name,
const xmlChar * ns_uri)
Packit 423ecb

Prototype for callbacks used to plug variable lookup in the XPath engine.

<tt>ctxt</tt>:an XPath context
<tt>name</tt>:name of the variable
<tt>ns_uri</tt>:the namespace name hosting this variable
<tt>Returns</tt>:the XPath object value or NULL if not found.

Packit 423ecb

Daniel Veillard

</body></html>