SXP Reference

SXP_query Functions

Syntax

     SXP_query(Q, query, node, position, size)
NameTypeDescription
QQueryContextThe current query context.
queryconst SXP_char*The text of the query.
nodeSXP_NodeThe current node for the query.
positionintThe position of the current node in the evaluation context. As SXP is a C interface, the position is zero-based (unlike one-based XPath nodesets). Thus, you must set this parameter to 0 if you want the "position()" query to return 1.
sizeintThe size of the evaluation context.
(RET)intThe error code.

Description

Evaluates a query (given as text) based on the current node, the context position (zero-based) and the context size. Any namespaces declared using SXP_addNamespaceDeclaration are used for the evaluation, as are the variable bindings made using functions like SXP_addVariableString. Upon completion of the query, the pending namespace declarations and variable bindings are cleared.

Example

  SXP_query(Q, "node[1]/@att", root, 0, 1);

See Also

Groups [ Functions ]
Entries [ QueryContext | SXP_Node | SXP_addNamespaceDeclaration | SXP_addVariableString | SXP_getResultString | SXP_getResultType ]

© 2001-2003 Ginger Alliance
revision 03-01-31
This page was generated by APIDOC