Tests of multiple use-package declarations for the same library package with different overrides
authorMichael Kay <mike@saxonica.com>
Tue, 05 Dec 2017 23:09:29 +0000
changeset 1788 c74e9fd5a0c0
parent 1787 6e4397bf2f98
child 1789 7fe5dce7e15e
Tests of multiple use-package declarations for the same library package with different overrides
tests/decl/override/_override-test-set.xml
tests/decl/override/override-t-014-lib.xsl
tests/decl/override/override-t-014.xsl
tests/decl/override/override-t-015-lib-v1.xsl
tests/decl/override/override-t-015-lib-v2.xsl
tests/decl/override/override-t-015.xsl
--- a/tests/decl/override/_override-test-set.xml	Tue Dec 05 23:08:26 2017 +0000
+++ b/tests/decl/override/_override-test-set.xml	Tue Dec 05 23:09:29 2017 +0000
@@ -725,6 +725,33 @@
          <error code="XTSE3070"/>
       </result>
    </test-case> 
+   
+   <test-case name="override-t-014">
+      <description>Two different overrides of selected components in the same library package</description>
+      <created by="Michael Kay" on="2017-11-28"/>
+      <test>
+         <package file="override-t-014.xsl" role="principal"/>
+         <package file="override-t-014-lib.xsl" role="secondary"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<out><ttt override="yes"/><uuu override="yes"/></out>]]></assert-xml>
+      </result>
+   </test-case> 
+   
+   <test-case name="override-t-015">
+      <description>Two different overrides of selected components in different versions of the same library package</description>
+      <created by="Michael Kay" on="2017-11-28"/>
+      <test>
+         <package file="override-t-015.xsl" role="principal"/>
+         <package file="override-t-015-lib-v1.xsl" role="secondary"/>
+         <package file="override-t-015-lib-v2.xsl" role="secondary"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<out><override><ttt/></override><override><uuu/></override></out>]]></assert-xml>
+      </result>
+   </test-case> 
 
    <test-case name="override-v-001">
       <description>Successful override of a public global variable</description>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/override/override-t-014-lib.xsl	Tue Dec 05 23:09:29 2017 +0000
@@ -0,0 +1,19 @@
+<xsl:package 
+  name="http://www.w3.org/xslt30tests/override-t-014-lib"
+  package-version="1.0.0"
+  version="3.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  xmlns:p="http://www.w3.org/xslt30tests/override-base-101"
+  exclude-result-prefixes="xs p">
+  
+  <xsl:template name="t" visibility="public">
+    <ttt/>
+  </xsl:template>
+  
+  <xsl:template name="u" visibility="public">
+    <uuu/>
+  </xsl:template>
+
+  
+</xsl:package>   
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/override/override-t-014.xsl	Tue Dec 05 23:09:29 2017 +0000
@@ -0,0 +1,53 @@
+<xsl:package 
+  name="http://www.w3.org/xslt30tests/override-t-014"
+  package-version="1.0.0"
+  version="3.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  xmlns:p="http://www.w3.org/xslt30tests/override-base-101"
+  exclude-result-prefixes="xs p">
+  
+  <xsl:use-package
+    name="http://www.w3.org/xslt30tests/override-t-014-lib"
+    package-version="1.0.0">
+    
+    <xsl:accept component="template" names="*" visibility="hidden"/>
+  
+    <xsl:override>
+  
+      <xsl:template name="t" visibility="public">
+        <ttt override="yes"/>
+      </xsl:template>
+
+    </xsl:override>  
+    
+  </xsl:use-package>
+  
+  <xsl:use-package
+    name="http://www.w3.org/xslt30tests/override-t-014-lib"
+    package-version="1.0.0">
+    
+    <xsl:accept component="template" names="*" visibility="hidden"/>
+    
+    <xsl:override>
+      
+      <xsl:template name="u" visibility="public">
+        <uuu override="yes"/>
+      </xsl:template>
+      
+    </xsl:override>  
+    
+  </xsl:use-package>
+  
+ 
+   
+    <xsl:template name="main">
+    <out>
+      <xsl:call-template name="t"/>
+      <xsl:call-template name="u"/>
+    </out>  
+    </xsl:template>
+    
+
+  
+</xsl:package>   
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/override/override-t-015-lib-v1.xsl	Tue Dec 05 23:09:29 2017 +0000
@@ -0,0 +1,15 @@
+<xsl:package 
+  name="http://www.w3.org/xslt30tests/override-t-015-lib"
+  package-version="1.0.0"
+  version="3.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  xmlns:p="http://www.w3.org/xslt30tests/override-base-101"
+  exclude-result-prefixes="xs p">
+  
+  <xsl:template name="t" visibility="public">
+    <ttt/>
+  </xsl:template>
+
+  
+</xsl:package>   
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/override/override-t-015-lib-v2.xsl	Tue Dec 05 23:09:29 2017 +0000
@@ -0,0 +1,15 @@
+<xsl:package 
+  name="http://www.w3.org/xslt30tests/override-t-015-lib"
+  package-version="2.0.0"
+  version="3.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  xmlns:p="http://www.w3.org/xslt30tests/override-base-101"
+  exclude-result-prefixes="xs p">
+  
+  <xsl:template name="u" visibility="public">
+    <uuu/>
+  </xsl:template>
+
+  
+</xsl:package>   
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/override/override-t-015.xsl	Tue Dec 05 23:09:29 2017 +0000
@@ -0,0 +1,53 @@
+<xsl:package 
+  name="http://www.w3.org/xslt30tests/override-t-015"
+  package-version="1.0.0"
+  version="3.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  xmlns:p="http://www.w3.org/xslt30tests/override-base-101"
+  exclude-result-prefixes="xs p">
+  
+  <xsl:use-package
+    name="http://www.w3.org/xslt30tests/override-t-015-lib"
+    package-version="1.0.0">
+
+    <xsl:override>
+  
+      <xsl:template name="t" visibility="public">
+        <override>
+          <xsl:call-template name="xsl:original"/>
+        </override>
+      </xsl:template>
+
+    </xsl:override>  
+    
+  </xsl:use-package>
+  
+  <xsl:use-package
+    name="http://www.w3.org/xslt30tests/override-t-015-lib"
+    package-version="2.0.0">
+
+    <xsl:override>
+      
+      <xsl:template name="u" visibility="public">
+        <override>
+          <xsl:call-template name="xsl:original"/>
+        </override>
+      </xsl:template>
+      
+    </xsl:override>  
+    
+  </xsl:use-package>
+  
+ 
+   
+    <xsl:template name="main">
+    <out>
+      <xsl:call-template name="t"/>
+      <xsl:call-template name="u"/>
+    </out>  
+    </xsl:template>
+    
+
+  
+</xsl:package>   
\ No newline at end of file