New test case for array:insert-before
authorMichael Kay <mike@saxonica.com>
Wed, 27 Jun 2018 13:14:32 +0100
changeset 1866 314fbd0f5415
parent 1865 4b18c485f28b
child 1867 688a183e51e2
child 1868 3deaeb341727
New test case for array:insert-before
tests/type/arrays/_arrays-test-set.xml
tests/type/arrays/arrays-303.xsl
--- a/tests/type/arrays/_arrays-test-set.xml	Wed Jun 27 13:13:55 2018 +0100
+++ b/tests/type/arrays/_arrays-test-set.xml	Wed Jun 27 13:14:32 2018 +0100
@@ -806,5 +806,16 @@
          <assert>deep-equal(/out/element/@name/string(), ("a", "b", "c", "d"))</assert>
       </result>
    </test-case>
+   
+   <test-case name="arrays-303">
+      <description>Use array:insert-before (Saxon bug from T. Hata</description>
+      <created by="T. Hata via Michael Kay" on="2018-06-24"/>
+      <test>
+         <stylesheet file="arrays-303.xsl"/>
+      </test>
+      <result>
+         <assert>/out/@a = "1 2"</assert>
+      </result>
+   </test-case>
 
 </test-set>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/type/arrays/arrays-303.xsl	Wed Jun 27 13:14:32 2018 +0100
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet exclude-result-prefixes="#all" version="3.0"
+  xmlns:array="http://www.w3.org/2005/xpath-functions/array"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+  <xsl:template name="xsl:initial-template">
+    <xsl:variable as="xs:integer" name="m" select="[1]?1" />
+    <xsl:variable as="array(xs:integer)" name="a" select="array:insert-before([2], 1, $m)" />
+    <out a="{$a}"/>
+  </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file