fixes bug #97969 for @*[...] patterns added the example in the regression
authorDaniel Veillard <veillard@src.gnome.org>
Wed, 13 Nov 2002 09:38:48 +0000 (09:38 +0000)
committerDaniel Veillard <veillard@src.gnome.org>
Wed, 13 Nov 2002 09:38:48 +0000 (09:38 +0000)
* libxslt/pattern.c: fixes bug #97969 for @*[...] patterns
* tests/docs/Makefile.am tests/docs/bug-97.xml
  tests/general/Makefile.am tests/general/bug-97.*: added the
  example in the regression tests for this case
Daniel

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

index d6cfe19..81c3156 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Wed Nov 13 10:35:46 CET 2002 Daniel Veillard <daniel@veillard.com>
+
+       * libxslt/pattern.c: fixes bug #97969 for @*[...] patterns
+       * tests/docs/Makefile.am tests/docs/bug-97.xml
+         tests/general/Makefile.am tests/general/bug-97.*: added the
+         example in the regression tests for this case
+       
 Tue Nov 12 22:35:47 CET 2002 Daniel Veillard <daniel@veillard.com>
 
        * libxslt/transform.c: fixes bug #97950 for cdata-section-elements
index ae0b07a..1746bc1 100644 (file)
@@ -1342,7 +1342,7 @@ xsltCompileStepPattern(xsltParserContextPtr ctxt, xmlChar *token) {
        if (CUR == '*') {
            NEXT;
            PUSH(XSLT_OP_ATTR, NULL, NULL);
-           return;
+           goto parse_predicate;
        }
        token = xsltScanQName(ctxt, &prefix);
        if (prefix != NULL) {
index 1b4b2a6..587f9db 100644 (file)
@@ -96,6 +96,7 @@ EXTRA_DIST =  \
        bug-94.xml \
        bug-95.xml \
        bug-96.xml \
+       bug-97.xml \
        character.xml \
        array.xml \
        items.xml
diff --git a/tests/docs/bug-97.xml b/tests/docs/bug-97.xml
new file mode 100644 (file)
index 0000000..bba9c3b
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<car:cars xmlns:car="http://www.example.com/xmlns/car"
+          xmlns:m="http://www.example.com/xmlns/manufacturer">
+  <car:models>
+    <car:model car:name="Rabbit" m:id="VW" car:year="1984" />
+    <car:model car:name="Tundra" m:id="TY" car:year="2000" />
+    <car:model car:name="Mini" m:id="BM" car:year="2003" />
+  </car:models>
+  <m:manufacturers>
+    <m:manufacturer m:id="VW" m:name="Volkswagen" m:country="Germany" />
+    <m:manufacturer m:id="TY" m:name="Toyota" m:country="Japan" />
+    <m:manufacturer m:id="BM" m:name="Bavarian Motor Works" 
+m:country="Germany"/>
+  </m:manufacturers>
+</car:cars>
+
index 726ded6..ce769a4 100644 (file)
@@ -100,6 +100,7 @@ EXTRA_DIST = \
     bug-94.out bug-94.xsl \
     bug-95.out bug-95.xsl \
     bug-96.out bug-96.xsl \
+    bug-97.out bug-97.xsl \
     character.out character.xsl \
     character2.out character2.xsl \
     itemschoose.out itemschoose.xsl \
diff --git a/tests/general/bug-97.out b/tests/general/bug-97.out
new file mode 100644 (file)
index 0000000..1523e3d
--- /dev/null
@@ -0,0 +1,9 @@
+My Car Models:
+Rabbit
+Tundra
+Mini
+
+The Manufacturers:
+Volkswagen
+Toyota
+Bavarian Motor Works
diff --git a/tests/general/bug-97.xsl b/tests/general/bug-97.xsl
new file mode 100644 (file)
index 0000000..b54e7cf
--- /dev/null
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:car="http://www.example.com/xmlns/car"
+  xmlns:manu="http://www.example.com/xmlns/manufacturer">
+
+  <xsl:output method="text" encoding="UTF-8" />
+  <xsl:strip-space elements="*" />
+
+  <xsl:template match="/">
+    <xsl:apply-templates />
+  </xsl:template>
+
+  <xsl:template match="car:models">
+    <xsl:text>My Car Models:&#xA;</xsl:text>
+    <xsl:apply-templates select="car:model/@car:name"></xsl:apply-templates>
+    <xsl:text>&#xA;</xsl:text>
+  </xsl:template>
+
+  <xsl:template match="manu:manufacturers">
+    <xsl:text>The Manufacturers:&#xA;</xsl:text>
+    <xsl:apply-templates select="manu:manufacturer/@manu:name"></xsl:apply-templates>
+  </xsl:template>
+
+  <xsl:template match="@*[local-name()='name']">
+    <xsl:value-of select="." />
+    <xsl:text>&#xA;</xsl:text>
+  </xsl:template>
+
+</xsl:stylesheet>
+
+