New test for xsl:context-item with xml:space=preserve
authorMichael Kay <mike@saxonica.com>
Mon, 13 Nov 2017 14:29:09 +0000
changeset 1785 99d9c32f0fac
parent 1784 3390faae04e0
child 1786 600f360051be
New test for xsl:context-item with xml:space=preserve
tests/decl/context-item/_context-item-test-set.xml
tests/decl/context-item/context-item-019.xsl
--- a/tests/decl/context-item/_context-item-test-set.xml	Mon Nov 13 14:28:29 2017 +0000
+++ b/tests/decl/context-item/_context-item-test-set.xml	Mon Nov 13 14:29:09 2017 +0000
@@ -280,6 +280,20 @@
       </result>
    </test-case>
    
+   <test-case name="context-item-019">
+      <description>
+         Test xsl:context-item with xml:space="preserve"
+      </description>
+      <created by="Michael Kay" on="2017-11-02"/>  
+      <environment ref="context-item-A"/>
+      <test>
+         <stylesheet file="context-item-019.xsl"/>
+      </test>
+      <result>
+         <assert>/out = "  " (:2 spaces only:)</assert>
+      </result>
+   </test-case>
+   
    
    
    <test-case name="context-item-901">
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/context-item/context-item-019.xsl	Mon Nov 13 14:29:09 2017 +0000
@@ -0,0 +1,13 @@
+<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs">
+
+    
+    <xsl:template match="/">
+      <out>
+        <xsl:call-template name="ws"/>
+      </out>
+    </xsl:template>
+
+    <xsl:template name="ws" xml:space="preserve">  <xsl:context-item as="document-node()"/>  </xsl:template>
+          
+  </xsl:stylesheet>
\ No newline at end of file