summaryrefslogtreecommitdiff
path: root/tests/general/bug-179.xsl
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/general/bug-179.xsl
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/general/bug-179.xsl')
-rw-r--r--tests/general/bug-179.xsl24
1 files changed, 24 insertions, 0 deletions
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>
+