Move xsl:strip-space to declarations
authorabraaksm
Fri, 03 Apr 2015 02:39:41 +0200
changeset 912 147d206adb46
parent 911 8e396169cc0f
child 913 c02c6346e1b8
Move xsl:strip-space to declarations
catalog.xml
tests/decl/strip-space/strip-space-0114.xsl
tests/decl/strip-space/strip-space-0115.xsl
tests/decl/strip-space/strip-space-0401.xsl
tests/decl/strip-space/strip-space-0402.xsl
tests/decl/strip-space/strip-space-0501.xsl
tests/decl/strip-space/strip-space-0502.xsl
tests/decl/strip-space/strip-space-0601.xsl
tests/decl/strip-space/strip-space-0602.xsl
tests/decl/strip-space/strip-space-0603.xsl
tests/decl/strip-space/strip-space-0701.xsl
tests/decl/strip-space/strip-space-0702.xsl
tests/decl/strip-space/strip-space-0703.xsl
tests/decl/strip-space/strip-space-0704.xsl
tests/decl/strip-space/strip-space-0801.xsl
tests/decl/strip-space/strip-space-0901.xsl
tests/decl/strip-space/strip-space-0902.xsl
tests/decl/strip-space/strip-space-1101.xsl
tests/decl/strip-space/strip-space-1401.xsl
tests/decl/strip-space/strip-space-1501.xsl
tests/decl/strip-space/strip-space-1601.xsl
tests/decl/strip-space/strip-space-1601a.xsl
tests/decl/strip-space/strip-space-1704.xsl
tests/decl/strip-space/strip-space-1801.out
tests/decl/strip-space/strip-space-1801.xsl
tests/misc/whitespace/whitespace-0114.xsl
tests/misc/whitespace/whitespace-0115.xsl
tests/misc/whitespace/whitespace-0401.xsl
tests/misc/whitespace/whitespace-0402.xsl
tests/misc/whitespace/whitespace-0501.xsl
tests/misc/whitespace/whitespace-0502.xsl
tests/misc/whitespace/whitespace-0601.xsl
tests/misc/whitespace/whitespace-0602.xsl
tests/misc/whitespace/whitespace-0603.xsl
tests/misc/whitespace/whitespace-0701.xsl
tests/misc/whitespace/whitespace-0702.xsl
tests/misc/whitespace/whitespace-0703.xsl
tests/misc/whitespace/whitespace-0704.xsl
tests/misc/whitespace/whitespace-0801.xsl
tests/misc/whitespace/whitespace-0901.xsl
tests/misc/whitespace/whitespace-0902.xsl
tests/misc/whitespace/whitespace-1101.xsl
tests/misc/whitespace/whitespace-1401.xsl
tests/misc/whitespace/whitespace-1501.xsl
tests/misc/whitespace/whitespace-1601.xsl
tests/misc/whitespace/whitespace-1601a.xsl
tests/misc/whitespace/whitespace-1704.xsl
tests/misc/whitespace/whitespace-1801.out
tests/misc/whitespace/whitespace-1801.xsl
--- a/catalog.xml	Fri Apr 03 02:20:45 2015 +0200
+++ b/catalog.xml	Fri Apr 03 02:39:41 2015 +0200
@@ -36,6 +36,7 @@
       <test-set name="override" file="tests/decl/override/_override-test-set.xml"/>
       <test-set name="package" file="tests/decl/package/_package-test-set.xml"/>
       <test-set name="param" file="tests/decl/param/_param-test-set.xml"/>
+      <test-set name="strip-space" file="tests/decl/strip-space/_strip-space-test-set.xml"/>
       <test-set name="template" file="tests/decl/template/_template-test-set.xml"/>
       <test-set name="use-package" file="tests/decl/use-package/_use-package-test-set.xml"/>
       <test-set name="variable" file="tests/decl/variable/_variable-test-set.xml"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-0114.xsl	Fri Apr 03 02:39:41 2015 +0200
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<t:transform xmlns:foo="http://www.test1.example.org" xmlns:t="http://www.w3.org/1999/XSL/Transform"
+   exclude-result-prefixes="foo" version="2.0">
+   <!-- Purpose: Test with an element constructed with whitespace text node children. 
+				The element is stored in a variable and its name is listed in xsl:strip-space. 
+				Confirm that the element has a text node child. -->
+
+   <t:variable name="var" as="element()">
+      <foo:elem>
+         <t:value-of select="substring('ab   cd  ef',3,2)"/>
+      </foo:elem>
+   </t:variable>
+
+   <t:strip-space elements="foo:elem"/>
+
+   <t:template match="/doc">
+      <out>
+         <a>
+            <t:value-of select="$var/text()"/>
+         </a>
+         <a>
+            <t:value-of select="count($var/text())"/>
+         </a>
+      </out>
+   </t:template>
+</t:transform>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-0115.xsl	Fri Apr 03 02:39:41 2015 +0200
@@ -0,0 +1,11 @@
+<xsl:stylesheet
+  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+  version="2.0">
+
+  <xsl:strip-space elements="xfa:* "/>
+
+  <xsl:template match="doc">
+    <TEST/>
+  </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-0401.xsl	Fri Apr 03 02:39:41 2015 +0200
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<t:transform xmlns:t="http://www.w3.org/1999/XSL/Transform" version="2.0">
+   <!-- Purpose: Test xsl:preserve-space with @elements="*:NCName". Template 
+  				rules have  match="*", match="*:NCName" and match="QName" -->
+
+   <t:strip-space elements="*"/>
+
+   <t:preserve-space elements="*:elem"/>
+
+   <t:template match="/doc">
+      <out>
+         <t:apply-templates/>
+      </out>
+   </t:template>
+
+   <t:template match="elem">
+      <a>
+         <t:value-of select="."/>
+      </a>
+   </t:template>
+
+   <t:template match="*:elem">
+      <b>
+         <t:value-of select="."/>
+      </b>
+   </t:template>
+
+   <t:template match="*">
+      <c>
+         <t:value-of select="."/>
+      </c>
+   </t:template>
+</t:transform>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-0402.xsl	Fri Apr 03 02:39:41 2015 +0200
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<t:transform xmlns:t="http://www.w3.org/1999/XSL/Transform" version="2.0">
+<!-- Purpose: Test xsl:strip-space with @elements="*:NCName". 
+				Template rules have  match="*", match="*:NCName" and match="QName". -->
+
+   <t:preserve-space elements="*"/>
+
+   <t:strip-space elements="*:elem"/>
+
+   <t:template match="/doc">
+	     <out>
+         <t:apply-templates/>
+      </out>
+   </t:template>
+
+   <t:template match="elem">
+	     <a>
+         <t:value-of select="."/>
+      </a>
+   </t:template>
+
+   <t:template match="*:elem">
+	     <b>
+         <t:value-of select="."/>
+      </b>
+   </t:template>
+
+   <t:template match="*">
+	     <c>
+         <t:value-of select="."/>
+      </c>
+   </t:template>
+</t:transform>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-0501.xsl	Fri Apr 03 02:39:41 2015 +0200
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<t:transform xmlns:foo="http://www.test1.example.org" xmlns:t="http://www.w3.org/1999/XSL/Transform"
+   exclude-result-prefixes="foo" version="2.0">
+   <!-- Purpose: Test xsl:preserve-space with @elements="NCName:*". 
+  				Template rules have  match="*" , match="NCName:* and match="QName". -->
+
+   <t:strip-space elements="*"/>
+
+   <t:preserve-space elements="foo:*"/>
+
+   <t:template match="/doc">
+      <out>
+         <t:apply-templates/>
+      </out>
+   </t:template>
+
+   <t:template match="elem">
+      <a>
+         <t:value-of select="."/>
+      </a>
+   </t:template>
+
+   <t:template match="foo:*">
+      <b>
+         <t:value-of select="."/>
+      </b>
+   </t:template>
+
+   <t:template match="*">
+      <c>
+         <t:value-of select="."/>
+      </c>
+   </t:template>
+</t:transform>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-0502.xsl	Fri Apr 03 02:39:41 2015 +0200
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<t:transform xmlns:foo="http://www.test1.example.org" xmlns:t="http://www.w3.org/1999/XSL/Transform"
+   exclude-result-prefixes="foo" version="2.0">
+   <!-- Purpose: Test xsl:strip-space with @elements="NCName:*". Template 
+  				rules have  match="*" , match="NCName:* and match="QName". -->
+
+   <t:preserve-space elements="*"/>
+
+   <t:strip-space elements="foo:*"/>
+
+   <t:template match="/doc">
+      <out>
+         <t:apply-templates/>
+      </out>
+   </t:template>
+
+   <t:template match="elem">
+      <a>
+         <t:value-of select="."/>
+      </a>
+   </t:template>
+
+   <t:template match="foo:*">
+      <b>
+         <t:value-of select="."/>
+      </b>
+   </t:template>
+
+   <t:template match="*">
+      <c>
+         <t:value-of select="."/>
+      </c>
+   </t:template>
+</t:transform>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-0601.xsl	Fri Apr 03 02:39:41 2015 +0200
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<t:transform xmlns:my="http://www.whitespace.example.com/ns/various"
+             xmlns:t="http://www.w3.org/1999/XSL/Transform"
+             exclude-result-prefixes="my"
+             version="2.0">
+<!-- Purpose: Test that whitespace text nodes are stripped from elements with element 
+  				only content regardless of xsl:preserve-space or xsl:strip-space. -->
+
+   <t:preserve-space elements="my:complexUserElem"/>
+
+   <t:template match="/my:userNode">
+      <t:variable name="copy">
+	        <out>
+	           <t:copy-of select="my:complexUserElem[1]"/>
+         </out>
+	     </t:variable>
+	     <t:choose>
+	        <t:when test="exists($copy//text()[matches(.,'\s+')])">
+	           <t:copy-of select="$copy"/>
+	        </t:when>
+	        <t:otherwise>
+	           <ok/>
+	        </t:otherwise>
+	     </t:choose>
+   </t:template>
+</t:transform>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-0602.xsl	Fri Apr 03 02:39:41 2015 +0200
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<t:transform xmlns:my="http://www.whitespace.example.com/ns/various"
+   xmlns:t="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="my" version="2.0">
+   <!-- Purpose: Test that whitespace text nodes are not stripped from elements with simple 
+content regardless of xsl:preserve-space or xsl:strip-space. -->
+
+   <!-- We use several different tests to check the whitespace is still there,
+   in order to exercise different paths in Saxon -->
+   
+   <!-- firstName has a simple type; familyName has a complex type with simple content -->
+
+   <t:strip-space elements="firstName familyName"/>
+   <!-- note, the child elements are not namespace-qualified -->
+
+   <t:template match="/my:userNode">
+      <t:variable name="copy">
+         <out>
+            <t:copy-of select="my:complexUserElem[2]"/>
+         </out>
+      </t:variable>
+      <t:choose>
+         <t:when test="empty($copy//firstName/text()[matches(.,'\s+')])">
+            <a><t:copy-of select="$copy"/></a>
+         </t:when>
+         <t:when test="empty($copy//familyName/text()[matches(.,'\s+')])">
+            <b><t:copy-of select="$copy"/></b>
+         </t:when>
+         <t:when test="empty(my:complexUserElem[2]//firstName/text()[matches(.,'\s+')])">
+            <c><t:copy-of select="$copy"/></c>
+         </t:when>
+         <t:when test="string(my:complexUserElem[2]//firstName) = ''">
+            <d><t:copy-of select="$copy"/></d>
+         </t:when>
+         <t:when test="not(data(my:complexUserElem[2]//firstName))">
+            <e><t:copy-of select="$copy"/></e>
+         </t:when>
+         <t:when test="empty(my:complexUserElem[2]//familyName/text()[matches(.,'\s+')])">
+            <f><t:copy-of select="$copy"/></f>
+         </t:when>
+         <t:when test="string(my:complexUserElem[2]//familyName) = ''">
+            <g><t:copy-of select="$copy"/></g>
+         </t:when>
+         <t:when test="not(data(my:complexUserElem[2]//familyName))">
+            <h><t:copy-of select="$copy"/></h>
+         </t:when>
+         <t:otherwise>
+            <ok/>
+         </t:otherwise>
+      </t:choose>
+   </t:template>
+</t:transform>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-0603.xsl	Fri Apr 03 02:39:41 2015 +0200
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<t:transform xmlns:my="http://www.whitespace.example.com/ns/various"
+   xmlns:t="http://www.w3.org/1999/XSL/Transform" 
+   exclude-result-prefixes="my" version="2.0">
+   <!-- Purpose: Test that whitespace text nodes are not stripped from an element
+        if there is an ancestor element that was validated against a type that includes
+        an assertion. -->
+
+   <!-- We use several different tests to check the whitespace is still there,
+   in order to exercise different paths in Saxon -->
+   
+   <!-- firstName has a simple type; familyName has a complex type with simple content -->
+
+   <t:strip-space elements="p"/>
+   
+
+
+   <t:template match="/">
+      <t:variable name="copy">
+         <out>
+            <t:copy-of select="doc"/>
+         </out>
+      </t:variable>
+      <t:choose>
+         <t:when test="empty($copy//p/text()[matches(.,'\s{4}')])">
+            <a><t:copy-of select="$copy"/></a>
+         </t:when>
+         <t:when test="empty(doc//p/text()[matches(.,'\s+')])">
+            <c><t:copy-of select="$copy"/></c>
+         </t:when>
+         <t:when test="string(doc//p) = ''">
+            <d><t:copy-of select="$copy"/></d>
+         </t:when>
+         <t:when test="not(data(doc//p))">
+            <e><t:copy-of select="$copy"/></e>
+         </t:when>
+         <t:otherwise>
+            <ok/>
+         </t:otherwise>
+      </t:choose>
+   </t:template>
+</t:transform>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-0701.xsl	Fri Apr 03 02:39:41 2015 +0200
@@ -0,0 +1,14 @@
+<?xml version="1.0"?> 
+
+<!-- Another Test for white-space -->
+ 
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+  <xsl:strip-space elements="test1"/>
+  
+  <xsl:template match="doc">
+    <out>
+	    <xsl:apply-templates select="*"/>
+    </out>
+  </xsl:template>
+   
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-0702.xsl	Fri Apr 03 02:39:41 2015 +0200
@@ -0,0 +1,14 @@
+<?xml version="1.0"?> 
+
+<!-- Another Test for white-space -->
+ 
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+  <xsl:strip-space elements="test1 test2"/>
+  
+  <xsl:template match="doc">
+    <out>
+	    <xsl:apply-templates select="*"/>
+    </out>
+  </xsl:template>
+   
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-0703.xsl	Fri Apr 03 02:39:41 2015 +0200
@@ -0,0 +1,14 @@
+<?xml version="1.0"?> 
+
+<!-- Another Test for white-space -->
+ 
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+  <xsl:strip-space elements="*"/>
+  
+  <xsl:template match="doc">
+    <out>
+	    <xsl:apply-templates select="*"/>
+    </out>
+  </xsl:template>
+   
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-0704.xsl	Fri Apr 03 02:39:41 2015 +0200
@@ -0,0 +1,15 @@
+<?xml version="1.0"?> 
+
+<!-- Another Test for white-space -->
+ 
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+  <xsl:strip-space elements="*"/>
+  <xsl:preserve-space elements="test2"/>
+  
+  <xsl:template match="doc">
+    <out>
+	    <xsl:apply-templates select="*"/>
+    </out>
+  </xsl:template>
+   
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-0801.xsl	Fri Apr 03 02:39:41 2015 +0200
@@ -0,0 +1,14 @@
+<?xml version="1.0"?> 
+
+<!-- PURPOSE: Another Test for white-space handling-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+  <xsl:strip-space elements="b"/>
+  
+  <xsl:template match="doc">
+    <out>
+	    <xsl:apply-templates select="*"/>
+    </out>
+  </xsl:template>
+   
+</xsl:stylesheet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-0901.xsl	Fri Apr 03 02:39:41 2015 +0200
@@ -0,0 +1,14 @@
+<?xml version="1.0"?> 
+
+<!-- Another Test for white-space -->
+ 
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:ns1="http://ns1/">
+  <xsl:strip-space elements="ns1:test"/>
+  
+  <xsl:template match="doc">
+    <out>
+	    <xsl:apply-templates select="*"/>
+    </out>
+  </xsl:template>
+   
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-0902.xsl	Fri Apr 03 02:39:41 2015 +0200
@@ -0,0 +1,14 @@
+<?xml version="1.0"?> 
+
+<!-- Another Test for white-space -->
+  
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:ns1="http://ns1/">
+  <xsl:strip-space elements="ns1:*"/>
+  
+  <xsl:template match="doc">
+    <out>
+	    <xsl:apply-templates select="*"/>
+    </out>
+  </xsl:template>
+   
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-1101.xsl	Fri Apr 03 02:39:41 2015 +0200
@@ -0,0 +1,20 @@
+<xsl:stylesheet
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+  
+  <xsl:strip-space elements="document"/>
+  <?spec xslt#strip?>
+
+  <xsl:template match="document">
+    <out>
+      <xsl:apply-templates/>
+    </out>
+  </xsl:template>
+
+  <xsl:template match="section">
+    <xsl:text>Position:</xsl:text><xsl:value-of select="position()"/>
+    <xsl:text>,Last:</xsl:text><xsl:value-of select="last()"/><xsl:text>
+</xsl:text>
+</xsl:template>
+
+</xsl:stylesheet>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-1401.xsl	Fri Apr 03 02:39:41 2015 +0200
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+
+<!-- test that the default namespace is NOT used for names in xsl:strip-space -->
+<?spec xslt#strip?>
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+  <xsl:strip-space elements="a b c" xmlns="http://foo.uri/"/>
+  <xsl:template match="/"><xsl:copy-of select="."/></xsl:template>
+</xsl:stylesheet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-1501.xsl	Fri Apr 03 02:39:41 2015 +0200
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+
+<!-- test two conflicting xsl:strip-space declarations (recoverable error) --> 
+<?spec xslt#strip?>
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+  <xsl:strip-space elements="a b c"/>
+  <xsl:preserve-space elements="b"/>
+  <xsl:template match="/"><xsl:copy-of select="."/></xsl:template>
+</xsl:stylesheet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-1601.xsl	Fri Apr 03 02:39:41 2015 +0200
@@ -0,0 +1,13 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+xmlns:abc="http://abc.uri/">
+
+<!-- Test import precedence for xsl:strip-space -->
+
+<xsl:import href="whitespace-1601a.xsl"/>
+<xsl:strip-space elements="abc:*"/>
+<xsl:preserve-space elements="abc:w"/>
+
+<xsl:template match="/"><xsl:copy-of select="."/></xsl:template>
+
+</xsl:stylesheet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-1601a.xsl	Fri Apr 03 02:39:41 2015 +0200
@@ -0,0 +1,9 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+xmlns:abc="http://abc.uri/">
+
+<xsl:preserve-space elements="abc:x abc:y abc:z q"/>
+
+  <xsl:template match="/"><xsl:copy-of select="."/></xsl:template>
+
+</xsl:stylesheet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-1704.xsl	Fri Apr 03 02:39:41 2015 +0200
@@ -0,0 +1,18 @@
+<xsl:stylesheet version="2.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+  
+  <!-- no confict reported in 2.0 if there are two 
+       identical strip-space or preserve-space declarations -->
+        <?spec xslt#strip?>
+
+  <xsl:output method="xml" indent="no" />
+
+  <xsl:strip-space elements="document"/>
+  <xsl:strip-space elements="document"/>
+
+  <xsl:template match="@*|node()">
+    <xsl:copy>
+      <xsl:apply-templates select="@*|node()"/>
+    </xsl:copy>
+  </xsl:template>
+</xsl:stylesheet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-1801.out	Fri Apr 03 02:39:41 2015 +0200
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?><a xml:space="preserve">
+  <b xml:space="default"/>
+  <c>  </c>
+  <d xml:space="preserve">  </d>
+  <e xml:space="default"><f xml:space="preserve">  </f></e>
+</a>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/strip-space/strip-space-1801.xsl	Fri Apr 03 02:39:41 2015 +0200
@@ -0,0 +1,15 @@
+<xsl:stylesheet version="2.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+  
+  <?spec xslt#strip?>
+
+  <xsl:output method="xml" indent="no" />
+
+  <xsl:strip-space elements="*"/>
+
+  <xsl:template match="@*|node()">
+    <xsl:copy>
+      <xsl:apply-templates select="@*|node()"/>
+    </xsl:copy>
+  </xsl:template>
+</xsl:stylesheet>
--- a/tests/misc/whitespace/whitespace-0114.xsl	Fri Apr 03 02:20:45 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<t:transform xmlns:foo="http://www.test1.example.org" xmlns:t="http://www.w3.org/1999/XSL/Transform"
-   exclude-result-prefixes="foo" version="2.0">
-   <!-- Purpose: Test with an element constructed with whitespace text node children. 
-				The element is stored in a variable and its name is listed in xsl:strip-space. 
-				Confirm that the element has a text node child. -->
-
-   <t:variable name="var" as="element()">
-      <foo:elem>
-         <t:value-of select="substring('ab   cd  ef',3,2)"/>
-      </foo:elem>
-   </t:variable>
-
-   <t:strip-space elements="foo:elem"/>
-
-   <t:template match="/doc">
-      <out>
-         <a>
-            <t:value-of select="$var/text()"/>
-         </a>
-         <a>
-            <t:value-of select="count($var/text())"/>
-         </a>
-      </out>
-   </t:template>
-</t:transform>
--- a/tests/misc/whitespace/whitespace-0115.xsl	Fri Apr 03 02:20:45 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-<xsl:stylesheet
-  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-  version="2.0">
-
-  <xsl:strip-space elements="xfa:* "/>
-
-  <xsl:template match="doc">
-    <TEST/>
-  </xsl:template>
-</xsl:stylesheet>
\ No newline at end of file
--- a/tests/misc/whitespace/whitespace-0401.xsl	Fri Apr 03 02:20:45 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<t:transform xmlns:t="http://www.w3.org/1999/XSL/Transform" version="2.0">
-   <!-- Purpose: Test xsl:preserve-space with @elements="*:NCName". Template 
-  				rules have  match="*", match="*:NCName" and match="QName" -->
-
-   <t:strip-space elements="*"/>
-
-   <t:preserve-space elements="*:elem"/>
-
-   <t:template match="/doc">
-      <out>
-         <t:apply-templates/>
-      </out>
-   </t:template>
-
-   <t:template match="elem">
-      <a>
-         <t:value-of select="."/>
-      </a>
-   </t:template>
-
-   <t:template match="*:elem">
-      <b>
-         <t:value-of select="."/>
-      </b>
-   </t:template>
-
-   <t:template match="*">
-      <c>
-         <t:value-of select="."/>
-      </c>
-   </t:template>
-</t:transform>
--- a/tests/misc/whitespace/whitespace-0402.xsl	Fri Apr 03 02:20:45 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<t:transform xmlns:t="http://www.w3.org/1999/XSL/Transform" version="2.0">
-<!-- Purpose: Test xsl:strip-space with @elements="*:NCName". 
-				Template rules have  match="*", match="*:NCName" and match="QName". -->
-
-   <t:preserve-space elements="*"/>
-
-   <t:strip-space elements="*:elem"/>
-
-   <t:template match="/doc">
-	     <out>
-         <t:apply-templates/>
-      </out>
-   </t:template>
-
-   <t:template match="elem">
-	     <a>
-         <t:value-of select="."/>
-      </a>
-   </t:template>
-
-   <t:template match="*:elem">
-	     <b>
-         <t:value-of select="."/>
-      </b>
-   </t:template>
-
-   <t:template match="*">
-	     <c>
-         <t:value-of select="."/>
-      </c>
-   </t:template>
-</t:transform>
--- a/tests/misc/whitespace/whitespace-0501.xsl	Fri Apr 03 02:20:45 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<t:transform xmlns:foo="http://www.test1.example.org" xmlns:t="http://www.w3.org/1999/XSL/Transform"
-   exclude-result-prefixes="foo" version="2.0">
-   <!-- Purpose: Test xsl:preserve-space with @elements="NCName:*". 
-  				Template rules have  match="*" , match="NCName:* and match="QName". -->
-
-   <t:strip-space elements="*"/>
-
-   <t:preserve-space elements="foo:*"/>
-
-   <t:template match="/doc">
-      <out>
-         <t:apply-templates/>
-      </out>
-   </t:template>
-
-   <t:template match="elem">
-      <a>
-         <t:value-of select="."/>
-      </a>
-   </t:template>
-
-   <t:template match="foo:*">
-      <b>
-         <t:value-of select="."/>
-      </b>
-   </t:template>
-
-   <t:template match="*">
-      <c>
-         <t:value-of select="."/>
-      </c>
-   </t:template>
-</t:transform>
--- a/tests/misc/whitespace/whitespace-0502.xsl	Fri Apr 03 02:20:45 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<t:transform xmlns:foo="http://www.test1.example.org" xmlns:t="http://www.w3.org/1999/XSL/Transform"
-   exclude-result-prefixes="foo" version="2.0">
-   <!-- Purpose: Test xsl:strip-space with @elements="NCName:*". Template 
-  				rules have  match="*" , match="NCName:* and match="QName". -->
-
-   <t:preserve-space elements="*"/>
-
-   <t:strip-space elements="foo:*"/>
-
-   <t:template match="/doc">
-      <out>
-         <t:apply-templates/>
-      </out>
-   </t:template>
-
-   <t:template match="elem">
-      <a>
-         <t:value-of select="."/>
-      </a>
-   </t:template>
-
-   <t:template match="foo:*">
-      <b>
-         <t:value-of select="."/>
-      </b>
-   </t:template>
-
-   <t:template match="*">
-      <c>
-         <t:value-of select="."/>
-      </c>
-   </t:template>
-</t:transform>
--- a/tests/misc/whitespace/whitespace-0601.xsl	Fri Apr 03 02:20:45 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<t:transform xmlns:my="http://www.whitespace.example.com/ns/various"
-             xmlns:t="http://www.w3.org/1999/XSL/Transform"
-             exclude-result-prefixes="my"
-             version="2.0">
-<!-- Purpose: Test that whitespace text nodes are stripped from elements with element 
-  				only content regardless of xsl:preserve-space or xsl:strip-space. -->
-
-   <t:preserve-space elements="my:complexUserElem"/>
-
-   <t:template match="/my:userNode">
-      <t:variable name="copy">
-	        <out>
-	           <t:copy-of select="my:complexUserElem[1]"/>
-         </out>
-	     </t:variable>
-	     <t:choose>
-	        <t:when test="exists($copy//text()[matches(.,'\s+')])">
-	           <t:copy-of select="$copy"/>
-	        </t:when>
-	        <t:otherwise>
-	           <ok/>
-	        </t:otherwise>
-	     </t:choose>
-   </t:template>
-</t:transform>
--- a/tests/misc/whitespace/whitespace-0602.xsl	Fri Apr 03 02:20:45 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<t:transform xmlns:my="http://www.whitespace.example.com/ns/various"
-   xmlns:t="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="my" version="2.0">
-   <!-- Purpose: Test that whitespace text nodes are not stripped from elements with simple 
-content regardless of xsl:preserve-space or xsl:strip-space. -->
-
-   <!-- We use several different tests to check the whitespace is still there,
-   in order to exercise different paths in Saxon -->
-   
-   <!-- firstName has a simple type; familyName has a complex type with simple content -->
-
-   <t:strip-space elements="firstName familyName"/>
-   <!-- note, the child elements are not namespace-qualified -->
-
-   <t:template match="/my:userNode">
-      <t:variable name="copy">
-         <out>
-            <t:copy-of select="my:complexUserElem[2]"/>
-         </out>
-      </t:variable>
-      <t:choose>
-         <t:when test="empty($copy//firstName/text()[matches(.,'\s+')])">
-            <a><t:copy-of select="$copy"/></a>
-         </t:when>
-         <t:when test="empty($copy//familyName/text()[matches(.,'\s+')])">
-            <b><t:copy-of select="$copy"/></b>
-         </t:when>
-         <t:when test="empty(my:complexUserElem[2]//firstName/text()[matches(.,'\s+')])">
-            <c><t:copy-of select="$copy"/></c>
-         </t:when>
-         <t:when test="string(my:complexUserElem[2]//firstName) = ''">
-            <d><t:copy-of select="$copy"/></d>
-         </t:when>
-         <t:when test="not(data(my:complexUserElem[2]//firstName))">
-            <e><t:copy-of select="$copy"/></e>
-         </t:when>
-         <t:when test="empty(my:complexUserElem[2]//familyName/text()[matches(.,'\s+')])">
-            <f><t:copy-of select="$copy"/></f>
-         </t:when>
-         <t:when test="string(my:complexUserElem[2]//familyName) = ''">
-            <g><t:copy-of select="$copy"/></g>
-         </t:when>
-         <t:when test="not(data(my:complexUserElem[2]//familyName))">
-            <h><t:copy-of select="$copy"/></h>
-         </t:when>
-         <t:otherwise>
-            <ok/>
-         </t:otherwise>
-      </t:choose>
-   </t:template>
-</t:transform>
--- a/tests/misc/whitespace/whitespace-0603.xsl	Fri Apr 03 02:20:45 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<t:transform xmlns:my="http://www.whitespace.example.com/ns/various"
-   xmlns:t="http://www.w3.org/1999/XSL/Transform" 
-   exclude-result-prefixes="my" version="2.0">
-   <!-- Purpose: Test that whitespace text nodes are not stripped from an element
-        if there is an ancestor element that was validated against a type that includes
-        an assertion. -->
-
-   <!-- We use several different tests to check the whitespace is still there,
-   in order to exercise different paths in Saxon -->
-   
-   <!-- firstName has a simple type; familyName has a complex type with simple content -->
-
-   <t:strip-space elements="p"/>
-   
-
-
-   <t:template match="/">
-      <t:variable name="copy">
-         <out>
-            <t:copy-of select="doc"/>
-         </out>
-      </t:variable>
-      <t:choose>
-         <t:when test="empty($copy//p/text()[matches(.,'\s{4}')])">
-            <a><t:copy-of select="$copy"/></a>
-         </t:when>
-         <t:when test="empty(doc//p/text()[matches(.,'\s+')])">
-            <c><t:copy-of select="$copy"/></c>
-         </t:when>
-         <t:when test="string(doc//p) = ''">
-            <d><t:copy-of select="$copy"/></d>
-         </t:when>
-         <t:when test="not(data(doc//p))">
-            <e><t:copy-of select="$copy"/></e>
-         </t:when>
-         <t:otherwise>
-            <ok/>
-         </t:otherwise>
-      </t:choose>
-   </t:template>
-</t:transform>
--- a/tests/misc/whitespace/whitespace-0701.xsl	Fri Apr 03 02:20:45 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0"?> 
-
-<!-- Another Test for white-space -->
- 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
-  <xsl:strip-space elements="test1"/>
-  
-  <xsl:template match="doc">
-    <out>
-	    <xsl:apply-templates select="*"/>
-    </out>
-  </xsl:template>
-   
-</xsl:stylesheet>
\ No newline at end of file
--- a/tests/misc/whitespace/whitespace-0702.xsl	Fri Apr 03 02:20:45 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0"?> 
-
-<!-- Another Test for white-space -->
- 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
-  <xsl:strip-space elements="test1 test2"/>
-  
-  <xsl:template match="doc">
-    <out>
-	    <xsl:apply-templates select="*"/>
-    </out>
-  </xsl:template>
-   
-</xsl:stylesheet>
\ No newline at end of file
--- a/tests/misc/whitespace/whitespace-0703.xsl	Fri Apr 03 02:20:45 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0"?> 
-
-<!-- Another Test for white-space -->
- 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
-  <xsl:strip-space elements="*"/>
-  
-  <xsl:template match="doc">
-    <out>
-	    <xsl:apply-templates select="*"/>
-    </out>
-  </xsl:template>
-   
-</xsl:stylesheet>
\ No newline at end of file
--- a/tests/misc/whitespace/whitespace-0704.xsl	Fri Apr 03 02:20:45 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-<?xml version="1.0"?> 
-
-<!-- Another Test for white-space -->
- 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
-  <xsl:strip-space elements="*"/>
-  <xsl:preserve-space elements="test2"/>
-  
-  <xsl:template match="doc">
-    <out>
-	    <xsl:apply-templates select="*"/>
-    </out>
-  </xsl:template>
-   
-</xsl:stylesheet>
\ No newline at end of file
--- a/tests/misc/whitespace/whitespace-0801.xsl	Fri Apr 03 02:20:45 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0"?> 
-
-<!-- PURPOSE: Another Test for white-space handling-->
-
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
-  <xsl:strip-space elements="b"/>
-  
-  <xsl:template match="doc">
-    <out>
-	    <xsl:apply-templates select="*"/>
-    </out>
-  </xsl:template>
-   
-</xsl:stylesheet>
--- a/tests/misc/whitespace/whitespace-0901.xsl	Fri Apr 03 02:20:45 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0"?> 
-
-<!-- Another Test for white-space -->
- 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:ns1="http://ns1/">
-  <xsl:strip-space elements="ns1:test"/>
-  
-  <xsl:template match="doc">
-    <out>
-	    <xsl:apply-templates select="*"/>
-    </out>
-  </xsl:template>
-   
-</xsl:stylesheet>
\ No newline at end of file
--- a/tests/misc/whitespace/whitespace-0902.xsl	Fri Apr 03 02:20:45 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0"?> 
-
-<!-- Another Test for white-space -->
-  
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:ns1="http://ns1/">
-  <xsl:strip-space elements="ns1:*"/>
-  
-  <xsl:template match="doc">
-    <out>
-	    <xsl:apply-templates select="*"/>
-    </out>
-  </xsl:template>
-   
-</xsl:stylesheet>
\ No newline at end of file
--- a/tests/misc/whitespace/whitespace-1101.xsl	Fri Apr 03 02:20:45 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-<xsl:stylesheet
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
-  
-  <xsl:strip-space elements="document"/>
-  <?spec xslt#strip?>
-
-  <xsl:template match="document">
-    <out>
-      <xsl:apply-templates/>
-    </out>
-  </xsl:template>
-
-  <xsl:template match="section">
-    <xsl:text>Position:</xsl:text><xsl:value-of select="position()"/>
-    <xsl:text>,Last:</xsl:text><xsl:value-of select="last()"/><xsl:text>
-</xsl:text>
-</xsl:template>
-
-</xsl:stylesheet>
-
--- a/tests/misc/whitespace/whitespace-1401.xsl	Fri Apr 03 02:20:45 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- test that the default namespace is NOT used for names in xsl:strip-space -->
-<?spec xslt#strip?>
-
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
-  <xsl:strip-space elements="a b c" xmlns="http://foo.uri/"/>
-  <xsl:template match="/"><xsl:copy-of select="."/></xsl:template>
-</xsl:stylesheet>
--- a/tests/misc/whitespace/whitespace-1501.xsl	Fri Apr 03 02:20:45 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- test two conflicting xsl:strip-space declarations (recoverable error) --> 
-<?spec xslt#strip?>
-
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
-  <xsl:strip-space elements="a b c"/>
-  <xsl:preserve-space elements="b"/>
-  <xsl:template match="/"><xsl:copy-of select="."/></xsl:template>
-</xsl:stylesheet>
--- a/tests/misc/whitespace/whitespace-1601.xsl	Fri Apr 03 02:20:45 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<?xml version='1.0'?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
-xmlns:abc="http://abc.uri/">
-
-<!-- Test import precedence for xsl:strip-space -->
-
-<xsl:import href="whitespace-1601a.xsl"/>
-<xsl:strip-space elements="abc:*"/>
-<xsl:preserve-space elements="abc:w"/>
-
-<xsl:template match="/"><xsl:copy-of select="."/></xsl:template>
-
-</xsl:stylesheet>
--- a/tests/misc/whitespace/whitespace-1601a.xsl	Fri Apr 03 02:20:45 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-<?xml version='1.0'?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
-xmlns:abc="http://abc.uri/">
-
-<xsl:preserve-space elements="abc:x abc:y abc:z q"/>
-
-  <xsl:template match="/"><xsl:copy-of select="."/></xsl:template>
-
-</xsl:stylesheet>
--- a/tests/misc/whitespace/whitespace-1704.xsl	Fri Apr 03 02:20:45 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-<xsl:stylesheet version="2.0"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-  
-  <!-- no confict reported in 2.0 if there are two 
-       identical strip-space or preserve-space declarations -->
-        <?spec xslt#strip?>
-
-  <xsl:output method="xml" indent="no" />
-
-  <xsl:strip-space elements="document"/>
-  <xsl:strip-space elements="document"/>
-
-  <xsl:template match="@*|node()">
-    <xsl:copy>
-      <xsl:apply-templates select="@*|node()"/>
-    </xsl:copy>
-  </xsl:template>
-</xsl:stylesheet>
--- a/tests/misc/whitespace/whitespace-1801.out	Fri Apr 03 02:20:45 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><a xml:space="preserve">
-  <b xml:space="default"/>
-  <c>  </c>
-  <d xml:space="preserve">  </d>
-  <e xml:space="default"><f xml:space="preserve">  </f></e>
-</a>
\ No newline at end of file
--- a/tests/misc/whitespace/whitespace-1801.xsl	Fri Apr 03 02:20:45 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-<xsl:stylesheet version="2.0"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-  
-  <?spec xslt#strip?>
-
-  <xsl:output method="xml" indent="no" />
-
-  <xsl:strip-space elements="*"/>
-
-  <xsl:template match="@*|node()">
-    <xsl:copy>
-      <xsl:apply-templates select="@*|node()"/>
-    </xsl:copy>
-  </xsl:template>
-</xsl:stylesheet>