+Sun Aug 7 16:04:47 CEST 2005 Daniel Veillard <daniel@veillard.com>
+
+ * libxslt/xsltutils.c: fixed a bug when size of xmlXPathContext
+ changes, uses the libxml2 alloc and dealloc functions instead.
+
Tue Jul 13 22:41:03 PDT 2005 William Brack <wbrack@mmm.com.hk>
* libxslt/transform.c: added check in xsltCopyText to assure
*/
xmlXPathCompExprPtr
xsltXPathCompile(xsltStylesheetPtr style, const xmlChar *str) {
- xmlXPathContext xctxt;
+ xmlXPathContextPtr xctxt;
xmlXPathCompExprPtr ret;
- memset(&xctxt, 0, sizeof(xctxt));
if (style != NULL)
- xctxt.dict = style->dict;
- ret = xmlXPathCtxtCompile(&xctxt, str);
+ xctxt = xmlXPathNewContext(style->doc);
+ else
+ xctxt = xmlXPathNewContext(NULL);
+ memset(xctxt, 0, sizeof(xctxt));
+ if (style != NULL)
+ xctxt->dict = style->dict;
+ ret = xmlXPathCtxtCompile(xctxt, str);
+ xmlXPathFreeContext(xctxt);
/*
* TODO: there is a lot of optimizations which should be possible
* like variable slot precomputations, function precomputations, etc.