summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2012-09-28 21:04:39 +0200
committerDaniel Veillard <veillard@redhat.com>2012-10-09 10:51:10 +0800
commitbe264bd3034b352a7c768ba62bf62cca22d074d9 (patch)
treebe1981ef981210640c1e9626275293abbaecf556 /tests
parent3d7ba8075408e5b87fde820746bcacfd86b553c6 (diff)
downloadlibxslt-be264bd3034b352a7c768ba62bf62cca22d074d9.tar.gz
libxslt-be264bd3034b352a7c768ba62bf62cca22d074d9.tar.bz2
libxslt-be264bd3034b352a7c768ba62bf62cca22d074d9.zip
Fix regression: Default namespace not correctly used
https://bugzilla.gnome.org/show_bug.cgi?id=684564
Diffstat (limited to 'tests')
-rw-r--r--tests/docs/Makefile.am1
-rw-r--r--tests/docs/bug-179.xml1
-rw-r--r--tests/general/Makefile.am1
-rw-r--r--tests/general/bug-179.out9
-rw-r--r--tests/general/bug-179.xsl24
5 files changed, 36 insertions, 0 deletions
diff --git a/tests/docs/Makefile.am b/tests/docs/Makefile.am
index 9e2204ff..12a97a8a 100644
--- a/tests/docs/Makefile.am
+++ b/tests/docs/Makefile.am
@@ -168,6 +168,7 @@ EXTRA_DIST = \
bug-167.xml \
bug-168.xml \
bug-169.xml \
+ bug-179.xml \
character.xml \
array.xml \
items.xml
diff --git a/tests/docs/bug-179.xml b/tests/docs/bug-179.xml
new file mode 100644
index 00000000..69d62f2c
--- /dev/null
+++ b/tests/docs/bug-179.xml
@@ -0,0 +1 @@
+<doc/>
diff --git a/tests/general/Makefile.am b/tests/general/Makefile.am
index 364fdd9d..762eca9f 100644
--- a/tests/general/Makefile.am
+++ b/tests/general/Makefile.am
@@ -186,6 +186,7 @@ EXTRA_DIST = \
bug-176.out bug-176.xsl \
bug-177.out bug-177.xsl \
bug-178.out bug-178.xsl \
+ bug-179.out bug-179.xsl \
character.out character.xsl \
character2.out character2.xsl \
itemschoose.out itemschoose.xsl \
diff --git a/tests/general/bug-179.out b/tests/general/bug-179.out
new file mode 100644
index 00000000..0a7e67d1
--- /dev/null
+++ b/tests/general/bug-179.out
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<root xmlns="my::namespace">
+ <foo>...</foo>
+ <bar>...</bar>
+ <foobar>...</foobar>
+ <baz>...</baz>
+ <doc>...</doc>
+ <baz>...</baz>
+</root>
diff --git a/tests/general/bug-179.xsl b/tests/general/bug-179.xsl
new file mode 100644
index 00000000..5847e9a0
--- /dev/null
+++ b/tests/general/bug-179.xsl
@@ -0,0 +1,24 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns="my::namespace">
+
+<xsl:variable name="var">baz</xsl:variable>
+
+<xsl:output indent="yes"/>
+
+<xsl:template match="/">
+ <root> <!-- This is in the correct namespace "my::namespace" -->
+ <foo>...</foo> <!-- OK. -->
+ <xsl:element name="bar">...</xsl:element> <!-- Still okay. -->
+
+ <!-- Wrong! These are without namespace. -->
+ <xsl:element name="{concat('foo', 'bar')}">...</xsl:element>
+ <xsl:element name="{$var}">...</xsl:element>
+ <xsl:element name="{local-name(*)}">...</xsl:element>
+
+ <!-- Explicitly setting the namespace fixes this. -->
+ <xsl:element name="{$var}" namespace="my::namespace">...</xsl:element>
+ </root>
+</xsl:template>
+
+</xsl:stylesheet>
+