Fixing bug #75902 error with @foo[..] steps which were not compiled added
authorDaniel Veillard <veillard@src.gnome.org>
Fri, 22 Mar 2002 18:28:25 +0000 (18:28 +0000)
committerDaniel Veillard <veillard@src.gnome.org>
Fri, 22 Mar 2002 18:28:25 +0000 (18:28 +0000)
* libxslt/pattern.c: Fixing bug #75902 error with @foo[..]
  steps which were not compiled
* tests/docs/Makefile.am tests/docs/bug-79.xml
  tests/general/Makefile.am tests/general/bug-79.*: added a
  specific example for bug #75902 in the regression tests
Daniel

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

index 65b6fdd..d9238d7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Fri Mar 22 19:26:47 CET 2002 Daniel Veillard <daniel@veillard.com>
+
+       * libxslt/pattern.c: Fixing bug #75902 error with @foo[..]
+         steps which were not compiled
+       * tests/docs/Makefile.am tests/docs/bug-79.xml
+         tests/general/Makefile.am tests/general/bug-79.*: added a 
+         specific example for bug #75902 in the regression tests
+       
 Fri Mar 22 16:13:22 CET 2002 Daniel Veillard <daniel@veillard.com>
 
        * libxslt/pattern.c: Fixing bug #75777 error with namespaced
index 4928581..47a86af 100644 (file)
@@ -1355,7 +1355,7 @@ xsltCompileStepPattern(xsltParserContextPtr ctxt, xmlChar *token) {
            goto error;
        }
        PUSH(XSLT_OP_ATTR, token, URL);
-       return;
+       goto parse_predicate;
     }
     if (token == NULL)
        token = xsltScanName(ctxt);
@@ -1745,8 +1745,14 @@ xsltCompilePattern(const xmlChar *pattern, xmlDocPtr doc,
                         element->pattern);
 #endif
        xsltCompileLocationPathPattern(ctxt);
-       if (ctxt->error)
+       if (ctxt->error) {
+           xsltPrintErrorContext(NULL, style, node);
+           xsltGenericError(xsltGenericErrorContext,
+                            "xsltCompilePattern : failed to compile '%s'\n",
+                            element->pattern);
+           style->errors++;
            goto error;
+       }
 
        /*
         * Reverse for faster interpretation.
@@ -1806,6 +1812,7 @@ xsltCompilePattern(const xmlChar *pattern, xmlDocPtr doc,
        xsltPrintErrorContext(NULL, NULL, node); /* TODO */
         xsltGenericError(xsltGenericErrorContext,
                         "xsltCompilePattern : NULL pattern\n");
+       style->errors++;
        goto error;
     }
 
index d7cfa7c..7585bf7 100644 (file)
@@ -79,6 +79,7 @@ EXTRA_DIST =  \
        bug-76.xml \
        bug-77.xml \
        bug-78.xml \
+       bug-79.xml \
        character.xml \
        array.xml \
        items.xml
diff --git a/tests/docs/bug-79.xml b/tests/docs/bug-79.xml
new file mode 100644 (file)
index 0000000..a94a515
--- /dev/null
@@ -0,0 +1,4 @@
+<doc>
+<item mode="enabled"/>
+<item mode="disabled"/>
+</doc>
index 2704a5c..23be6bc 100644 (file)
@@ -82,6 +82,7 @@ EXTRA_DIST = \
     bug-76.out bug-76.xsl \
     bug-77.out bug-77.xsl \
     bug-78.out bug-78.xsl \
+    bug-79.out bug-79.xsl \
     character.out character.xsl \
     character2.out character2.xsl \
     itemschoose.out itemschoose.xsl \
diff --git a/tests/general/bug-79.out b/tests/general/bug-79.out
new file mode 100644 (file)
index 0000000..0ef4698
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+
+SUCCESS
+
+
diff --git a/tests/general/bug-79.xsl b/tests/general/bug-79.xsl
new file mode 100644 (file)
index 0000000..afef7c5
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:template match="item/@mode[.='enabled']">SUCCESS</xsl:template>
+</xsl:stylesheet>