More cleanups, XSLT induced, start looking okay:
- xpath.[ch]: still a lot of cleanup based on XSLT, added
xmlXPathConvert{String,Number,Boolean} to be able to make
type casts without a context stack, fixed some implementation
problems related to the absence of context at parse-time,
added xmlXPathEvalPredicate() and xmlXPathFreeCompExpr()
in the public API too
- xpointer.c xpathInternals.h: we need to know at parse time
whether we are compiling an XPointer
Daniel
diff --git a/xpath.h b/xpath.h
index d16dd51..c9b846c 100644
--- a/xpath.h
+++ b/xpath.h
@@ -244,7 +244,7 @@
xmlXPathObjectPtr *valueTab; /* stack of values */
xmlXPathCompExprPtr comp; /* the precompiled expression */
-
+ int xptr; /* it this an XPointer expression */
};
/*
@@ -271,6 +271,12 @@
xmlXPathObjectPtr xmlXPathObjectCopy (xmlXPathObjectPtr val);
int xmlXPathCmpNodes (xmlNodePtr node1,
xmlNodePtr node2);
+/**
+ * Conversion functions to basic types
+ */
+xmlXPathObjectPtr xmlXPathConvertBoolean (xmlXPathObjectPtr val);
+xmlXPathObjectPtr xmlXPathConvertNumber (xmlXPathObjectPtr val);
+xmlXPathObjectPtr xmlXPathConvertString (xmlXPathObjectPtr val);
/**
* Context handling
@@ -288,13 +294,15 @@
xmlXPathContextPtr ctxt);
xmlXPathObjectPtr xmlXPathEvalExpression (const xmlChar *str,
xmlXPathContextPtr ctxt);
+int xmlXPathEvalPredicate (xmlXPathContextPtr ctxt,
+ xmlXPathObjectPtr res);
/**
* Separate compilation/evaluation entry points
*/
xmlXPathCompExprPtr xmlXPathCompile (const xmlChar *str);
xmlXPathObjectPtr xmlXPathCompiledEval (xmlXPathCompExprPtr comp,
xmlXPathContextPtr ctx);
-
+void xmlXPathFreeCompExpr (xmlXPathCompExprPtr comp);
#ifdef __cplusplus
}
#endif