+Tue Nov 30 10:53:18 HKT 2004 William Brack <wbrack@mmm.com.hk>
+
+ * 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 <wbrack@mmm.com.hk>
* libxslt/variables.c, libxslt/xsltInternals.h: backed out the
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
* 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;
list = (xmlXPathObjectPtr)
XSLT_RUNTIME_EXTRA_LST(ctxt, sel->lenExtra);
- doc = node->doc;
if ((list == NULL) || (prevdoc != doc)) {
xmlChar *query;
xmlXPathObjectPtr newlist;
}
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)
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) =
* 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) =
* 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,
* 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) =