Test for reserved namespace in xsl:strip-space default tip
authorMichael Kay <mike@saxonica.com>
Mon, 04 Feb 2019 15:06:07 +0000
changeset 1963 ee72f5b68fc5
parent 1962 d0bf5d242874
Test for reserved namespace in xsl:strip-space
tests/decl/strip-space/_strip-space-test-set.xml
tests/decl/strip-space/strip-space-029.xsl
--- a/tests/decl/strip-space/_strip-space-test-set.xml	Sat Feb 02 20:32:25 2019 +0000
+++ b/tests/decl/strip-space/_strip-space-test-set.xml	Mon Feb 04 15:06:07 2019 +0000
@@ -732,4 +732,27 @@
          <error code="XTSE0270" />
       </result>
    </test-case>
+   
+   <test-case name="strip-space-029">
+      <description>
+         xsl:strip-space/preserve-space referring to xsl namespace
+      </description>
+      <created by="Michael Kay" on="2019-02-04"/>
+      <environment>
+         <source role="." file="strip-space-029.xsl"/>
+      </environment>
+      <dependencies>
+         <spec value="XSLT30+" />
+      </dependencies>
+      <test>
+         <stylesheet file="strip-space-029.xsl"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>contains(/out, ' &lt;xsl:attribute')</assert>
+            <assert>contains(/out, '&gt;&lt;xsl:text&gt;  &lt;/xsl:text&gt;&lt;')</assert>
+            <assert>contains(/out, '&lt;/xsl:attribute&gt; ')</assert>
+         </all-of>
+      </result>
+   </test-case>
 </test-set>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-029.xsl	Mon Feb 04 15:06:07 2019 +0000
@@ -0,0 +1,19 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+xmlns:abc="http://abc.uri/">
+
+<!-- Test reference to reserved namespace in strip-space (Saxon bug 4129) -->
+
+    <xsl:strip-space elements="xsl:*"/>
+    <xsl:preserve-space elements="xsl:text"/>
+    
+    <xsl:template name="data">
+        <e> <xsl:attribute name="x">
+                <xsl:text>  </xsl:text>
+            </xsl:attribute> </e>
+    </xsl:template>
+    
+    <xsl:template match="/">
+        <out><xsl:value-of select="serialize(//xsl:template[@name='data'])"/></out>
+    </xsl:template>
+</xsl:stylesheet>