New test for UCA as default collation default tip
authorMichael Kay <mike@saxonica.com>
Tue, 19 Feb 2019 15:17:34 +0000
changeset 1969 da871f349907
parent 1968 5fe8a3d97b27
New test for UCA as default collation
tests/misc/collations/_collations-test-set.xml
tests/misc/collations/collations-1006.xsl
--- a/tests/misc/collations/_collations-test-set.xml	Tue Feb 19 15:16:41 2019 +0000
+++ b/tests/misc/collations/_collations-test-set.xml	Tue Feb 19 15:17:34 2019 +0000
@@ -685,4 +685,25 @@
       </result>
    </test-case>
    
+   <test-case name="collations-1006">
+      <description>To verify that the default-collation attribute is used by various expressions.</description>
+      <created by="Michael Kay" on="2019-02-19"/>
+      <environment ref="collationfunc001"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="collations-1006.xsl"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>/out/a = 'true'</assert>
+            <assert>/out/b = 'true'</assert>
+            <assert>/out/c = 'true'</assert>
+            <assert>/out/d = 'true'</assert>
+            <assert>/out/e = 'Ab aBC aBcD'</assert>
+         </all-of>
+      </result>
+   </test-case>
+   
 </test-set>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/misc/collations/collations-1006.xsl	Tue Feb 19 15:17:34 2019 +0000
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<t:transform xmlns:t="http://www.w3.org/1999/XSL/Transform" version="3.0"
+   expand-text="true">
+<!-- Purpose: To verify that the default-collation is actually used by various constructs.-->
+
+   <t:template match="doc"
+      default-collation="http://www.w3.org/2013/collation/UCA?strength=secondary;fallback=no">
+      <out>
+         <a>{'abc' = 'ABC'}</a>
+         <b>{'abc' eq 'ABC'}</b>
+         <c>{starts-with('abc', 'AB')}</c>
+         <d>{compare('abc', 'ABc') eq 0}</d>
+         <e><t:perform-sort select="('Ab', 'aBcD', 'aBC')">
+            <t:sort/>
+         </t:perform-sort></e>
+      </out> 
+   </t:template>
+</t:transform>