From: William M. Brack Date: Tue, 30 Nov 2004 03:00:32 +0000 (+0000) Subject: more on RVT's in XPath predicates, this time for bug 159726. Cleaned up X-Git-Tag: v1.1.28~353 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=de7a9a01f330257285017cfe478ab5de152dea88;p=platform%2Fupstream%2Flibxslt.git more on RVT's in XPath predicates, this time for bug 159726. Cleaned up * libxslt/pattern.c: more on RVT's in XPath predicates, this time for bug 159726. Cleaned up the logic a little, hopefully now covers all setting of XSLT_RUNTIME_EXTRA. * tests/general/bug-158.xsl: corrected a typo --- diff --git a/ChangeLog b/ChangeLog index 48024f1..3a07c6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Tue Nov 30 10:53:18 HKT 2004 William Brack + + * libxslt/pattern.c: more on RVT's in XPath predicates, this + time for bug 159726. Cleaned up the logic a little, hopefully + now covers all setting of XSLT_RUNTIME_EXTRA. + * tests/general/bug-158.xsl: corrected a typo + Thu Nov 25 22:24:03 HKT 2004 William Brack * libxslt/variables.c, libxslt/xsltInternals.h: backed out the diff --git a/libxslt/pattern.c b/libxslt/pattern.c index 7760518..f50cf46 100644 --- a/libxslt/pattern.c +++ b/libxslt/pattern.c @@ -607,8 +607,20 @@ xsltTestCompMatch(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp, break; case XSLT_OP_PREDICATE: { xmlNodePtr oldNode; + xmlDocPtr doc; int oldCS, oldCP; int pos = 0, len = 0; + int isRVT; + + doc = node->doc; + if ((doc != NULL) && + (doc->name != NULL) && + (doc->name[0] == ' ') && + (xmlStrEqual(BAD_CAST doc->name, + BAD_CAST " fake node libxslt"))) + isRVT = 1; + else + isRVT = 0; /* * The simple existing predicate code cannot handle * properly cascaded predicates. If in this situation @@ -616,7 +628,7 @@ xsltTestCompMatch(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp, * if the node is in the result list. */ if (comp->steps[i + 1].op == XSLT_OP_PREDICATE) { - xmlDocPtr prevdoc, doc; + xmlDocPtr prevdoc; xmlXPathObjectPtr list; int ix, j; int nocache = 0; @@ -628,7 +640,6 @@ xsltTestCompMatch(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp, list = (xmlXPathObjectPtr) XSLT_RUNTIME_EXTRA_LST(ctxt, sel->lenExtra); - doc = node->doc; if ((list == NULL) || (prevdoc != doc)) { xmlChar *query; xmlXPathObjectPtr newlist; @@ -658,15 +669,8 @@ xsltTestCompMatch(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp, } ix = 0; - if ((parent == NULL) || (node->doc == NULL)) + if ((parent == NULL) || (node->doc == NULL) || isRVT) nocache = 1; - else { - if ((doc->name != NULL) && - (doc->name[0] == ' ') && - (xmlStrEqual(BAD_CAST doc->name, - BAD_CAST " fake node libxslt"))) - nocache = 1; - } if (nocache == 0) { if (list != NULL) @@ -774,8 +778,7 @@ xsltTestCompMatch(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp, if (node->doc != NULL) { len = (int) XSLT_RUNTIME_EXTRA(ctxt, sel->lenExtra); - if ((node->doc->name != NULL) && - (node->doc->name[0] != ' ')) { + if (!isRVT) { XSLT_RUNTIME_EXTRA(ctxt, sel->previousExtra) = node; XSLT_RUNTIME_EXTRA(ctxt, sel->indexExtra) = @@ -828,7 +831,8 @@ xsltTestCompMatch(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp, * If the node is in a Value Tree we cannot * cache it ! */ - if ((node->doc != NULL) && (nocache == 0)) { + if ((!isRVT) && (node->doc != NULL) && + (nocache == 0)) { XSLT_RUNTIME_EXTRA(ctxt, sel->previousExtra) = node; XSLT_RUNTIME_EXTRA(ctxt, sel->indexExtra) = @@ -879,9 +883,7 @@ xsltTestCompMatch(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp, * If the node is in a Value Tree we cannot * cache it ! */ - if ((node->doc != NULL) && - (node->doc->name != NULL) && - (node->doc->name[0] != ' ')) { + if ((node->doc != NULL) && !isRVT) { len = (int) XSLT_RUNTIME_EXTRA(ctxt, sel->lenExtra); XSLT_RUNTIME_EXTRA(ctxt, @@ -925,7 +927,7 @@ xsltTestCompMatch(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp, * If the node is in a Value Tree we cannot * cache it ! */ - if ((node->doc != NULL) && (nocache == 0)) { + if ((node->doc != NULL) && (nocache == 0) && !isRVT) { XSLT_RUNTIME_EXTRA(ctxt, sel->previousExtra) = node; XSLT_RUNTIME_EXTRA(ctxt, sel->indexExtra) = diff --git a/libxslt/xsltwin32config.h b/libxslt/xsltwin32config.h index b542c1b..f2dc77a 100644 --- a/libxslt/xsltwin32config.h +++ b/libxslt/xsltwin32config.h @@ -44,7 +44,7 @@ extern "C" { * * extra version information, used to show a CVS compilation */ -#define LIBXML_VERSION_EXTRA "-CVS967" +#define LIBXML_VERSION_EXTRA "-CVS970" /** * WITH_XSLT_DEBUG: diff --git a/tests/general/bug-158.xsl b/tests/general/bug-158.xsl index 0e77175..3b955dc 100644 --- a/tests/general/bug-158.xsl +++ b/tests/general/bug-158.xsl @@ -7,7 +7,7 @@ xmlns="http://www.w3.org/1999/xhtml"> - +