summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2001-04-29 16:59:23 +0000
committerDaniel Veillard <veillard@src.gnome.org>2001-04-29 16:59:23 +0000
commit4e399c177511047464bc32cfd1faf9a7b13e0823 (patch)
tree054ffa74517e64821acea58b33ab77cf20783fa3
parenteef9a85837a010e65565b207fbc51790a549b2b4 (diff)
downloadlibxslt-4e399c177511047464bc32cfd1faf9a7b13e0823.tar.gz
libxslt-4e399c177511047464bc32cfd1faf9a7b13e0823.tar.bz2
libxslt-4e399c177511047464bc32cfd1faf9a7b13e0823.zip
- libxslt/variables.c: fixing bug #53769
- tests/general tests/docs: added new examples from the bug reports to the regression tests, updated the Makefiles Daniel
-rw-r--r--ChangeLog6
-rw-r--r--libxslt/variables.c2
-rw-r--r--tests/docs/Makefile.am14
-rw-r--r--tests/docs/bug-15-.xml5
-rw-r--r--tests/docs/bug-16-.xml17
-rw-r--r--tests/docs/bug-17-.xml1
-rw-r--r--tests/general/Makefile.am14
-rw-r--r--tests/general/bug-15-.out2
-rw-r--r--tests/general/bug-15-.xsl15
-rw-r--r--tests/general/bug-16-.out14
-rw-r--r--tests/general/bug-16-.xsl13
-rw-r--r--tests/general/bug-17-.out2
-rw-r--r--tests/general/bug-17-.xsl7
13 files changed, 112 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index cf3b8bb1..293b1095 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sun Apr 29 18:54:03 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
+
+ * libxslt/variables.c: fixing bug #53769
+ * tests/general tests/docs: added new examples from the
+ bug reports to the regression tests, updated the Makefiles
+
Sun Apr 29 11:47:58 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* preproc.[ch] templates.[ch] variables.[ch] xslt.c xsltInternals.h
diff --git a/libxslt/variables.c b/libxslt/variables.c
index 3a5d7b28..c8723a6f 100644
--- a/libxslt/variables.c
+++ b/libxslt/variables.c
@@ -363,6 +363,8 @@ xsltEvalGlobalVariables(xsltTransformContextPtr ctxt) {
"Evaluating global variables\n");
#endif
ctxt->node = (xmlNodePtr) ctxt->document->doc;
+ ctxt->xpathCtxt->contextSize = 1;
+ ctxt->xpathCtxt->proximityPosition = 1;
style = ctxt->style;
while (style != NULL) {
elem = style->variables;
diff --git a/tests/docs/Makefile.am b/tests/docs/Makefile.am
index 02f2f8b8..6fa3ea1f 100644
--- a/tests/docs/Makefile.am
+++ b/tests/docs/Makefile.am
@@ -8,6 +8,20 @@ EXTRA_DIST = \
bug-1-.xml \
bug-2-.xml \
bug-3-.xml \
+ bug-4-.xml \
+ bug-5-.xml \
+ bug-6-.xml \
+ bug-7-.xml \
+ bug-8-.xml \
+ bug-9-.xml \
+ bug-10-.xml \
+ bug-11-.xml \
+ bug-12-.xml \
+ bug-13-.xml \
+ bug-14-.xml \
+ bug-15-.xml \
+ bug-16-.xml \
+ bug-17-.xml \
character.xml \
items.xml
diff --git a/tests/docs/bug-15-.xml b/tests/docs/bug-15-.xml
new file mode 100644
index 00000000..1ab284b0
--- /dev/null
+++ b/tests/docs/bug-15-.xml
@@ -0,0 +1,5 @@
+<doc>
+ <items>b</items>
+ <items>a</items>
+ <items>c</items>
+</doc>
diff --git a/tests/docs/bug-16-.xml b/tests/docs/bug-16-.xml
new file mode 100644
index 00000000..92e4247f
--- /dev/null
+++ b/tests/docs/bug-16-.xml
@@ -0,0 +1,17 @@
+<AAA>
+ <AAA>
+ <AAA/>
+ <AAA/>
+ <AAA/>
+ </AAA>
+ <AAA>
+ <AAA/>
+ <AAA/>
+ <AAA/>
+ </AAA>
+ <AAA>
+ <AAA/>
+ <AAA/>
+ <AAA/>
+ </AAA>
+</AAA>
diff --git a/tests/docs/bug-17-.xml b/tests/docs/bug-17-.xml
new file mode 100644
index 00000000..69d62f2c
--- /dev/null
+++ b/tests/docs/bug-17-.xml
@@ -0,0 +1 @@
+<doc/>
diff --git a/tests/general/Makefile.am b/tests/general/Makefile.am
index 50afae46..47bc11a9 100644
--- a/tests/general/Makefile.am
+++ b/tests/general/Makefile.am
@@ -7,6 +7,20 @@ EXTRA_DIST = \
bug-1-.out bug-1-.xsl \
bug-2-.out bug-2-.xsl \
bug-3-.out bug-3-.xsl \
+ bug-4-.out bug-4-.xsl \
+ bug-5-.out bug-5-.xsl \
+ bug-6-.out bug-6-.xsl \
+ bug-7-.out bug-7-.xsl \
+ bug-8-.out bug-8-.xsl \
+ bug-9-.out bug-9-.xsl \
+ bug-10-.out bug-10-.xsl \
+ bug-11-.out bug-11-.xsl \
+ bug-12-.out bug-12-.xsl \
+ bug-13-.out bug-13-.xsl \
+ bug-14-.out bug-14-.xsl \
+ bug-15-.out bug-15-.xsl \
+ bug-16-.out bug-16-.xsl \
+ bug-17-.out bug-17-.xsl \
character.out character.xsl \
character2.out character2.xsl \
itemschoose.out itemschoose.xsl
diff --git a/tests/general/bug-15-.out b/tests/general/bug-15-.out
new file mode 100644
index 00000000..c79a8311
--- /dev/null
+++ b/tests/general/bug-15-.out
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<html><body><ul><li>a</li><li>b</li><li>c</li></ul></body></html>
diff --git a/tests/general/bug-15-.xsl b/tests/general/bug-15-.xsl
new file mode 100644
index 00000000..845866e8
--- /dev/null
+++ b/tests/general/bug-15-.xsl
@@ -0,0 +1,15 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:template match='doc'>
+<html>
+<body>
+<ul>
+ <xsl:for-each select='items'>
+ <xsl:sort/>
+ <li><xsl:value-of select='.'/></li>
+ </xsl:for-each>
+</ul>
+</body>
+</html>
+</xsl:template>
+</xsl:stylesheet>
diff --git a/tests/general/bug-16-.out b/tests/general/bug-16-.out
new file mode 100644
index 00000000..792ee000
--- /dev/null
+++ b/tests/general/bug-16-.out
@@ -0,0 +1,14 @@
+1 AAA
+ 1.1 AAA
+ 1.1.1 AAA
+ 1.1.2 AAA
+ 1.1.3 AAA
+ 1.2 AAA
+ 1.2.1 AAA
+ 1.2.2 AAA
+ 1.2.3 AAA
+ 1.3 AAA
+ 1.3.1 AAA
+ 1.3.2 AAA
+ 1.3.3 AAA
+ \ No newline at end of file
diff --git a/tests/general/bug-16-.xsl b/tests/general/bug-16-.xsl
new file mode 100644
index 00000000..3b662651
--- /dev/null
+++ b/tests/general/bug-16-.xsl
@@ -0,0 +1,13 @@
+<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"
+ version="1.0">
+<xsl:output method = "text" />
+<xsl:template match = "/" >
+ <xsl:apply-templates select = "//AAA" />
+</xsl:template>
+
+<xsl:template match = "*" >
+ <xsl:number level = "multiple"/>
+ <xsl:text > AAA
+ </xsl:text>
+</xsl:template>
+</xsl:stylesheet>
diff --git a/tests/general/bug-17-.out b/tests/general/bug-17-.out
new file mode 100644
index 00000000..ae1fbf32
--- /dev/null
+++ b/tests/general/bug-17-.out
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<pos>1</pos>
diff --git a/tests/general/bug-17-.xsl b/tests/general/bug-17-.xsl
new file mode 100644
index 00000000..0c8a55aa
--- /dev/null
+++ b/tests/general/bug-17-.xsl
@@ -0,0 +1,7 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0">
+ <xsl:variable name="pos" select="position()"/>
+ <xsl:template match="/">
+ <pos><xsl:value-of select="$pos"/></pos>
+ </xsl:template>
+</xsl:stylesheet>