![]() | ![]() | ![]() | [Insert name here] Reference Manual | ![]() |
---|
xpathInternals —
#define xmlXPathSetError (ctxt, err) #define xmlXPathSetArityError (ctxt) #define xmlXPathSetTypeError (ctxt) #define xmlXPathGetError (ctxt) #define xmlXPathCheckError (ctxt) #define xmlXPathGetDocument (ctxt) #define xmlXPathGetContextNode (ctxt) int xmlXPathPopBoolean (xmlXPathParserContextPtr ctxt);double xmlXPathPopNumber (xmlXPathParserContextPtr ctxt); xmlChar* xmlXPathPopString (xmlXPathParserContextPtr ctxt); xmlNodeSetPtr xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt); void* xmlXPathPopExternal (xmlXPathParserContextPtr ctxt); #define xmlXPathReturnBoolean (ctxt, val) #define xmlXPathReturnTrue (ctxt) #define xmlXPathReturnFalse (ctxt) #define xmlXPathReturnNumber (ctxt, val) #define xmlXPathReturnString (ctxt, str) #define xmlXPathReturnEmptyString (ctxt) #define xmlXPathReturnNodeSet (ctxt, ns) #define xmlXPathReturnEmptyNodeSet (ctxt) #define xmlXPathReturnExternal (ctxt, val) #define xmlXPathStackIsNodeSet (ctxt) #define xmlXPathStackIsExternal (ctxt) #define xmlXPathEmptyNodeSet (ns) #define CHECK_ERROR #define CHECK_ERROR0 #define XP_ERROR (X) #define XP_ERROR0 (X) #define CHECK_TYPE (typeval) #define CHECK_TYPE0 (typeval) #define CHECK_ARITY (x) #define CAST_TO_STRING #define CAST_TO_NUMBER #define CAST_TO_BOOLEAN xmlXPathObjectPtr (*xmlXPathVariableLookupFunc) (void *ctxt, const xmlChar *name, const xmlChar *ns_uri); void xmlXPathRegisterVariableLookup (xmlXPathContextPtr ctxt, xmlXPathVariableLookupFunc f, void *data); xmlXPathFunction (*xmlXPathFuncLookupFunc) (void *ctxt, const xmlChar *name, const xmlChar *ns_uri); void xmlXPathRegisterFuncLookup (xmlXPathContextPtr ctxt, xmlXPathFuncLookupFunc f, void *funcCtxt); void xmlXPatherror (xmlXPathParserContextPtr ctxt, const char *file, int line, int no); void xmlXPathDebugDumpObject (FILE *output, xmlXPathObjectPtr cur, int depth); void xmlXPathDebugDumpCompExpr (FILE *output, xmlXPathCompExprPtr comp, int depth); int xmlXPathNodeSetContains (xmlNodeSetPtr cur, xmlNodePtr val); xmlNodeSetPtr xmlXPathDifference (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2); xmlNodeSetPtr xmlXPathIntersection (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2); xmlNodeSetPtr xmlXPathDistinctSorted (xmlNodeSetPtr nodes); xmlNodeSetPtr xmlXPathDistinct (xmlNodeSetPtr nodes); int xmlXPathHasSameNodes (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2); xmlNodeSetPtr xmlXPathNodeLeadingSorted (xmlNodeSetPtr nodes, xmlNodePtr node); xmlNodeSetPtr xmlXPathLeadingSorted (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2); xmlNodeSetPtr xmlXPathNodeLeading (xmlNodeSetPtr nodes, xmlNodePtr node); xmlNodeSetPtr xmlXPathLeading (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2); xmlNodeSetPtr xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes, xmlNodePtr node); xmlNodeSetPtr xmlXPathTrailingSorted (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2); xmlNodeSetPtr xmlXPathNodeTrailing (xmlNodeSetPtr nodes, xmlNodePtr node); xmlNodeSetPtr xmlXPathTrailing (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2); int xmlXPathRegisterNs (xmlXPathContextPtr ctxt, const xmlChar *prefix, const xmlChar *ns_uri); const xmlChar* xmlXPathNsLookup (xmlXPathContextPtr ctxt, const xmlChar *prefix); void xmlXPathRegisteredNsCleanup (xmlXPathContextPtr ctxt); int xmlXPathRegisterFunc (xmlXPathContextPtr ctxt, const xmlChar *name, xmlXPathFunction f); int xmlXPathRegisterFuncNS (xmlXPathContextPtr ctxt, const xmlChar *name, const xmlChar *ns_uri, xmlXPathFunction f); int xmlXPathRegisterVariable (xmlXPathContextPtr ctxt, const xmlChar *name, xmlXPathObjectPtr value); int xmlXPathRegisterVariableNS (xmlXPathContextPtr ctxt, const xmlChar *name, const xmlChar *ns_uri, xmlXPathObjectPtr value); xmlXPathFunction xmlXPathFunctionLookup (xmlXPathContextPtr ctxt, const xmlChar *name); xmlXPathFunction xmlXPathFunctionLookupNS (xmlXPathContextPtr ctxt, const xmlChar *name, const xmlChar *ns_uri); void xmlXPathRegisteredFuncsCleanup (xmlXPathContextPtr ctxt); xmlXPathObjectPtr xmlXPathVariableLookup (xmlXPathContextPtr ctxt, const xmlChar *name); xmlXPathObjectPtr xmlXPathVariableLookupNS (xmlXPathContextPtr ctxt, const xmlChar *name, const xmlChar *ns_uri); void xmlXPathRegisteredVariablesCleanup (xmlXPathContextPtr ctxt); xmlXPathParserContextPtr xmlXPathNewParserContext (const xmlChar *str, xmlXPathContextPtr ctxt); void xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt); xmlXPathObjectPtr valuePop (xmlXPathParserContextPtr ctxt); int valuePush (xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr value); xmlXPathObjectPtr xmlXPathNewString (const xmlChar *val); xmlXPathObjectPtr xmlXPathNewCString (const char *val); xmlXPathObjectPtr xmlXPathWrapString (xmlChar *val); xmlXPathObjectPtr xmlXPathWrapCString (char *val); xmlXPathObjectPtr xmlXPathNewFloat (double val); xmlXPathObjectPtr xmlXPathNewBoolean (int val); xmlXPathObjectPtr xmlXPathNewNodeSet (xmlNodePtr val); xmlXPathObjectPtr xmlXPathNewValueTree (xmlNodePtr val); void xmlXPathNodeSetAdd (xmlNodeSetPtr cur, xmlNodePtr val); void xmlXPathNodeSetAddUnique (xmlNodeSetPtr cur, xmlNodePtr val); void xmlXPathNodeSetAddNs (xmlNodeSetPtr cur, xmlNodePtr node, xmlNsPtr ns); void xmlXPathNodeSetSort (xmlNodeSetPtr set); void xmlXPathRoot (xmlXPathParserContextPtr ctxt); void xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt); xmlChar* xmlXPathParseName (xmlXPathParserContextPtr ctxt); xmlChar* xmlXPathParseNCName (xmlXPathParserContextPtr ctxt);double xmlXPathStringEvalNumber (const xmlChar *str); int xmlXPathEvaluatePredicateResult (xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr res); void xmlXPathRegisterAllFunctions (xmlXPathContextPtr ctxt); xmlNodeSetPtr xmlXPathNodeSetMerge (xmlNodeSetPtr val1, xmlNodeSetPtr val2); void xmlXPathNodeSetDel (xmlNodeSetPtr cur, xmlNodePtr val); void xmlXPathNodeSetRemove (xmlNodeSetPtr cur, int val); xmlXPathObjectPtr xmlXPathNewNodeSetList (xmlNodeSetPtr val); xmlXPathObjectPtr xmlXPathWrapNodeSet (xmlNodeSetPtr val); xmlXPathObjectPtr xmlXPathWrapExternal (void *val); int xmlXPathEqualValues (xmlXPathParserContextPtr ctxt); int xmlXPathNotEqualValues (xmlXPathParserContextPtr ctxt); int xmlXPathCompareValues (xmlXPathParserContextPtr ctxt, int inf, int strict); void xmlXPathValueFlipSign (xmlXPathParserContextPtr ctxt); void xmlXPathAddValues (xmlXPathParserContextPtr ctxt); void xmlXPathSubValues (xmlXPathParserContextPtr ctxt); void xmlXPathMultValues (xmlXPathParserContextPtr ctxt); void xmlXPathDivValues (xmlXPathParserContextPtr ctxt); void xmlXPathModValues (xmlXPathParserContextPtr ctxt); int xmlXPathIsNodeType (const xmlChar *name); xmlNodePtr xmlXPathNextSelf (xmlXPathParserContextPtr ctxt, xmlNodePtr cur); xmlNodePtr xmlXPathNextChild (xmlXPathParserContextPtr ctxt, xmlNodePtr cur); xmlNodePtr xmlXPathNextDescendant (xmlXPathParserContextPtr ctxt, xmlNodePtr cur); xmlNodePtr xmlXPathNextDescendantOrSelf (xmlXPathParserContextPtr ctxt, xmlNodePtr cur); xmlNodePtr xmlXPathNextParent (xmlXPathParserContextPtr ctxt, xmlNodePtr cur); xmlNodePtr xmlXPathNextAncestorOrSelf (xmlXPathParserContextPtr ctxt, xmlNodePtr cur); xmlNodePtr xmlXPathNextFollowingSibling (xmlXPathParserContextPtr ctxt, xmlNodePtr cur); xmlNodePtr xmlXPathNextFollowing (xmlXPathParserContextPtr ctxt, xmlNodePtr cur); xmlNodePtr xmlXPathNextNamespace (xmlXPathParserContextPtr ctxt, xmlNodePtr cur); xmlNodePtr xmlXPathNextAttribute (xmlXPathParserContextPtr ctxt, xmlNodePtr cur); xmlNodePtr xmlXPathNextPreceding (xmlXPathParserContextPtr ctxt, xmlNodePtr cur); xmlNodePtr xmlXPathNextAncestor (xmlXPathParserContextPtr ctxt, xmlNodePtr cur); xmlNodePtr xmlXPathNextPrecedingSibling (xmlXPathParserContextPtr ctxt, xmlNodePtr cur); void xmlXPathLastFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathPositionFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathCountFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathIdFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathLocalNameFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathNamespaceURIFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathStringFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathStringLengthFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathConcatFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathContainsFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathStartsWithFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathSubstringFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathSubstringBeforeFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathSubstringAfterFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathNormalizeFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathTranslateFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathNotFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathTrueFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathFalseFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathLangFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathNumberFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathSumFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathFloorFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathCeilingFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathRoundFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathBooleanFunction (xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathNodeSetFreeNs (xmlNsPtr ns);
#define xmlXPathSetError(ctxt, err)
Raises an error.
ctxt : | an XPath parser context |
err : | an xmlXPathError code |
#define xmlXPathSetArityError(ctxt)
Raises an XPATH_INVALID_ARITY error.
ctxt : | an XPath parser context |
#define xmlXPathSetTypeError(ctxt)
Raises an XPATH_INVALID_TYPE error.
ctxt : | an XPath parser context |
#define xmlXPathGetError(ctxt) ((ctxt)->error)
Get the error code of an XPath context.
ctxt : | an XPath parser context |
#define xmlXPathCheckError(ctxt) ((ctxt)->error != XPATH_EXPRESSION_OK)
Check if an XPath error was raised.
ctxt : | an XPath parser context |
#define xmlXPathGetDocument(ctxt) ((ctxt)->context->doc)
Get the document of an XPath context.
ctxt : | an XPath parser context |
#define xmlXPathGetContextNode(ctxt) ((ctxt)->context->node)
Get the context node of an XPath context.
ctxt : | an XPath parser context |
int xmlXPathPopBoolean (xmlXPathParserContextPtr ctxt);
Pops a boolean from the stack, handling conversion if needed. Check error with xmlXPathCheckError.
ctxt : | an XPath parser context |
Returns : | the boolean |
double xmlXPathPopNumber (xmlXPathParserContextPtr ctxt);
Pops a number from the stack, handling conversion if needed. Check error with xmlXPathCheckError.
ctxt : | an XPath parser context |
Returns : | the number |
xmlChar* xmlXPathPopString (xmlXPathParserContextPtr ctxt);
Pops a string from the stack, handling conversion if needed. Check error with xmlXPathCheckError.
ctxt : | an XPath parser context |
Returns : | the string |
xmlNodeSetPtr xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt);
Pops a node-set from the stack, handling conversion if needed. Check error with xmlXPathCheckError.
ctxt : | an XPath parser context |
Returns : | the node-set |
void* xmlXPathPopExternal (xmlXPathParserContextPtr ctxt);
Pops an external object from the stack, handling conversion if needed. Check error with xmlXPathCheckError.
ctxt : | an XPath parser context |
#define xmlXPathReturnBoolean(ctxt, val)
Pushes the boolean val on the context stack.
ctxt : | an XPath parser context |
val : | a boolean |
#define xmlXPathReturnTrue(ctxt) xmlXPathReturnBoolean((ctxt), 1)
Pushes true on the context stack.
ctxt : | an XPath parser context |
#define xmlXPathReturnFalse(ctxt) xmlXPathReturnBoolean((ctxt), 0)
Pushes false on the context stack.
ctxt : | an XPath parser context |
#define xmlXPathReturnNumber(ctxt, val)
Pushes the double val on the context stack.
ctxt : | an XPath parser context |
val : | a double |
#define xmlXPathReturnString(ctxt, str)
Pushes the string str on the context stack.
ctxt : | an XPath parser context |
str : | a string |
#define xmlXPathReturnEmptyString(ctxt)
Pushes an empty string on the stack.
ctxt : | an XPath parser context |
#define xmlXPathReturnNodeSet(ctxt, ns)
Pushes the node-set ns on the context stack.
ctxt : | an XPath parser context |
ns : | a node-set |
#define xmlXPathReturnEmptyNodeSet(ctxt)
Pushes an empty node-set on the context stack.
ctxt : | an XPath parser context |
#define xmlXPathReturnExternal(ctxt, val)
Pushes user data on the context stack.
ctxt : | an XPath parser context |
val : | user data |
#define xmlXPathStackIsNodeSet(ctxt)
Check if the current value on the XPath stack is a node set or an XSLT value tree.
ctxt : | an XPath parser context |
#define xmlXPathStackIsExternal(ctxt)
Checks if the current value on the XPath stack is an external object.
ctxt : | an XPath parser context |
#define CHECK_ERROR0
Macro to return 0 from the function if an XPath error was detected.
#define CHECK_TYPE(typeval)
Macro to check that the value on top of the XPath stack is of a given type.
typeval : | the XPath type |
#define CHECK_TYPE0(typeval)
Macro to check that the value on top of the XPath stack is of a given type. Return(0) in case of failure
typeval : | the XPath type |
#define CHECK_ARITY(x)
Macro to check that the number of args passed to an XPath function matches.
x : | the number of expected args |
#define CAST_TO_STRING
Macro to try to cast the value on the top of the XPath stack to a string.
#define CAST_TO_NUMBER
Macro to try to cast the value on the top of the XPath stack to a number.
#define CAST_TO_BOOLEAN
Macro to try to cast the value on the top of the XPath stack to a boolean.
xmlXPathObjectPtr (*xmlXPathVariableLookupFunc) (void *ctxt, const xmlChar *name, const xmlChar *ns_uri);
Prototype for callbacks used to plug variable lookup in the XPath engine.
ctxt : | an XPath context |
name : | name of the variable |
ns_uri : | the namespace name hosting this variable |
Returns : | the XPath object value or NULL if not found. |
void xmlXPathRegisterVariableLookup (xmlXPathContextPtr ctxt, xmlXPathVariableLookupFunc f, void *data);
register an external mechanism to do variable lookup
ctxt : | the XPath context |
f : | the lookup function |
data : | the lookup data |
xmlXPathFunction (*xmlXPathFuncLookupFunc) (void *ctxt, const xmlChar *name, const xmlChar *ns_uri);
Prototype for callbacks used to plug function lookup in the XPath engine.
ctxt : | an XPath context |
name : | name of the function |
ns_uri : | the namespace name hosting this function |
Returns : | the XPath function or NULL if not found. |
void xmlXPathRegisterFuncLookup (xmlXPathContextPtr ctxt, xmlXPathFuncLookupFunc f, void *funcCtxt);
Registers an external mechanism to do function lookup.
ctxt : | the XPath context |
f : | the lookup function |
funcCtxt : | the lookup data |
void xmlXPatherror (xmlXPathParserContextPtr ctxt, const char *file, int line, int no);
Formats an error message.
ctxt : | the XPath Parser context |
file : | the file name |
line : | the line number |
no : | the error number |
void xmlXPathDebugDumpObject (FILE *output, xmlXPathObjectPtr cur, int depth);
Dump the content of the object for debugging purposes
output : | the FILE * to dump the output |
cur : | the object to inspect |
depth : | indentation level |
void xmlXPathDebugDumpCompExpr (FILE *output, xmlXPathCompExprPtr comp, int depth);
Dumps the tree of the compiled XPath expression.
output : | the FILE * for the output |
comp : | the precompiled XPath expression |
depth : | the indentation level. |
int xmlXPathNodeSetContains (xmlNodeSetPtr cur, xmlNodePtr val);
checks whether cur contains val
cur : | the node-set |
val : | the node |
Returns : | true (1) if cur contains val, false (0) otherwise |
xmlNodeSetPtr xmlXPathDifference (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2);
Implements the EXSLT - Sets
nodes1 : | a node-set |
nodes2 : | a node-set |
Returns : | the difference between the two node sets, or nodes1 if nodes2 is empty |
xmlNodeSetPtr xmlXPathIntersection (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2);
Implements the EXSLT - Sets
nodes1 : | a node-set |
nodes2 : | a node-set |
Returns : | a node set comprising the nodes that are within both the node sets passed as arguments |
xmlNodeSetPtr xmlXPathDistinctSorted (xmlNodeSetPtr nodes);
Implements the EXSLT - Sets
nodes : | a node-set, sorted by document order |
Returns : | a subset of the nodes contained in nodes, or nodes if it is empty |
xmlNodeSetPtr xmlXPathDistinct (xmlNodeSetPtr nodes);
Implements the EXSLT - Sets
nodes : | a node-set |
Returns : | a subset of the nodes contained in nodes, or nodes if it is empty |
int xmlXPathHasSameNodes (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2);
Implements the EXSLT - Sets has-same-nodes function: boolean set:has-same-node(node-set, node-set)
nodes1 : | a node-set |
nodes2 : | a node-set |
Returns : | true (1) if nodes1 shares any node with nodes2, false (0) otherwise |
xmlNodeSetPtr xmlXPathNodeLeadingSorted (xmlNodeSetPtr nodes, xmlNodePtr node);
Implements the EXSLT - Sets
nodes : | a node-set, sorted by document order |
node : | a node |
Returns : | the nodes in nodes that precede node in document order, nodes if node is NULL or an empty node-set if nodes doesn't contain node |
xmlNodeSetPtr xmlXPathLeadingSorted (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2);
Implements the EXSLT - Sets
nodes1 : | a node-set, sorted by document order |
nodes2 : | a node-set, sorted by document order |
Returns : | the nodes in nodes1 that precede the first node in nodes2 in document order, nodes1 if nodes2 is NULL or empty or an empty node-set if nodes1 doesn't contain nodes2 |
xmlNodeSetPtr xmlXPathNodeLeading (xmlNodeSetPtr nodes, xmlNodePtr node);
Implements the EXSLT - Sets
nodes : | a node-set |
node : | a node |
Returns : | the nodes in nodes that precede node in document order, nodes if node is NULL or an empty node-set if nodes doesn't contain node |
xmlNodeSetPtr xmlXPathLeading (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2);
Implements the EXSLT - Sets
nodes1 : | a node-set |
nodes2 : | a node-set |
Returns : | the nodes in nodes1 that precede the first node in nodes2 in document order, nodes1 if nodes2 is NULL or empty or an empty node-set if nodes1 doesn't contain nodes2 |
xmlNodeSetPtr xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes, xmlNodePtr node);
Implements the EXSLT - Sets
nodes : | a node-set, sorted by document order |
node : | a node |
Returns : | the nodes in nodes that follow node in document order, nodes if node is NULL or an empty node-set if nodes doesn't contain node |
xmlNodeSetPtr xmlXPathTrailingSorted (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2);
Implements the EXSLT - Sets
nodes1 : | a node-set, sorted by document order |
nodes2 : | a node-set, sorted by document order |
Returns : | the nodes in nodes1 that follow the first node in nodes2 in document order, nodes1 if nodes2 is NULL or empty or an empty node-set if nodes1 doesn't contain nodes2 |
xmlNodeSetPtr xmlXPathNodeTrailing (xmlNodeSetPtr nodes, xmlNodePtr node);
Implements the EXSLT - Sets
nodes : | a node-set |
node : | a node |
Returns : | the nodes in nodes that follow node in document order, nodes if node is NULL or an empty node-set if nodes doesn't contain node |
xmlNodeSetPtr xmlXPathTrailing (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2);
Implements the EXSLT - Sets
nodes1 : | a node-set |
nodes2 : | a node-set |
Returns : | the nodes in nodes1 that follow the first node in nodes2 in document order, nodes1 if nodes2 is NULL or empty or an empty node-set if nodes1 doesn't contain nodes2 |
int xmlXPathRegisterNs (xmlXPathContextPtr ctxt, const xmlChar *prefix, const xmlChar *ns_uri);
Register a new namespace. If ns_uri is NULL it unregisters the namespace
ctxt : | the XPath context |
prefix : | the namespace prefix |
ns_uri : | the namespace name |
Returns : | 0 in case of success, -1 in case of error |
const xmlChar* xmlXPathNsLookup (xmlXPathContextPtr ctxt, const xmlChar *prefix);
Search in the namespace declaration array of the context for the given namespace name associated to the given prefix
ctxt : | the XPath context |
prefix : | the namespace prefix value |
Returns : | the value or NULL if not found |
void xmlXPathRegisteredNsCleanup (xmlXPathContextPtr ctxt);
Cleanup the XPath context data associated to registered variables
ctxt : | the XPath context |
int xmlXPathRegisterFunc (xmlXPathContextPtr ctxt, const xmlChar *name, xmlXPathFunction f);
Register a new function. If f is NULL it unregisters the function
ctxt : | the XPath context |
name : | the function name |
f : | the function implementation or NULL |
Returns : | 0 in case of success, -1 in case of error |
int xmlXPathRegisterFuncNS (xmlXPathContextPtr ctxt, const xmlChar *name, const xmlChar *ns_uri, xmlXPathFunction f);
Register a new function. If f is NULL it unregisters the function
ctxt : | the XPath context |
name : | the function name |
ns_uri : | the function namespace URI |
f : | the function implementation or NULL |
Returns : | 0 in case of success, -1 in case of error |
int xmlXPathRegisterVariable (xmlXPathContextPtr ctxt, const xmlChar *name, xmlXPathObjectPtr value);
Register a new variable value. If value is NULL it unregisters the variable
ctxt : | the XPath context |
name : | the variable name |
value : | the variable value or NULL |
Returns : | 0 in case of success, -1 in case of error |
int xmlXPathRegisterVariableNS (xmlXPathContextPtr ctxt, const xmlChar *name, const xmlChar *ns_uri, xmlXPathObjectPtr value);
Register a new variable value. If value is NULL it unregisters the variable
ctxt : | the XPath context |
name : | the variable name |
ns_uri : | the variable namespace URI |
value : | the variable value or NULL |
Returns : | 0 in case of success, -1 in case of error |
xmlXPathFunction xmlXPathFunctionLookup (xmlXPathContextPtr ctxt, const xmlChar *name);
Search in the Function array of the context for the given function.
ctxt : | the XPath context |
name : | the function name |
Returns : | the xmlXPathFunction or NULL if not found |
xmlXPathFunction xmlXPathFunctionLookupNS (xmlXPathContextPtr ctxt, const xmlChar *name, const xmlChar *ns_uri);
Search in the Function array of the context for the given function.
ctxt : | the XPath context |
name : | the function name |
ns_uri : | the function namespace URI |
Returns : | the xmlXPathFunction or NULL if not found |
void xmlXPathRegisteredFuncsCleanup (xmlXPathContextPtr ctxt);
Cleanup the XPath context data associated to registered functions
ctxt : | the XPath context |
xmlXPathObjectPtr xmlXPathVariableLookup (xmlXPathContextPtr ctxt, const xmlChar *name);
Search in the Variable array of the context for the given variable value.
ctxt : | the XPath context |
name : | the variable name |
Returns : | a copy of the value or NULL if not found |
xmlXPathObjectPtr xmlXPathVariableLookupNS (xmlXPathContextPtr ctxt, const xmlChar *name, const xmlChar *ns_uri);
Search in the Variable array of the context for the given variable value.
ctxt : | the XPath context |
name : | the variable name |
ns_uri : | the variable namespace URI |
Returns : | the a copy of the value or NULL if not found |
void xmlXPathRegisteredVariablesCleanup (xmlXPathContextPtr ctxt);
Cleanup the XPath context data associated to registered variables
ctxt : | the XPath context |
xmlXPathParserContextPtr xmlXPathNewParserContext (const xmlChar *str, xmlXPathContextPtr ctxt);
Create a new xmlXPathParserContext
str : | the XPath expression |
ctxt : | the XPath context |
Returns : | the xmlXPathParserContext just allocated. |
void xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt);
Free up an xmlXPathParserContext
ctxt : | the context to free |
xmlXPathObjectPtr valuePop (xmlXPathParserContextPtr ctxt);
Pops the top XPath object from the value stack
ctxt : | an XPath evaluation context |
Returns : | the XPath object just removed |
int valuePush (xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr value);
Pushes a new XPath object on top of the value stack
ctxt : | an XPath evaluation context |
value : | the XPath object |
Returns : | the number of items on the value stack |
xmlXPathObjectPtr xmlXPathNewString (const xmlChar *val);
Create a new xmlXPathObjectPtr of type string and of value val
val : | the xmlChar * value |
Returns : | the newly created object. |
xmlXPathObjectPtr xmlXPathNewCString (const char *val);
Create a new xmlXPathObjectPtr of type string and of value val
val : | the char * value |
Returns : | the newly created object. |
xmlXPathObjectPtr xmlXPathWrapString (xmlChar *val);
Wraps the val string into an XPath object.
val : | the xmlChar * value |
Returns : | the newly created object. |
xmlXPathObjectPtr xmlXPathWrapCString (char *val);
Wraps a string into an XPath object.
val : | the char * value |
Returns : | the newly created object. |
xmlXPathObjectPtr xmlXPathNewFloat (double val);
Create a new xmlXPathObjectPtr of type double and of value val
val : | the double value |
Returns : | the newly created object. |
xmlXPathObjectPtr xmlXPathNewBoolean (int val);
Create a new xmlXPathObjectPtr of type boolean and of value val
val : | the boolean value |
Returns : | the newly created object. |
xmlXPathObjectPtr xmlXPathNewNodeSet (xmlNodePtr val);
Create a new xmlXPathObjectPtr of type NodeSet and initialize it with the single Node val
val : | the NodePtr value |
Returns : | the newly created object. |
xmlXPathObjectPtr xmlXPathNewValueTree (xmlNodePtr val);
Create a new xmlXPathObjectPtr of type Value Tree (XSLT) and initialize it with the tree root val
val : | the NodePtr value |
Returns : | the newly created object. |
void xmlXPathNodeSetAdd (xmlNodeSetPtr cur, xmlNodePtr val);
add a new xmlNodePtr to an existing NodeSet
cur : | the initial node set |
val : | a new xmlNodePtr |
void xmlXPathNodeSetAddUnique (xmlNodeSetPtr cur, xmlNodePtr val);
add a new xmlNodePtr to an existing NodeSet, optimized version when we are sure the node is not already in the set.
cur : | the initial node set |
val : | a new xmlNodePtr |
void xmlXPathNodeSetAddNs (xmlNodeSetPtr cur, xmlNodePtr node, xmlNsPtr ns);
add a new namespace node to an existing NodeSet
cur : | the initial node set |
node : | the hosting node |
ns : | a the namespace node |
void xmlXPathNodeSetSort (xmlNodeSetPtr set);
Sort the node set in document order
set : | the node set |
void xmlXPathRoot (xmlXPathParserContextPtr ctxt);
Initialize the context to the root of the document
ctxt : | the XPath Parser context |
void xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt);
Parse and evaluate an XPath expression in the given context, then push the result on the context stack
ctxt : | the XPath Parser context |
xmlChar* xmlXPathParseName (xmlXPathParserContextPtr ctxt);
parse an XML name
[4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender
[5] Name ::= (Letter | '_' | ':') (NameChar)*
ctxt : | the XPath Parser context |
Returns : | the namespace name or NULL |
xmlChar* xmlXPathParseNCName (xmlXPathParserContextPtr ctxt);
parse an XML namespace non qualified name.
[NS 3] NCName ::= (Letter | '_') (NCNameChar)*
[NS 4] NCNameChar ::= Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender
ctxt : | the XPath Parser context |
Returns : | the namespace name or NULL |
double xmlXPathStringEvalNumber (const xmlChar *str);
[30a] Float ::= Number ('e' Digits?)?
[30] Number ::= Digits ('.' Digits?)? | '.' Digits [31] Digits ::= [0-9]+
Compile a Number in the string In complement of the Number expression, this function also handles negative values : '-' Number.
str : | A string to scan |
Returns : | the double value. |
int xmlXPathEvaluatePredicateResult (xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr res);
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.
ctxt : | the XPath Parser context |
res : | the Predicate Expression evaluation result |
Returns : | 1 if predicate is true, 0 otherwise |
void xmlXPathRegisterAllFunctions (xmlXPathContextPtr ctxt);
Registers all default XPath functions in this context
ctxt : | the XPath context |
xmlNodeSetPtr xmlXPathNodeSetMerge (xmlNodeSetPtr val1, xmlNodeSetPtr val2);
Merges two nodesets, all nodes from val2 are added to val1 if val1 is NULL, a new set is created and copied from val2
val1 : | the first NodeSet or NULL |
val2 : | the second NodeSet |
Returns : | val1 once extended or NULL in case of error. |
void xmlXPathNodeSetDel (xmlNodeSetPtr cur, xmlNodePtr val);
Removes an xmlNodePtr from an existing NodeSet
cur : | the initial node set |
val : | an xmlNodePtr |
void xmlXPathNodeSetRemove (xmlNodeSetPtr cur, int val);
Removes an entry from an existing NodeSet list.
cur : | the initial node set |
val : | the index to remove |
xmlXPathObjectPtr xmlXPathNewNodeSetList (xmlNodeSetPtr val);
Create a new xmlXPathObjectPtr of type NodeSet and initialize it with the Nodeset val
val : | an existing NodeSet |
Returns : | the newly created object. |
xmlXPathObjectPtr xmlXPathWrapNodeSet (xmlNodeSetPtr val);
Wrap the Nodeset val in a new xmlXPathObjectPtr
val : | the NodePtr value |
Returns : | the newly created object. |
xmlXPathObjectPtr xmlXPathWrapExternal (void *val);
Wraps the val data into an XPath object.
val : | the user data |
Returns : | the newly created object. |
int xmlXPathEqualValues (xmlXPathParserContextPtr ctxt);
Implement the equal operation on XPath objects content: arg1 == arg2
ctxt : | the XPath Parser context |
Returns : | 0 or 1 depending on the results of the test. |
int xmlXPathNotEqualValues (xmlXPathParserContextPtr ctxt);
Implement the equal operation on XPath objects content: arg1 == arg2
ctxt : | the XPath Parser context |
Returns : | 0 or 1 depending on the results of the test. |
int xmlXPathCompareValues (xmlXPathParserContextPtr ctxt, int inf, int strict);
Implement the compare operation on XPath objects: arg1 < arg2 (1, 1, ... arg1 <= arg2 (1, 0, ... arg1 > arg2 (0, 1, ... arg1 >= arg2 (0, 0, ...
When neither object to be compared is a node-set and the operator is <=, <, >=, >, then the objects are compared by converted both objects to numbers and comparing the numbers according to IEEE 754. The < comparison will be true if and only if the first number is less than the second number. The <= comparison will be true if and only if the first number is less than or equal to the second number. The > comparison will be true if and only if the first number is greater than the second number. The >= comparison will be true if and only if the first number is greater than or equal to the second number.
ctxt : | the XPath Parser context |
inf : | less than (1) or greater than (0) |
strict : | is the comparison strict |
Returns : | 1 if the comparison succeeded, 0 if it failed |
void xmlXPathValueFlipSign (xmlXPathParserContextPtr ctxt);
Implement the unary - operation on an XPath object The numeric operators convert their operands to numbers as if by calling the number function.
ctxt : | the XPath Parser context |
void xmlXPathAddValues (xmlXPathParserContextPtr ctxt);
Implement the add operation on XPath objects: The numeric operators convert their operands to numbers as if by calling the number function.
ctxt : | the XPath Parser context |
void xmlXPathSubValues (xmlXPathParserContextPtr ctxt);
Implement the subtraction operation on XPath objects: The numeric operators convert their operands to numbers as if by calling the number function.
ctxt : | the XPath Parser context |
void xmlXPathMultValues (xmlXPathParserContextPtr ctxt);
Implement the multiply operation on XPath objects: The numeric operators convert their operands to numbers as if by calling the number function.
ctxt : | the XPath Parser context |
void xmlXPathDivValues (xmlXPathParserContextPtr ctxt);
Implement the div operation on XPath objects arg1 / arg2: The numeric operators convert their operands to numbers as if by calling the number function.
ctxt : | the XPath Parser context |
void xmlXPathModValues (xmlXPathParserContextPtr ctxt);
Implement the mod operation on XPath objects: arg1 / arg2 The numeric operators convert their operands to numbers as if by calling the number function.
ctxt : | the XPath Parser context |
int xmlXPathIsNodeType (const xmlChar *name);
Is the name given a NodeType one.
[38] NodeType ::= 'comment' | 'text' | 'processing-instruction' | 'node'
name : | a name string |
Returns : | 1 if true 0 otherwise |
xmlNodePtr xmlXPathNextSelf (xmlXPathParserContextPtr ctxt, xmlNodePtr cur);
Traversal function for the "self" direction The self axis contains just the context node itself
ctxt : | the XPath Parser context |
cur : | the current node in the traversal |
Returns : | the next element following that axis |
xmlNodePtr xmlXPathNextChild (xmlXPathParserContextPtr ctxt, xmlNodePtr cur);
Traversal function for the "child" direction The child axis contains the children of the context node in document order.
ctxt : | the XPath Parser context |
cur : | the current node in the traversal |
Returns : | the next element following that axis |
xmlNodePtr xmlXPathNextDescendant (xmlXPathParserContextPtr ctxt, xmlNodePtr cur);
Traversal function for the "descendant" direction the descendant axis contains the descendants of the context node in document order; a descendant is a child or a child of a child and so on.
ctxt : | the XPath Parser context |
cur : | the current node in the traversal |
Returns : | the next element following that axis |
xmlNodePtr xmlXPathNextDescendantOrSelf (xmlXPathParserContextPtr ctxt, xmlNodePtr cur);
Traversal function for the "descendant-or-self" direction the descendant-or-self axis contains the context node and the descendants of the context node in document order; thus the context node is the first node on the axis, and the first child of the context node is the second node on the axis
ctxt : | the XPath Parser context |
cur : | the current node in the traversal |
Returns : | the next element following that axis |
xmlNodePtr xmlXPathNextParent (xmlXPathParserContextPtr ctxt, xmlNodePtr cur);
Traversal function for the "parent" direction The parent axis contains the parent of the context node, if there is one.
ctxt : | the XPath Parser context |
cur : | the current node in the traversal |
Returns : | the next element following that axis |
xmlNodePtr xmlXPathNextAncestorOrSelf (xmlXPathParserContextPtr ctxt, xmlNodePtr cur);
Traversal function for the "ancestor-or-self" direction he ancestor-or-self axis contains the context node and ancestors of the context node in reverse document order; thus the context node is the first node on the axis, and the context node's parent the second; parent here is defined the same as with the parent axis.
ctxt : | the XPath Parser context |
cur : | the current node in the traversal |
Returns : | the next element following that axis |
xmlNodePtr xmlXPathNextFollowingSibling (xmlXPathParserContextPtr ctxt, xmlNodePtr cur);
Traversal function for the "following-sibling" direction The following-sibling axis contains the following siblings of the context node in document order.
ctxt : | the XPath Parser context |
cur : | the current node in the traversal |
Returns : | the next element following that axis |
xmlNodePtr xmlXPathNextFollowing (xmlXPathParserContextPtr ctxt, xmlNodePtr cur);
Traversal function for the "following" direction The following axis contains all nodes in the same document as the context node that are after the context node in document order, excluding any descendants and excluding attribute nodes and namespace nodes; the nodes are ordered in document order
ctxt : | the XPath Parser context |
cur : | the current node in the traversal |
Returns : | the next element following that axis |
xmlNodePtr xmlXPathNextNamespace (xmlXPathParserContextPtr ctxt, xmlNodePtr cur);
Traversal function for the "namespace" direction the namespace axis contains the namespace nodes of the context node; the order of nodes on this axis is implementation-defined; the axis will be empty unless the context node is an element
We keep the XML namespace node at the end of the list.
ctxt : | the XPath Parser context |
cur : | the current attribute in the traversal |
Returns : | the next element following that axis |
xmlNodePtr xmlXPathNextAttribute (xmlXPathParserContextPtr ctxt, xmlNodePtr cur);
Traversal function for the "attribute" direction TODO: support DTD inherited default attributes
ctxt : | the XPath Parser context |
cur : | the current attribute in the traversal |
Returns : | the next element following that axis |
xmlNodePtr xmlXPathNextPreceding (xmlXPathParserContextPtr ctxt, xmlNodePtr cur);
Traversal function for the "preceding" direction the preceding axis contains all nodes in the same document as the context node that are before the context node in document order, excluding any ancestors and excluding attribute nodes and namespace nodes; the nodes are ordered in reverse document order
ctxt : | the XPath Parser context |
cur : | the current node in the traversal |
Returns : | the next element following that axis |
xmlNodePtr xmlXPathNextAncestor (xmlXPathParserContextPtr ctxt, xmlNodePtr cur);
Traversal function for the "ancestor" direction the ancestor axis contains the ancestors of the context node; the ancestors of the context node consist of the parent of context node and the parent's parent and so on; the nodes are ordered in reverse document order; thus the parent is the first node on the axis, and the parent's parent is the second node on the axis
ctxt : | the XPath Parser context |
cur : | the current node in the traversal |
Returns : | the next element following that axis |
xmlNodePtr xmlXPathNextPrecedingSibling (xmlXPathParserContextPtr ctxt, xmlNodePtr cur);
Traversal function for the "preceding-sibling" direction The preceding-sibling axis contains the preceding siblings of the context node in reverse document order; the first preceding sibling is first on the axis; the sibling preceding that node is the second on the axis and so on.
ctxt : | the XPath Parser context |
cur : | the current node in the traversal |
Returns : | the next element following that axis |
void xmlXPathLastFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathPositionFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathCountFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathIdFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathLocalNameFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the local-
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathNamespaceURIFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the namespace-
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathStringFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the
If the argument is omitted, it defaults to a node-set with the context node as its only member.
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathStringLengthFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the string-
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathConcatFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathContainsFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathStartsWithFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the starts-
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathSubstringFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathSubstringBeforeFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the substring-
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathSubstringAfterFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the substring-
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathNormalizeFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the normalize-
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathTranslateFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathNotFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathTrueFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathFalseFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathLangFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathNumberFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathSumFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathFloorFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathCeilingFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathRoundFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathBooleanFunction (xmlXPathParserContextPtr ctxt, int nargs);
Implement the
ctxt : | the XPath Parser context |
nargs : | the number of arguments |
void xmlXPathNodeSetFreeNs (xmlNsPtr ns);
Namespace node in libxml don't match the XPath semantic. In a node set the namespace nodes are duplicated and the next pointer is set to the parent node in the XPath semantic. Check if such a node need to be freed
ns : | the XPath namespace node found in a nodeset. |
<< relaxng | xmlversion >> |