Test xsl:number with large integers
authorMichael Kay <mike@saxonica.com>
Wed, 13 Jun 2018 12:36:14 +0100
changeset 1855 c36860b47510
parent 1854 34b81d40f96b
child 1856 067c1e8d801d
Test xsl:number with large integers
tests/insn/number/_number-test-set.xml
tests/insn/number/number-0111.xsl
--- a/tests/insn/number/_number-test-set.xml	Wed Jun 13 12:35:34 2018 +0100
+++ b/tests/insn/number/_number-test-set.xml	Wed Jun 13 12:36:14 2018 +0100
@@ -243,6 +243,20 @@
          <assert-xml><![CDATA[<out><n>1.1.1</n><n>1.1.2</n><n>1.1.3</n></out>]]></assert-xml>
       </result>
    </test-case>
+   
+   <test-case name="number-0111">
+      <description>Test xsl:number with large integers (XSLT 3.0)</description>
+      <created by="Michael Kay" on="2018-05-17"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="number-0111.xsl"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<out>[1:881676371:789154860:897069003(1:881676371:789154860:897069003)(١:٨٨١٦٧٦٣٧١:٧٨٩١٥٤٨٦٠:٨٩٧٠٦٩٠٠٣)]</out>]]></assert-xml>
+      </result>
+   </test-case>
 
    <test-case name="number-0201">
       <description></description>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/insn/number/number-0111.xsl	Wed Jun 13 12:36:14 2018 +0100
@@ -0,0 +1,17 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:math="http://www.w3.org/2005/xpath-functions/math"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    exclude-result-prefixes="#all"
+    version="3.0">
+    
+    <!-- xsl:number with large integers -->
+    
+    <xsl:template name="xsl:initial-template">
+        <xsl:variable name="big" select="1234567890"/>
+        <xsl:variable name="huge" select="$big * $big * $big"/>
+        <out>
+            <xsl:number value="(1 to 3)!($huge+.)" grouping-separator=":" grouping-size="9" start-at="3 2 1" format="[1(0)(&#x0660;)]"/>
+        </out>
+    </xsl:template>
+    
+</xsl:stylesheet>
\ No newline at end of file