Add variable test - Saxon-JS bug 3430
authordlockett <debbie@saxonica.com>
Wed, 06 Sep 2017 15:58:19 +0100
changeset 1754 49040b3db77c
parent 1753 11ea335f61ab
child 1766 d4e04498c9dd
Add variable test - Saxon-JS bug 3430
tests/decl/variable/_variable-test-set.xml
tests/decl/variable/variable-4801.xsl
--- a/tests/decl/variable/_variable-test-set.xml	Wed Aug 30 11:10:24 2017 +0100
+++ b/tests/decl/variable/_variable-test-set.xml	Wed Sep 06 15:58:19 2017 +0100
@@ -1848,4 +1848,21 @@
          <assert-xml><![CDATA[<out>the value of bar is bar</out>]]></assert-xml>
       </result>
    </test-case>
+   
+   <test-case name="variable-4801">
+      <description>Tests xsl:variable with select comparing untyped id()</description>
+      <created by="Debbie Lockett" on="2017-09-06"/>
+      <environment>
+         <source role="." file="variable-32.xml"/>
+      </environment>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="variable-4801.xsl"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<out><e>id3</e><e>id6</e><e>id7</e><e>id12</e><e>id15</e><e>id19</e></out>]]></assert-xml>
+      </result>
+   </test-case>
 </test-set>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/variable/variable-4801.xsl	Wed Sep 06 15:58:19 2017 +0100
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+   
+   <?spec xslt#variables?>
+   <!-- Purpose: Tests xsl:variable with select comparing untyped id() -->
+   
+   <xsl:output method="xml" encoding="UTF-8" indent="no"/>
+   
+   <xsl:template match="/">
+      <out>
+         <xsl:apply-templates/>
+      </out>
+   </xsl:template>
+   
+   <xsl:template match="doc[@id='id0']">
+      <xsl:variable name="p1" select="'id2'"/>
+      <xsl:variable name="p2"
+         select="'id4','id5','id8','id10','id11','id13','id14','id17'" />
+      <xsl:variable name="p3" select="'id1','id9','id16','id18'"/>
+      <xsl:variable name="p4" select=".//*[not(@id = ($p1, $p2, $p3))]/@id"/>
+      <xsl:for-each select="$p4">
+         <e>
+            <xsl:value-of select="."/>
+         </e>
+      </xsl:for-each>
+   </xsl:template>
+   
+</xsl:stylesheet>
\ No newline at end of file