- libxslt/pattern.c: when precompiled pattern is ALL, predicate
authorDaniel Veillard <veillard@src.gnome.org>
Sun, 18 Feb 2001 16:15:03 +0000 (16:15 +0000)
committerDaniel Veillard <veillard@src.gnome.org>
Sun, 18 Feb 2001 16:15:03 +0000 (16:15 +0000)
  contextual info must be recomputed
Daniel

ChangeLog
libxslt/pattern.c

index 683e423..1cbd49e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Feb 18 17:13:00 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
+
+       * libxslt/pattern.c: when precompiled pattern is ALL, predicate
+         contextual info must be recomputed
+
 Sun Feb 18 16:39:17 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
 
        * libxslt/xslt.h libxslt/transform.c: defined and exported xsltMaxDepth
index 9e9a407..a6413b2 100644 (file)
@@ -512,6 +512,22 @@ xsltTestCompMatch(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp,
                        ctxt->xpathCtxt->contextSize = len;
                        ctxt->xpathCtxt->proximityPosition = pos;
                    }
+               } else if ((select != NULL) && (select->op == XSLT_OP_ALL)) {
+                   xmlNodePtr siblings = node->parent->children;
+
+                   while (siblings != NULL) {
+                       if (siblings->type == XML_ELEMENT_NODE) {
+                           len++;
+                           if (siblings == node) {
+                               pos = len;
+                           }
+                       }
+                       siblings = siblings->next;
+                   }
+                   if (pos != 0) {
+                       ctxt->xpathCtxt->contextSize = len;
+                       ctxt->xpathCtxt->proximityPosition = pos;
+                   }
                }
                oldNode = ctxt->node;
                ctxt->node = node;