Adding several use-when tests, testing namespace sensitivity
authorabraaksm
Mon, 06 Apr 2015 18:44:23 +0200
changeset 917 f36bb0709c98
parent 916 7ba69990ffc9
child 918 9f8233561870
Adding several use-when tests, testing namespace sensitivity
tests/attr/use-when/_use-when-test-set.xml
tests/attr/use-when/use-when-0412.xsl
tests/attr/use-when/use-when-0413.xsl
tests/attr/use-when/use-when-0414.xsl
tests/attr/use-when/use-when-0415.xsl
tests/attr/use-when/use-when-0416.xsl
tests/attr/use-when/use-when-0417.xsl
tests/attr/use-when/use-when-0418.xsl
tests/attr/use-when/use-when-0419.xsl
tests/attr/use-when/use-when-0420.xsl
tests/attr/use-when/use-when-0421.xsl
tests/attr/use-when/use-when-0422.xsl
tests/attr/use-when/use-when-0423.xsl
tests/attr/use-when/use-when-0424.xsl
tests/attr/use-when/use-when-0425.xsl
tests/attr/use-when/use-when-0426.xsl
tests/attr/use-when/use-when-0427.xsl
tests/attr/use-when/use-when-0428.xsl
tests/attr/use-when/use-when-0429.xsl
tests/attr/use-when/use-when-0430.xsl
tests/attr/use-when/use-when-0431.xsl
--- a/tests/attr/use-when/_use-when-test-set.xml	Mon Apr 06 16:32:38 2015 +0200
+++ b/tests/attr/use-when/_use-when-test-set.xml	Mon Apr 06 18:44:23 2015 +0200
@@ -1437,7 +1437,10 @@
    </test-case>
    
    <test-case name="use-when-0411">
-      <description>Test case using a variable with static="" attribute (not allowed), that uses use-when with an EBV of true on an xsl:choose instruction.</description>
+      <description>
+         Test case using a variable with static="" attribute (not allowed),
+         that uses use-when with an EBV of true on an xsl:choose instruction.
+      </description>
       <created by="Debbie Lockett" on="2014-08-06"/>
       <environment ref="use-when-04"/>
       <dependencies>
@@ -1451,6 +1454,363 @@
       </result>
    </test-case>
    
+   <test-case name="use-when-0412">
+      <description>Tests that use-when must not be in the xsl namespace on xsl elements.</description>
+      <created by="Abel Braaksma" on="2015-03-28"/>
+      <environment ref="use-when-01"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="use-when-0412.xsl"/>
+      </test>
+      <result>
+         <error code="XTSE0090"/>
+      </result>
+   </test-case>
+
+   <test-case name="use-when-0413">
+      <description>
+        Tests that use-when must not be in the xsl namespace on xsl elements
+        Variant of previous, using alias namespace, should raise XTSE0090
+      </description>
+      <created by="Abel Braaksma" on="2015-03-28"/>
+      <environment ref="use-when-01"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="use-when-0413.xsl"/>
+      </test>
+      <result>
+         <error code="XTSE0090"/>
+      </result>
+   </test-case>
+
+   <test-case name="use-when-0414">
+      <description>
+        Tests that use-when must not be in the xsl namespace on xsl elements
+        Variant of previous, with an actual use-when=false, no error, no conflict, the correct use-when takes precedence
+      </description>
+      <created by="Abel Braaksma" on="2015-03-28"/>
+      <environment ref="use-when-01"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="use-when-0414.xsl"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<result/>]]></assert-xml>
+      </result>
+   </test-case>
+
+   <test-case name="use-when-0415">
+      <description>
+        Tests that use-when must not be in the xsl namespace on xsl elements
+        Variant of previous, with an actual use-when=true, error, because of second xsl:use-when
+      </description>
+      <created by="Abel Braaksma" on="2015-03-28"/>
+      <environment ref="use-when-01"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="use-when-0415.xsl"/>
+      </test>
+      <result>
+         <error code="XTSE0090"/>
+      </result>
+   </test-case>
+   
+   <test-case name="use-when-0416">
+      <description>
+        Tests that use-when must not be in the xsl namespace on xsl elements
+        Variant of previous, with second use-when and a different default namespace, has no effect on no-namespace of attribute
+      </description>
+      <created by="Abel Braaksma" on="2015-03-28"/>
+      <environment ref="use-when-01"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="use-when-0416.xsl"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<result/>]]></assert-xml>
+      </result>
+   </test-case>
+   
+   <test-case name="use-when-0417">
+      <description>
+        Tests that use-when must not be in the xsl namespace on xsl elements
+        Variant of previous, with xslt namespace set as the default namespace, has no effect on no-namespace of attribute
+      </description>
+      <created by="Abel Braaksma" on="2015-03-28"/>
+      <environment ref="use-when-01"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="use-when-0417.xsl"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<result/>]]></assert-xml>
+      </result>
+   </test-case>
+      
+   <test-case name="use-when-0418">
+      <description>
+        Tests that use-when must not be in the xsl namespace on xsl elements
+        xsl:fallback, normally ignored, but use-when errors should be triggered
+      </description>
+      <created by="Abel Braaksma" on="2015-03-28"/>
+      <environment ref="use-when-01"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="use-when-0418.xsl"/>
+      </test>
+      <result>
+         <error code="XTSE0090"/>
+      </result>
+   </test-case>
+   
+   <test-case name="use-when-0419">
+      <description>
+        Tests that use-when must not be in the xsl namespace on xsl elements
+        xsl:fallback, normally ignored, but use-when errors should be triggered
+      </description>
+      <created by="Abel Braaksma" on="2015-03-28"/>
+      <environment ref="use-when-01"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="use-when-0419.xsl"/>
+      </test>
+      <result>
+         <error code="XPDY0002"/>
+      </result>
+   </test-case>
+
+   <test-case name="use-when-0420">
+      <description>
+        Tests that use-when must not be in the xsl namespace on xsl elements
+        xsl:fallback, normally ignored, with a positive use-when, has no effect
+      </description>
+      <created by="Abel Braaksma" on="2015-03-28"/>
+      <environment ref="use-when-01"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="use-when-0420.xsl"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<result>Success</result>]]></assert-xml>
+      </result>
+   </test-case>
+
+   <test-case name="use-when-0421">
+      <description>
+         Test case using a variable with static="true" 
+		   variant of use-when-0411, with a valid static var and a body with use-when=false
+      </description>
+      <created by="Abel Braaksma" on="2015-03-28"/>
+      <environment ref="use-when-01"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="use-when-0421.xsl"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<out var="correct"/>]]></assert-xml>
+      </result>
+   </test-case>
+   
+   <test-case name="use-when-0422">
+      <description>
+         Tests that use-when must be in the xsl namespace on LREs.
+         In this case, must not throw XPST0003, but simply output the attribute
+      </description>
+      <created by="Abel Braaksma" on="2015-03-28"/>
+      <environment ref="use-when-01"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="use-when-0422.xsl"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<result><row use-when="not///valid///xpath"/></result>]]></assert-xml>
+      </result>
+   </test-case>
+   
+   <test-case name="use-when-0423">
+      <description>
+         Tests that use-when must be in the xsl namespace on LREs
+         Variant of previous, testing that the error is actually thrown: XPST0003
+      </description>
+      <created by="Abel Braaksma" on="2015-03-28"/>
+      <environment ref="use-when-01"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="use-when-0423.xsl"/>
+      </test>
+      <result>
+         <error code="XPST0003"/>
+      </result>
+   </test-case>
+   
+   <test-case name="use-when-0424">
+      <description>
+         Tests that use-when must be in the xsl namespace on LREs.
+         Variant of previous, with one in the xsl namespace and one not, EBV is false, no error.
+      </description>
+      <created by="Abel Braaksma" on="2015-03-28"/>
+      <environment ref="use-when-01"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="use-when-0424.xsl"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<result />]]></assert-xml>
+      </result>
+   </test-case>
+   
+   <test-case name="use-when-0425">
+      <description>
+         Tests that use-when must be in the xsl namespace on LREs.
+         Variant of previous, with one in the xsl namespace and one not, EBV is true, no error.
+      </description>
+      <created by="Abel Braaksma" on="2015-03-28"/>
+      <environment ref="use-when-01"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="use-when-0425.xsl"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<result><row use-when="not///a///valid///xpath"/></result>]]></assert-xml>
+      </result>
+   </test-case>
+   
+   <test-case name="use-when-0426">
+      <description>
+         Tests that use-when must be in the xsl namespace on LREs.
+         Variant of previous, with second use-when and a different default namespace, has no effect on no-namespace of attribute.
+      </description>
+      <created by="Abel Braaksma" on="2015-03-28"/>
+      <environment ref="use-when-01"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="use-when-0426.xsl"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<result><result><out:row xmlns:out="urn:out" select="'raises no error'" use-when="not///a///valid///xpath"/></result>]]></assert-xml>
+      </result>
+   </test-case>
+   
+   <test-case name="use-when-0427">
+      <description>
+         Tests that use-when must be in the xsl namespace on LREs.
+         Variant of previous, with xslt namespace set as the default namespace, has no effect on no-namespace of attribute, use-when has no effect
+      </description>
+      <created by="Abel Braaksma" on="2015-03-28"/>
+      <environment ref="use-when-01"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="use-when-0427.xsl"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<result><out:row xmlns:out="urn:out" select="'raises no error'" use-when="wrong///xpath"/></result>]]></assert-xml>
+      </result>
+   </test-case>
+   
+   <test-case name="use-when-0428">
+      <description>
+         Tests xsl:use-when inside xsl:fallback LRE with static error
+         xsl:fallback, normally ignored, but use-when errors should be triggered
+      </description>
+      <created by="Abel Braaksma" on="2015-03-28"/>
+      <environment ref="use-when-01"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="use-when-0428.xsl"/>
+      </test>
+      <result>
+         <error code="XPST0003"/>
+      </result>
+   </test-case>
+   
+   <test-case name="use-when-0429">
+      <description>
+         Tests xsl:use-when inside xsl:fallback LRE with dynamic error
+         xsl:fallback, normally ignored, but use-when errors should be triggered
+      </description>
+      <created by="Abel Braaksma" on="2015-03-28"/>
+      <environment ref="use-when-01"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="use-when-0429.xsl"/>
+      </test>
+      <result>
+         <error code="XPDY0002"/>
+      </result>
+   </test-case>
+   
+   <test-case name="use-when-0430">
+      <description>
+         Tests xsl:use-when inside xsl:fallback LRE without error
+         Variant of previous, without an error in the xsl:use-when expression inside xsl:fallback
+      </description>
+      <created by="Abel Braaksma" on="2015-03-28"/>
+      <environment ref="use-when-01"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="use-when-0430.xsl"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<result>Success</result>]]></assert-xml>
+      </result>
+   </test-case>
+   
+   <test-case name="use-when-0431">
+      <description>
+         Test case using a variable with static="true" and error. 
+		   Variant of use-when-0421, with use-when in no-namespace on an LRE, should raise error
+      </description>
+      <created by="Abel Braaksma" on="2015-03-28"/>
+      <environment ref="use-when-01"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="use-when-0431.xsl"/>
+      </test>
+      <result>
+         <error code="XTSE0620" />
+      </result>
+   </test-case>
+   
    <test-case name="use-when-0501">
       <description>Test case that uses use-when on xsl:sort to avoid ascending sort.</description>
       <created by="Michael Kay" on="2012-10-30"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/use-when/use-when-0412.xsl	Mon Apr 06 18:44:23 2015 +0200
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    exclude-result-prefixes="xs"
+    version="3.0">
+
+    <!-- Purpose: tests that use-when must not be in the xsl namespace on xsl elements: XTSE0090 -->
+
+
+    <xsl:template match="/">
+        <result>
+            <xsl:value-of select="'raises error'" xsl:use-when="false()" />
+        </result>
+    </xsl:template>
+</xsl:transform>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/use-when/use-when-0413.xsl	Mon Apr 06 18:44:23 2015 +0200
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    exclude-result-prefixes="xs"
+    version="3.0">
+
+    <!-- 
+        Purpose: tests that use-when must not be in the xsl namespace on xsl elements
+        Variant of previous, using alias namespace, should raise XTSE0090
+    -->
+
+
+    <xsl:template match="/">
+        <result>
+            <xsl:value-of select="'raises error'" transform:use-when="false()" xmlns:transform="http://www.w3.org/1999/XSL/Transform" />
+        </result>
+    </xsl:template>
+</xsl:transform>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/use-when/use-when-0414.xsl	Mon Apr 06 18:44:23 2015 +0200
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    exclude-result-prefixes="xs"
+    version="3.0">
+
+    <!-- 
+        Purpose: tests that use-when must not be in the xsl namespace on xsl elements
+        Variant of previous, with an actual use-when=false, no error, no conflict, the correct use-when takes precedence
+    -->
+
+
+    <xsl:template match="/">
+        <result>
+            <xsl:value-of select="'raises no error'" xsl:use-when="true()" use-when="function-available('does-not-exist')" />
+        </result>
+    </xsl:template>
+</xsl:transform>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/use-when/use-when-0415.xsl	Mon Apr 06 18:44:23 2015 +0200
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    exclude-result-prefixes="xs"
+    version="3.0">
+
+    <!-- 
+        Purpose: tests that use-when must not be in the xsl namespace on xsl elements
+        Variant of previous, with an actual use-when=true, error, because of second xsl:use-when
+    -->
+
+
+    <xsl:template match="/">
+        <result>
+            <xsl:value-of select="'raises error'" xsl:use-when="true()" use-when="function-available('concat')" />
+        </result>
+    </xsl:template>
+</xsl:transform>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/use-when/use-when-0416.xsl	Mon Apr 06 18:44:23 2015 +0200
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    exclude-result-prefixes="xs"
+    version="3.0">
+
+    <!-- 
+        Purpose: tests that use-when must not be in the xsl namespace on xsl elements
+        Variant of previous, with second use-when and a different default namespace, has no effect on no-namespace of attribute
+    -->
+
+
+    <xsl:template match="/">
+        <result>
+            <xsl:value-of select="'raises no error'" xsl:use-when="no///error" use-when="function-available('no-such-function')" xmlns="http://www.w3.org/1999/XSL/Transform" />
+        </result>
+    </xsl:template>
+</xsl:transform>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/use-when/use-when-0417.xsl	Mon Apr 06 18:44:23 2015 +0200
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<transform xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns="http://www.w3.org/1999/XSL/Transform"
+    exclude-result-prefixes="xs"
+    version="3.0">
+
+    <!-- 
+        Purpose: tests that use-when must not be in the xsl namespace on xsl elements
+        Variant of previous, with xslt namespace set as the default namespace, has no effect on no-namespace of attribute
+    -->
+
+
+    <template match="/">
+        <result xmlns="">
+            <value-of select="'raises no error'" use-when="function-available('no-such-function')" xmlns="http://www.w3.org/1999/XSL/Transform" />
+        </result>
+    </template>
+</transform>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/use-when/use-when-0418.xsl	Mon Apr 06 18:44:23 2015 +0200
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    exclude-result-prefixes="xs"
+    version="2.0">
+
+    <!-- 
+        Purpose: tests that use-when must not be in the xsl namespace on xsl elements
+        xsl:fallback, normally ignored, but use-when errors should be triggered
+    -->
+
+
+    <xsl:template match="/">
+        <result>
+            <xsl:value-of>
+                <xsl:text>Next statement has an error</xsl:text>
+                <xsl:fallback xsl:use-when="'not allowed'">Nothing to fallback on, xsl:valuae-of existed since 1.0</xsl:fallback>
+            </xsl:value-of>
+        </result>
+    </xsl:template>
+</xsl:transform>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/use-when/use-when-0419.xsl	Mon Apr 06 18:44:23 2015 +0200
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    exclude-result-prefixes="xs"
+    version="2.0">
+
+    <!-- 
+        Purpose: tests that use-when must not be in the xsl namespace on xsl elements
+        xsl:fallback, normally ignored anyway, but use-when errors should be triggered
+    -->
+
+
+    <xsl:template match="/">
+        <result>
+            <xsl:value-of>
+                <xsl:text>Next statement has an error</xsl:text>
+                <xsl:fallback use-when="error">Nothing to fallback on, xsl:valuae-of existed since 1.0, but wrong attribs still raise an error</xsl:fallback>
+            </xsl:value-of>
+        </result>
+    </xsl:template>
+</xsl:transform>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/use-when/use-when-0420.xsl	Mon Apr 06 18:44:23 2015 +0200
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    exclude-result-prefixes="xs"
+    version="2.0">
+
+    <!-- 
+        Purpose: tests that use-when must not be in the xsl namespace on xsl elements
+        xsl:fallback, normally ignored anyway, but use-when errors should be triggered
+    -->
+
+
+    <xsl:template match="/">
+        <result>
+            <xsl:value-of>
+                <xsl:text>Success</xsl:text>
+                <xsl:fallback use-when="function-available('string')">Nothing to fallback on, xsl:value-of existed since 1.0</xsl:fallback>
+            </xsl:value-of>
+        </result>
+    </xsl:template>
+</xsl:transform>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/use-when/use-when-0421.xsl	Mon Apr 06 18:44:23 2015 +0200
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xslt:transform xmlns:xs="http://www.w3.org/2001/XMLSchema"
+                xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
+                exclude-result-prefixes="xs"
+                version="3.0">
+	<!-- 
+		Purpose: Test case using a variable with static="true" 
+		variant of use-when-0411, with a valid static var and a body with use-when=false
+	-->
+
+   <xslt:variable name="x" as="xs:string" select="'correct'" static="true">
+      <!-- static variables may not have a body, but seqtor is disabled, so it is allowed -->
+   	<not-allowed-but-disabled xslt:use-when="system-property('xslt:version') = '10.1'" />
+   </xslt:variable>
+
+   <xslt:template match="/">   
+      <out var="{$x}" />      
+   </xslt:template>
+</xslt:transform>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/use-when/use-when-0422.xsl	Mon Apr 06 18:44:23 2015 +0200
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    exclude-result-prefixes="xs"
+    version="2.0">
+
+    <!-- 
+        Purpose: tests that use-when must be in the xsl namespace on LREs
+        In this case, must not throw XPST0003, but simply output the attribute
+    -->
+
+
+    <xsl:template match="/">
+        <result>
+            <row use-when="not///valid///xpath" />
+        </result>
+    </xsl:template>
+</xsl:transform>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/use-when/use-when-0423.xsl	Mon Apr 06 18:44:23 2015 +0200
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    exclude-result-prefixes="xs"
+    version="2.0">
+
+    <!-- 
+        Purpose: tests that use-when must be in the xsl namespace on LREs
+        Variant of previous, testing that the error is actually thrown: XPST0003
+    -->
+
+
+    <xsl:template match="/">
+        <result>
+            <row xsl:use-when="not///valid///xpath" />
+        </result>
+    </xsl:template>
+</xsl:transform>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/use-when/use-when-0424.xsl	Mon Apr 06 18:44:23 2015 +0200
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    exclude-result-prefixes="xs"
+    version="2.0">
+
+    <!-- 
+        Purpose: tests that use-when must be in the xsl namespace on LREs.
+        Variant of previous, with one in the xsl namespace and one not, EBV is false, no error.
+    -->
+
+
+    <xsl:template match="/">
+        <result>
+            <row xsl:use-when="function-available('does-not-exist')" use-when="not///a///valid///xpath" />
+        </result>
+    </xsl:template>
+</xsl:transform>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/use-when/use-when-0425.xsl	Mon Apr 06 18:44:23 2015 +0200
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    exclude-result-prefixes="xs"
+    version="2.0">
+
+    <!-- 
+        Purpose: tests that use-when must be in the xsl namespace on LREs
+        Variant of previous, with one in the xsl namespace and one not, EBV is true, no error.
+    -->
+
+
+    <xsl:template match="/">
+        <result>
+            <row xsl:use-when="function-available('concat')" use-when="not///a///valid///xpath" />
+        </result>
+    </xsl:template>
+</xsl:transform>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/use-when/use-when-0426.xsl	Mon Apr 06 18:44:23 2015 +0200
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:out="urn:out"
+    exclude-result-prefixes="xs out"
+    version="3.0">
+
+    <!-- 
+        Purpose: tests that use-when must be in the xsl namespace on LREs.
+        Variant of previous, with second use-when and a different default namespace, has no effect on no-namespace of attribute.
+    -->
+
+
+    <xsl:template match="/">
+        <result>
+            <out:row select="'raises no error'" xsl:use-when="function-available('concat')" use-when="not///a///valid///xpath" xmlns="http://www.w3.org/1999/XSL/Transform" />
+        </result>
+    </xsl:template>
+</xsl:transform>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/use-when/use-when-0427.xsl	Mon Apr 06 18:44:23 2015 +0200
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<transform xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns="http://www.w3.org/1999/XSL/Transform"
+    xmlns:out="urn:out"
+    exclude-result-prefixes="xs out"
+    version="3.0">
+
+    <!-- 
+        Purpose: Tests that use-when must be in the xsl namespace on LREs.
+        Variant of previous, with xslt namespace set as the default namespace, has no effect on no-namespace of attribute, use-when has no effect
+    -->
+
+
+    <template match="/">
+        <result xmlns="">
+            <out:row select="'raises no error'" use-when="wrong///xpath" xmlns="http://www.w3.org/1999/XSL/Transform" />
+        </result>
+    </template>
+</transform>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/use-when/use-when-0428.xsl	Mon Apr 06 18:44:23 2015 +0200
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    exclude-result-prefixes="xs"
+    version="2.0">
+
+    <!-- 
+        Purpose: tests that use-when must not be in the xsl namespace on xsl elements
+        xsl:fallback, normally ignored, but use-when errors should be triggered
+    -->
+
+
+    <xsl:template match="/">
+        <result>
+            <xsl:value-of>
+                <xsl:text>Next statement has an error</xsl:text>
+                <xsl:fallback>
+                    <row xsl:use-when="invalid///xpath">Nothing to fallback on, xsl:valuae-of existed since 1.0</row>
+                </xsl:fallback>
+            </xsl:value-of>
+        </result>
+    </xsl:template>
+</xsl:transform>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/use-when/use-when-0429.xsl	Mon Apr 06 18:44:23 2015 +0200
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    exclude-result-prefixes="xs"
+    version="2.0">
+
+    <!-- 
+        Purpose: tests xsl:use-when inside xsl:fallback LRE with dynamic error
+        xsl:fallback, normally ignored, but use-when errors should be triggered
+    -->
+
+
+    <xsl:template match="/">
+        <result>
+            <xsl:value-of>
+                <xsl:text>Next statement has an error</xsl:text>
+                <xsl:fallback>
+                    <out xsl:use-when="error">Nothing to fallback on, xsl:value-of existed since 1.0, but wrong attribs still raise an error</out>
+                </xsl:fallback>
+            </xsl:value-of>
+        </result>
+    </xsl:template>
+</xsl:transform>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/use-when/use-when-0430.xsl	Mon Apr 06 18:44:23 2015 +0200
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    exclude-result-prefixes="xs"
+    version="2.0">
+
+    <!-- 
+        Purpose: tests xsl:use-when inside xsl:fallback LRE without error
+        Variant of previous, without an error in the xsl:use-when expression inside xsl:fallback
+    -->
+
+
+    <xsl:template match="/">
+        <result>
+            <xsl:value-of>
+                <xsl:text>Success</xsl:text>
+                <xsl:fallback>
+                    <row xsl:use-when="function-available('string')">
+                        Nothing to fallback on, xsl:value-of existed since 1.0
+                    </row>
+                </xsl:fallback>
+            </xsl:value-of>
+        </result>
+    </xsl:template>
+</xsl:transform>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/use-when/use-when-0431.xsl	Mon Apr 06 18:44:23 2015 +0200
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xslt:transform xmlns:xs="http://www.w3.org/2001/XMLSchema"
+                xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
+                exclude-result-prefixes="xs"
+                version="3.0">
+	<!-- 
+		Purpose: Test case using a variable with static="true" and error 
+		variant of use-when-0421, with use-when in no-namespace on an LRE, should raise error
+	-->
+
+   <xslt:variable name="x" as="xs:string" select="'correct'" static="true">
+      <!-- static variables may not have a body, seqtor is incorrectly disabled (use-when not in xsl namespace), not allowed -->
+   	<not-allowed-but-disabled use-when="system-property('xslt:version') = '10.1'" />
+   </xslt:variable>
+
+   <xslt:template match="/">   
+      <out var="{$x}" />      
+   </xslt:template>
+</xslt:transform>