another problem reported by Oleg Paraschenko on the same code in #127450
authorDaniel Veillard <veillard@src.gnome.org>
Thu, 20 Nov 2003 16:28:36 +0000 (16:28 +0000)
committerDaniel Veillard <veillard@src.gnome.org>
Thu, 20 Nov 2003 16:28:36 +0000 (16:28 +0000)
* libxslt/keys.c: another problem reported by Oleg Paraschenko
  on the same code in #127450
* tests/docs/Makefile.am tests/docs/bug-135.xml
  tests/general/Makefile.am tests/docs/bug-135*: added tests
  to the regression suite for bug #127450.
Daniel

ChangeLog
libxslt/keys.c
tests/docs/Makefile.am
tests/docs/bug-135.xml [new file with mode: 0644]
tests/general/Makefile.am
tests/general/bug-135.out [new file with mode: 0644]
tests/general/bug-135.xsl [new file with mode: 0644]

index 8db6d45..f8ef75e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Thu Nov 20 17:26:57 CET 2003 Daniel Veillard <daniel@veillard.com>
+
+       * libxslt/keys.c: another problem reported by Oleg Paraschenko
+         on the same code in #127450
+       * tests/docs/Makefile.am tests/docs/bug-135.xml
+         tests/general/Makefile.am tests/docs/bug-135*: added tests
+         to the regression suite for bug #127450.
+
 Thu Nov 20 10:59:48 CET 2003 Daniel Veillard <daniel@veillard.com>
 
        * libxslt/keys.c: fixed an error from #120684 patch raised in
index 953163c..27452a3 100644 (file)
@@ -260,8 +260,11 @@ skipPredicate(const xmlChar *cur, int end) {
            end = skipString(cur, end);
            if (end <= 0)
                return(-1);
-       }
-        if (cur[end] == ']')
+       } else if (cur[end] == '[') {
+           end = skipPredicate(cur, end);
+           if (end <= 0)
+               return(-1);
+       } else if (cur[end] == ']')
            return(end + 1);
        end++;
     }
index 56ee1e0..d48a31c 100644 (file)
@@ -134,6 +134,7 @@ EXTRA_DIST =        \
        bug-132.xml \
        bug-133.xml \
        bug-134.xml \
+       bug-135.xml \
        character.xml \
        array.xml \
        items.xml
diff --git a/tests/docs/bug-135.xml b/tests/docs/bug-135.xml
new file mode 100644 (file)
index 0000000..9d5f51f
--- /dev/null
@@ -0,0 +1,5 @@
+<root>
+  <sect><h1 /></sect>
+  <sect><h2 /></sect>
+  <sect><h3 /></sect>
+</root>
index 9176ab5..09ac805 100644 (file)
@@ -140,6 +140,7 @@ EXTRA_DIST = \
     bug-132.out bug-132.xsl \
     bug-133.out bug-133.xsl \
     bug-134.out bug-134.xsl \
+    bug-135.out bug-135.xsl \
     character.out character.xsl \
     character2.out character2.xsl \
     itemschoose.out itemschoose.xsl \
diff --git a/tests/general/bug-135.out b/tests/general/bug-135.out
new file mode 100644 (file)
index 0000000..64664bc
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<result>1</result>
diff --git a/tests/general/bug-135.xsl b/tests/general/bug-135.xsl
new file mode 100644 (file)
index 0000000..29f1aec
--- /dev/null
@@ -0,0 +1,10 @@
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+       
+<xsl:key name="test" match="node()[self::sect][h1[h2]|h2]" use="'test'" />
+
+<xsl:template match="/">
+  <result><xsl:value-of select="count(key('test','test'))" /></result>
+</xsl:template>
+
+</xsl:stylesheet>