--- embedaddon/libxml2/doc/devhelp/libxml2-xpath.html 2013/07/22 01:22:25 1.1.1.2 +++ embedaddon/libxml2/doc/devhelp/libxml2-xpath.html 2014/06/15 19:53:35 1.1.1.3 @@ -70,6 +70,7 @@ typedef xmlX typedef struct _xmlXPathParserContext xmlXPathParserContext; int xmlXPathCastNodeSetToBoolean (xmlNodeSetPtr ns); typedef xmlXPathFunction xmlXPathFuncLookupFunc (void * ctxt,
const xmlChar * name,
const xmlChar * ns_uri); +xmlXPathObjectPtr xmlXPathNodeEval (xmlNodePtr node,
const xmlChar * str,
xmlXPathContextPtr ctx); xmlChar * xmlXPathCastNodeToString (xmlNodePtr node); int xmlXPathIsNaN (double val); int xmlXPathContextSetCache (xmlXPathContextPtr ctxt,
int active,
int value,
int options); @@ -104,6 +105,7 @@ int xmlXPathCmpNodes xmlXPathCompExprPtr xmlXPathCtxtCompile (xmlXPathContextPtr ctxt,
const xmlChar * str); typedef void xmlXPathEvalFunc (xmlXPathParserContextPtr ctxt,
int nargs); xmlChar * xmlXPathCastBooleanToString (int val); +int xmlXPathSetContextNode (xmlNodePtr node,
xmlXPathContextPtr ctx); int xmlXPathCastNumberToBoolean (double val); void xmlXPathFreeNodeSet (xmlNodeSetPtr obj); void xmlXPathFreeCompExpr (xmlXPathCompExprPtr comp); @@ -246,6 +248,7 @@ The content of this structure is not made public by th XPATH_INVALID_CHAR_ERROR = 21 XPATH_INVALID_CTXT = 22 XPATH_STACK_ERROR = 23 + XPATH_FORBID_VARIABLE_ERROR = 24 };

@@ -513,6 +516,10 @@ The content of this structure is not made public by th

Create a new xmlXPathContext

doc:the XML document
Returns:the xmlXPathContext just allocated. The caller will need to free it.

+

xmlXPathNodeEval ()

xmlXPathObjectPtr	xmlXPathNodeEval	(xmlNodePtr node, 
const xmlChar * str,
xmlXPathContextPtr ctx)
+

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

+
node:the node to to use as the context node
str:the XPath expression
ctx:the XPath context
Returns:the xmlXPathObjectPtr resulting from the evaluation or NULL. the caller has to free the object.
+

xmlXPathNodeSetCreate ()

xmlNodeSetPtr	xmlXPathNodeSetCreate	(xmlNodePtr val)

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

val:an initial xmlNodePtr, or NULL
Returns:the newly created object.
@@ -524,6 +531,10 @@ The content of this structure is not made public by th

xmlXPathOrderDocElems ()

long	xmlXPathOrderDocElems		(xmlDocPtr doc)

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.

doc:an input document
Returns:the number of elements found in the document or -1 in case of error.
+
+

xmlXPathSetContextNode ()

int	xmlXPathSetContextNode		(xmlNodePtr node, 
xmlXPathContextPtr ctx)
+

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

+
node:the node to to use as the context node
ctx:the XPath context
Returns:-1 in case of error or 0 if successful