diff options
| author | Daniel Veillard <veillard@src.gnome.org> | 2001-03-18 23:17:47 +0000 |
|---|---|---|
| committer | Daniel Veillard <veillard@src.gnome.org> | 2001-03-18 23:17:47 +0000 |
| commit | 9e7160d45a18bfa26d708e22ba991f7670d0128b (patch) | |
| tree | 23f691288864b21d12a4968ff5e6368cffe880db /xpointer.c | |
| parent | 480363bdf57ea65106e6c4be4131656108c84121 (diff) | |
| download | android_external_libxml2-9e7160d45a18bfa26d708e22ba991f7670d0128b.tar.gz android_external_libxml2-9e7160d45a18bfa26d708e22ba991f7670d0128b.tar.bz2 android_external_libxml2-9e7160d45a18bfa26d708e22ba991f7670d0128b.zip | |
Completely changed the way the XPath evaluation is done, likely to break
stuff like libxslt right now:
- Makefile.am: detect XPath memleaks in regreson tests
- error.c: fixed and error w.r.t. error reporting still using
stderr
- hash.c: added new line at end of file
- tree.h: minor cleanup
- xpath.[ch] xpointer.[ch]: Major changes ! Separated XPath
expression parsing from evaluation, resulted in a number of
changes internally, and in XPointer. Likely to break stuff
using xpathInternals.h but should remain binary compatible,
new interfaces will be added.
Daniel
Diffstat (limited to 'xpointer.c')
| -rw-r--r-- | xpointer.c | 22 |
1 files changed, 15 insertions, 7 deletions
@@ -981,8 +981,8 @@ xmlXPtrEvalXPtrPart(xmlXPathParserContextPtr ctxt, xmlChar *name) { const xmlChar *left = CUR_PTR; CUR_PTR = buffer; - xmlXPathRoot(ctxt); xmlXPathEvalExpr(ctxt); + xmlXPathRunEval(ctxt); CUR_PTR=left; #ifdef XPTR_XMLNS_SCHEME } else if (xmlStrEqual(name, (xmlChar *) "xmlns")) { @@ -1174,6 +1174,20 @@ xmlXPtrEvalChildSeq(xmlXPathParserContextPtr ctxt, xmlChar *name) { */ void xmlXPtrEvalXPointer(xmlXPathParserContextPtr ctxt) { + if (ctxt->valueTab == NULL) { + /* Allocate the value stack */ + ctxt->valueTab = (xmlXPathObjectPtr *) + xmlMalloc(10 * sizeof(xmlXPathObjectPtr)); + if (ctxt->valueTab == NULL) { + xmlFree(ctxt); + xmlGenericError(xmlGenericErrorContext, + "xmlXPathRunEval: out of memory\n"); + return; + } + ctxt->valueNr = 0; + ctxt->valueMax = 10; + ctxt->value = NULL; + } SKIP_BLANKS; if (CUR == '/') { xmlXPathRoot(ctxt); @@ -1279,12 +1293,6 @@ xmlXPtrEval(const xmlChar *str, xmlXPathContextPtr ctx) { return(NULL); ctxt = xmlXPathNewParserContext(str, ctx); - /* TAG:9999 - if (ctx->node != NULL) { - init = xmlXPathNewNodeSet(ctx->node); - valuePush(ctxt, init); - } - */ xmlXPtrEvalXPointer(ctxt); if ((ctxt->value != NULL) && |
