Add tests for error XTSE3051 (accept and override same component)
authorMichael Kay <mike@saxonica.com>
Fri, 07 Jul 2017 18:40:08 +0100
changeset 1714 6e097efc9c99
parent 1713 c2aa9ced325c
child 1715 b57b6910c021
Add tests for error XTSE3051 (accept and override same component)
tests/misc/error/_error-test-set.xml
tests/misc/error/error-3051a.xsl
tests/misc/error/error-3051b.xsl
--- a/tests/misc/error/_error-test-set.xml	Thu Jul 06 10:49:27 2017 +0100
+++ b/tests/misc/error/_error-test-set.xml	Fri Jul 07 18:40:08 2017 +0100
@@ -9591,7 +9591,43 @@
          <error code="XTSE3050"/>
       </result>
    </test-case>
-
+   
+   <test-case name="error-3051a">
+      <description>[ERR XTSE3051] It is a static error if a token in the names attribute of xsl:accept, 
+         other than a wildcard, matches the symbolic name of a component declared within 
+         an xsl:override child of the same xsl:use-package element.</description>
+      <created by="Michael Kay" on="2017-07-07"/>
+      <environment ref="error003"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="error-3051a.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <error code="XTSE3051"/>
+      </result>
+   </test-case>
+
+   <test-case name="error-3051b">
+      <description>[ERR XTSE3051] It is a static error if a token in the names attribute of xsl:accept, 
+         other than a wildcard, matches the symbolic name of a component declared within 
+         an xsl:override child of the same xsl:use-package element.</description>
+      <created by="Michael Kay" on="2017-07-07"/>
+      <environment ref="error003"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="error-3051b.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <error code="XTSE3051"/>
+      </result>
+   </test-case>
+   
    <test-case name="error-3052a">
       <description>Error: It is a dynamic error 
                               if an invocation of an absent component (that is, an abstract component accepted
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/misc/error/error-3051a.xsl	Fri Jul 07 18:40:08 2017 +0100
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+  <!--[ERR XTSE3051] It is a static error if a token in the names attribute of xsl:accept, 
+    other than a wildcard, matches the symbolic name of a component declared within 
+    an xsl:override child of the same xsl:use-package element.-->
+
+   
+   <xsl:use-package name="http://www.w3.org/xslt30tests/error-base-002" package-version="1.0.0">
+     <xsl:accept component="template" names="t-public" visibility="final"/>
+     <xsl:override>
+       <xsl:template name="t-public" as="xs:string">t-public-override</xsl:template>
+     </xsl:override>
+   </xsl:use-package> 
+   
+ 
+   <xsl:template name="main">
+      <out>
+         <xsl:call-template name="t-public"/>
+      </out>
+   </xsl:template>
+</xsl:stylesheet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/misc/error/error-3051b.xsl	Fri Jul 07 18:40:08 2017 +0100
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+  <!--[ERR XTSE3051] It is a static error if a token in the names attribute of xsl:accept, 
+    other than a wildcard, matches the symbolic name of a component declared within 
+    an xsl:override child of the same xsl:use-package element.-->
+
+   
+   <xsl:use-package name="http://www.w3.org/xslt30tests/error-base-002" package-version="1.0.0">
+     <xsl:override>
+       <xsl:template name="t-public" as="xs:string">t-public-override</xsl:template>
+     </xsl:override>
+     <xsl:accept component="template" names="t-final t-public" visibility="final"/>
+     
+   </xsl:use-package> 
+   
+ 
+   <xsl:template name="main">
+      <out>
+         <xsl:call-template name="t-public"/>
+      </out>
+   </xsl:template>
+</xsl:stylesheet>