New test cases for bug 30211 (default-validation)
authorMichael Kay <mike@saxonica.com>
Thu, 21 Dec 2017 11:02:56 +0000
changeset 1793 6e5f48b3d36d
parent 1792 df4de18a7be9
child 1794 6fb185c865e9
New test cases for bug 30211 (default-validation)
tests/attr/validation/_validation-test-set.xml
tests/attr/validation/validation-16.xsd
tests/attr/validation/validation-1601.xsl
tests/attr/validation/validation-1602.xsl
tests/attr/validation/validation-1603.xsl
tests/attr/validation/validation-1604.xsl
tests/attr/validation/validation-1605.xsl
tests/attr/validation/validation-1606.xsl
tests/attr/validation/validation-1607.xsl
--- a/tests/attr/validation/_validation-test-set.xml	Tue Dec 05 23:18:12 2017 +0000
+++ b/tests/attr/validation/_validation-test-set.xml	Thu Dec 21 11:02:56 2017 +0000
@@ -31,6 +31,13 @@
          <schema file="validation-12.xsd"/>
       </environment>
    
+   <environment name="validation-16">
+      <source role="." validation="skip">
+         <content><![CDATA[<test/>]]></content>
+      </source>
+      <schema file="validation-16.xsd"/>
+   </environment>
+   
    <environment name="validation-20">
       <source validation="strict" file="validation-20.xml" uri="validation-20.xml"/>
       <source validation="strict" file="validation-20a.xml" uri="validation-20a.xml"/>
@@ -1057,6 +1064,154 @@
       </result>
    </test-case>
    
+   <test-case name="validation-1601">
+      <description>
+         Test whether the implicit result document is validated. Bug 30211. default-validation="preserve"
+      </description>
+      <created by="Michael Kay" on="2017-12-21"/>
+      <environment ref="validation-16"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+         <feature value="schema_aware"/>
+      </dependencies>
+      <test>
+         <stylesheet file="validation-1601.xsl"/>
+      </test>
+      <result>
+         <all-of>
+           <assert>not(/* instance of element(*,xs:untyped))</assert>
+           <assert-false/> <!--TBA pending resolution of 30211-->
+         </all-of>   
+      </result>
+   </test-case>
+   
+   <test-case name="validation-1602">
+      <description>
+         Test whether the implicit result document is validated. Bug 30211. Explicit validation at document level.
+      </description>
+      <created by="Michael Kay" on="2017-12-21"/>
+      <environment ref="validation-16"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+         <feature value="schema_aware"/>
+      </dependencies>
+      <test>
+         <stylesheet file="validation-1602.xsl"/>
+      </test>
+      <result>
+         <error code="XTTE1555"/>"
+      </result>
+   </test-case>
+   
+   <test-case name="validation-1603">
+      <description>
+         Test whether the implicit result document is validated. Bug 30211. default-validation="strip"
+      </description>
+      <created by="Michael Kay" on="2017-12-21"/>
+      <environment ref="validation-16"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+         <feature value="schema_aware"/>
+      </dependencies>
+      <test>
+         <stylesheet file="validation-1603.xsl"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>not(/* instance of element(*,xs:untyped))</assert>
+            <assert-false/> <!--TBA pending resolution of 30211-->
+         </all-of>  
+      </result>
+   </test-case>
+   
+   <test-case name="validation-1604">
+      <description>
+         Test whether the implicit result document is validated. Bug 30211. 
+         default-validation="strip" on top level, ="preserve" on imported module
+      </description>
+      <created by="Michael Kay" on="2017-12-21"/>
+      <environment ref="validation-16"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+         <feature value="schema_aware"/>
+      </dependencies>
+      <test>
+         <stylesheet file="validation-1604.xsl"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>not(/* instance of element(*,xs:untyped))</assert>
+            <assert-false/> <!--TBA pending resolution of 30211-->
+         </all-of>  
+      </result>
+   </test-case>
+   
+   <test-case name="validation-1605">
+      <description>
+         Test whether the implicit result document is validated. Bug 30211. 
+         default-validation="preserve" on top level, ="strip" on imported module
+      </description>
+      <created by="Michael Kay" on="2017-12-21"/>
+      <environment ref="validation-16"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+         <feature value="schema_aware"/>
+      </dependencies>
+      <test>
+         <stylesheet file="validation-1605.xsl"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>not(/* instance of element(*,xs:untyped))</assert>
+            <assert-false/> <!--TBA pending resolution of 30211-->
+         </all-of>  
+      </result>
+   </test-case>
+   
+   <test-case name="validation-1606">
+      <description>
+         Test whether the implicit result document is validated. Bug 30211. 
+         default-validation="preserve" on initial template
+      </description>
+      <created by="Michael Kay" on="2017-12-21"/>
+      <environment ref="validation-16"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+         <feature value="schema_aware"/>
+      </dependencies>
+      <test>
+         <stylesheet file="validation-1606.xsl"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>not(/* instance of element(*,xs:untyped))</assert>
+            <assert-false/> <!--TBA pending resolution of 30211-->
+         </all-of>   
+      </result>
+   </test-case>
+   
+   <test-case name="validation-1607">
+      <description>
+         Test whether the implicit result document is validated. Bug 30211. 
+         default-validation="strip" on initial template
+      </description>
+      <created by="Michael Kay" on="2017-12-21"/>
+      <environment ref="validation-16"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+         <feature value="schema_aware"/>
+      </dependencies>
+      <test>
+         <stylesheet file="validation-1607.xsl"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>not(/* instance of element(*,xs:untyped))</assert>
+            <assert-false/> <!--TBA pending resolution of 30211-->
+         </all-of>   
+      </result>
+   </test-case>
+   
    <test-case name="validation-2001">
       <description>show patterns matching against nilled and unnilled elements in the source</description>
       <created by="Michael Kay" on="2012-11-07"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/validation/validation-16.xsd	Thu Dec 21 11:02:56 2017 +0000
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ns.example.com/val16/" 
+  xmlns:v16="http://ns.example.com/val16/"
+  elementFormDefault="qualified">
+  
+  <xs:element name="doc">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="v16:test" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+<xs:element name="test">
+  <xs:complexType>
+    <xs:attribute name="id" type="xs:ID"></xs:attribute>
+  </xs:complexType>
+</xs:element>
+
+</xs:schema>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/validation/validation-1601.xsl	Thu Dec 21 11:02:56 2017 +0000
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0" default-validation="preserve"
+  xmlns:v16="http://ns.example.com/val16/">
+  
+  <!-- test to establish whether the implicit result document is validated. Bug 30211 -->
+
+  <xsl:import-schema namespace="http://ns.example.com/val16/" schema-location="validation-16.xsd"/>
+ 
+  <xsl:template match="/">
+    <v16:doc xsl:validation="strict">
+      <xsl:for-each select="1 to 10">
+        <v16:test id="Z{position() mod 5}"/>
+      </xsl:for-each>
+    </v16:doc>
+  </xsl:template>
+
+</xsl:stylesheet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/validation/validation-1602.xsl	Thu Dec 21 11:02:56 2017 +0000
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0" default-validation="preserve"
+  xmlns:v16="http://ns.example.com/val16/">
+  
+  <!-- test to establish whether the implicit result document is validated. Bug 30211 -->
+
+  <xsl:import-schema namespace="http://ns.example.com/val16/" schema-location="validation-16.xsd"/>
+ 
+  <xsl:template match="/">
+    <xsl:document validation="strict">
+      <v16:doc xsl:validation="strict">
+        <xsl:for-each select="1 to 10">
+          <v16:test id="Z{position() mod 5}"/>
+        </xsl:for-each>
+      </v16:doc>
+    </xsl:document>
+  </xsl:template>
+
+</xsl:stylesheet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/validation/validation-1603.xsl	Thu Dec 21 11:02:56 2017 +0000
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0" default-validation="strip"
+  xmlns:v16="http://ns.example.com/val16/">
+  
+  <!-- test to establish whether the implicit result document is validated. Bug 30211 -->
+
+  <xsl:import-schema namespace="http://ns.example.com/val16/" schema-location="validation-16.xsd"/>
+ 
+  <xsl:template match="/">
+      <v16:doc xsl:validation="strict">
+        <xsl:for-each select="1 to 10">
+          <v16:test id="Z{position() mod 5}"/>
+        </xsl:for-each>
+      </v16:doc>
+  </xsl:template>
+
+</xsl:stylesheet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/validation/validation-1604.xsl	Thu Dec 21 11:02:56 2017 +0000
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0" default-validation="strip"
+  xmlns:v16="http://ns.example.com/val16/">
+  
+  <!-- test to establish whether the implicit result document is validated. Bug 30211 -->
+
+  <xsl:import href="validation-1601.xsl"/>
+
+</xsl:stylesheet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/validation/validation-1605.xsl	Thu Dec 21 11:02:56 2017 +0000
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0" default-validation="strip"
+  xmlns:v16="http://ns.example.com/val16/">
+  
+  <!-- test to establish whether the implicit result document is validated. Bug 30211 -->
+
+  <xsl:import href="validation-1603.xsl"/>
+
+</xsl:stylesheet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/validation/validation-1606.xsl	Thu Dec 21 11:02:56 2017 +0000
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema" version="3.0"
+  xmlns:v16="http://ns.example.com/val16/">
+  
+  <!-- test to establish whether the implicit result document is validated. Bug 30211 -->
+
+  <xsl:import-schema namespace="http://ns.example.com/val16/" schema-location="validation-16.xsd"/>
+ 
+  <xsl:template match="/" default-validation="preserve">
+    <v16:doc xsl:validation="strict">
+      <xsl:for-each select="1 to 10">
+        <v16:test id="Z{position() mod 5}"/>
+      </xsl:for-each>
+    </v16:doc>
+  </xsl:template>
+
+</xsl:stylesheet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/validation/validation-1607.xsl	Thu Dec 21 11:02:56 2017 +0000
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema" version="3.0"
+  xmlns:v16="http://ns.example.com/val16/">
+  
+  <!-- test to establish whether the implicit result document is validated. Bug 30211 -->
+
+  <xsl:import-schema namespace="http://ns.example.com/val16/" schema-location="validation-16.xsd"/>
+ 
+  <xsl:template match="/" default-validation="strip">
+    <v16:doc xsl:validation="strict">
+      <xsl:for-each select="1 to 10">
+        <v16:test id="Z{position() mod 5}"/>
+      </xsl:for-each>
+    </v16:doc>
+  </xsl:template>
+
+</xsl:stylesheet>