xpathInternals

xpathInternals —

Synopsis




#define     xmlXPathSetError                (ctxt, err)
#define     xmlXPathSetArityError           (ctxt)
#define     xmlXPathSetTypeError            (ctxt)
#define     xmlXPathGetError                (ctxt)
#define     xmlXPathCheckError              (ctxt)
#define     xmlXPathGetDocument             (ctxt)
#define     xmlXPathGetContextNode          (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);
xmlXPathFunction (*xmlXPathFuncLookupFunc)  (void *ctxt,
                                             const xmlChar *name,
                                             const xmlChar *ns_uri);

Description

Details

xmlXPathSetError()

#define     xmlXPathSetError(ctxt, err)

Raises an error.

ctxt: an XPath parser context
err: an xmlXPathError code

xmlXPathSetArityError()

#define     xmlXPathSetArityError(ctxt)

Raises an XPATH_INVALID_ARITY error.

ctxt: an XPath parser context

xmlXPathSetTypeError()

#define     xmlXPathSetTypeError(ctxt)

Raises an XPATH_INVALID_TYPE error.

ctxt: an XPath parser context

xmlXPathGetError()

#define xmlXPathGetError(ctxt)	  ((ctxt)->error)

Get the error code of an XPath context.

ctxt: an XPath parser context

xmlXPathCheckError()

#define xmlXPathCheckError(ctxt)  ((ctxt)->error != XPATH_EXPRESSION_OK)

Check if an XPath error was raised.

ctxt: an XPath parser context

xmlXPathGetDocument()

#define xmlXPathGetDocument(ctxt)	((ctxt)->context->doc)

Get the document of an XPath context.

ctxt: an XPath parser context

xmlXPathGetContextNode()

#define xmlXPathGetContextNode(ctxt)	((ctxt)->context->node)

Get the context node of an XPath context.

ctxt: an XPath parser context

xmlXPathReturnBoolean()

#define     xmlXPathReturnBoolean(ctxt, val)

Pushes the boolean val on the context stack.

ctxt: an XPath parser context
val: a boolean

xmlXPathReturnTrue()

#define xmlXPathReturnTrue(ctxt)   xmlXPathReturnBoolean((ctxt), 1)

Pushes true on the context stack.

ctxt: an XPath parser context

xmlXPathReturnFalse()

#define xmlXPathReturnFalse(ctxt)  xmlXPathReturnBoolean((ctxt), 0)

Pushes false on the context stack.

ctxt: an XPath parser context

xmlXPathReturnNumber()

#define     xmlXPathReturnNumber(ctxt, val)

Pushes the double val on the context stack.

ctxt: an XPath parser context
val: a double

xmlXPathReturnString()

#define     xmlXPathReturnString(ctxt, str)

Pushes the string str on the context stack.

ctxt: an XPath parser context
str: a string

xmlXPathReturnEmptyString()

#define     xmlXPathReturnEmptyString(ctxt)

Pushes an empty string on the stack.

ctxt: an XPath parser context

xmlXPathReturnNodeSet()

#define     xmlXPathReturnNodeSet(ctxt, ns)

Pushes the node-set ns on the context stack.

ctxt: an XPath parser context
ns: a node-set

xmlXPathReturnEmptyNodeSet()

#define     xmlXPathReturnEmptyNodeSet(ctxt)

Pushes an empty node-set on the context stack.

ctxt: an XPath parser context

xmlXPathReturnExternal()

#define     xmlXPathReturnExternal(ctxt, val)

Pushes user data on the context stack.

ctxt: an XPath parser context
val: user data

xmlXPathStackIsNodeSet()

#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

xmlXPathStackIsExternal()

#define     xmlXPathStackIsExternal(ctxt)

Checks if the current value on the XPath stack is an external object.

ctxt: an XPath parser context

xmlXPathEmptyNodeSet()

#define     xmlXPathEmptyNodeSet(ns)

Empties a node-set.

ns: a node-set

CHECK_ERROR

#define     CHECK_ERROR

Macro to return from the function if an XPath error was detected.


CHECK_ERROR0

#define     CHECK_ERROR0

Macro to return 0 from the function if an XPath error was detected.


XP_ERROR()

#define     XP_ERROR(X)

Macro to raise an XPath error and return.

X: the error code

XP_ERROR0()

#define     XP_ERROR0(X)

Macro to raise an XPath error and return 0.

X: the error code

CHECK_TYPE()

#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

CHECK_TYPE0()

#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

CHECK_ARITY()

#define     CHECK_ARITY(x)

Macro to check that the number of args passed to an XPath function matches.

x: the number of expected args

CAST_TO_STRING

#define     CAST_TO_STRING

Macro to try to cast the value on the top of the XPath stack to a string.


CAST_TO_NUMBER

#define     CAST_TO_NUMBER

Macro to try to cast the value on the top of the XPath stack to a number.


CAST_TO_BOOLEAN

#define     CAST_TO_BOOLEAN

Macro to try to cast the value on the top of the XPath stack to a boolean.


xmlXPathVariableLookupFunc ()

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.

xmlXPathFuncLookupFunc ()

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.