Variants of tests for invalid namespace URI
authorMichael Kay <mike@saxonica.com>
Mon, 18 Sep 2017 23:29:15 +0100
changeset 1757 42a8d79bce60
parent 1756 77b6da0b5d67
child 1758 6380162df04c
Variants of tests for invalid namespace URI
tests/misc/error/_error-test-set.xml
tests/misc/error/error-0905c.xsl
--- a/tests/misc/error/_error-test-set.xml	Mon Sep 18 23:28:14 2017 +0100
+++ b/tests/misc/error/_error-test-set.xml	Mon Sep 18 23:29:15 2017 +0100
@@ -5968,14 +5968,14 @@
    <test-case name="error-0905a">
       <description>Generate error XTDE0905.
 Was error-code-296.
-It is a non-recoverable dynamic
-                     error if the string value of the new namespace
+It is a non-recoverable dynamic error if the string value of the new namespace
                      node is not valid in the lexical space of the datatype xs:anyURI,
                      or if it is the string http://www.w3.org/2000/xmlns/.</description>
       <created by="Michael Kay" on="2012-11-07"/>
       <environment ref="error001"/>
       <dependencies>
          <spec value="XSLT20+"/>
+         <feature value="XSD_1.1" satisfied="false"/>
       </dependencies>
       <test>
          <stylesheet file="error-0905a.xsl"/>
@@ -5985,6 +5985,45 @@
          <error code="XTDE0905"/>
       </result>
    </test-case>
+   
+   <test-case name="error-0905b">
+      <description>No error XTDE0905 for XSD 1.1 (see bug 30180).
+         It is a non-recoverable dynamic error if the string value of the new namespace
+         node is not valid in the lexical space of the datatype xs:anyURI,
+         or if it is the string http://www.w3.org/2000/xmlns/.</description>
+      <created by="Michael Kay" on="2017-09-11"/>
+      <environment ref="error001"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+         <feature value="XSD_1.1" satisfied="true"/>
+      </dependencies>
+      <test>
+         <stylesheet file="error-0905a.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <assert>/*:out/namespace::ns="####"</assert>
+      </result>
+   </test-case>
+   
+   <test-case name="error-0905c">
+      <description>Generate error XTDE0905.
+         It is a non-recoverable dynamic error if the string value of the new namespace
+         node is not valid in the lexical space of the datatype xs:anyURI,
+         or if it is the string http://www.w3.org/2000/xmlns/.</description>
+      <created by="Michael Kay" on="2012-11-07"/>
+      <environment ref="error001"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="error-0905c.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <error code="XTDE0905"/>
+      </result>
+   </test-case>
 
    <test-case name="error-0910a">
       <description>Generate error XTSE0910.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/misc/error/error-0905c.xsl	Mon Sep 18 23:29:15 2017 +0100
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--It is a non-recoverable dynamic
+                     error if the string value of the new namespace
+                     node is not valid in the lexical space of the datatype xs:anyURI,
+                     or if it is the string http://www.w3.org/2000/xmlns/.-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:xs="http://www.w3.org/2001/XMLSchema"
+                xmlns:my="http://my.com/"
+                version="2.0">
+
+<?error XTDE0905?>
+
+   <xsl:param name="p" select="'ns'"/>
+
+  <xsl:template name="main">
+      <my:out>
+        <xsl:namespace name="ns">http://www.w3.org/2000/xmlns/</xsl:namespace>
+      </my:out>
+  </xsl:template>
+  
+
+
+
+</xsl:stylesheet>