Automated merge with bundle:/var/folders/zf/wthbvqt14q53jh5n3clx1yqw0000gn/T/SourceTreeTemp.s4yjqx
authorMichael Kay <mike@saxonica.com>
Tue, 11 Sep 2018 15:08:59 +0100
changeset 1893 6378e52dfdf2
parent 1890 7025b0468275 (current diff)
parent 1892 043fdfaa9c5c (diff)
child 1894 5aca602b9d58
Automated merge with bundle:/var/folders/zf/wthbvqt14q53jh5n3clx1yqw0000gn/T/SourceTreeTemp.s4yjqx
tests/insn/evaluate/_evaluate-test-set.xml
--- a/tests/insn/evaluate/_evaluate-test-set.xml	Fri Sep 07 13:50:03 2018 +0100
+++ b/tests/insn/evaluate/_evaluate-test-set.xml	Tue Sep 11 15:08:59 2018 +0100
@@ -819,4 +819,15 @@
          </any-of>       
       </result>
    </test-case>
+   
+   <test-case name="evaluate-049">
+      <description>Default collation for xsl:evaluate</description>
+      <created by="Michael Kay" on="2018-09-07"/>
+      <test>
+         <stylesheet file="evaluate-049.xsl"/>        
+      </test>
+      <result>
+         <assert>/out = 'true'</assert>
+      </result>
+   </test-case>
 </test-set>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/insn/evaluate/evaluate-049.xsl	Tue Sep 11 15:08:59 2018 +0100
@@ -0,0 +1,17 @@
+<?xml version="1.0"?> 
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0"
+  xmlns:my="http://www.example.com/my-functions" exclude-result-prefixes="my">
+
+  <!-- PURPOSE test xsl:evaluate uses the default collation -->
+
+
+  <xsl:param name="p">"XYZ" eq "xyz"</xsl:param>
+  
+  <xsl:template name="xsl:initial-template" default-collation="http://www.w3.org/2013/collation/UCA?strength=secondary">
+    <out>
+      <xsl:evaluate xpath="$p"/>
+    </out>
+  </xsl:template>
+
+ 
+</xsl:stylesheet>
--- a/tests/strm/si-apply-templates/_si-apply-templates-test-set.xml	Fri Sep 07 13:50:03 2018 +0100
+++ b/tests/strm/si-apply-templates/_si-apply-templates-test-set.xml	Tue Sep 11 15:08:59 2018 +0100
@@ -190,5 +190,41 @@
       </result>
    </test-case>
    
+   <test-case name="si-apply-templates-010">
+      <description>Large set of streamable template rules all matching text nodes. Saxon bug 3901, based on 
+         StackOverflow question 52259180 by user Jerome.</description>
+      <created by="Michael Kay" on="2018-09-10"/>
+      <environment>
+         <source role="." streaming="true" file="si-apply-templates-010.xml"/>
+      </environment>
+      <test>
+         <stylesheet file="si-apply-templates-010.xsl"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>//id = "10_ID"</assert>
+            <assert>//id = "9_ID"</assert>
+         </all-of>
+      </result>
+   </test-case>
+   
+   <test-case name="si-apply-templates-011">
+      <description>Large set of streamable template rules all matching text nodes. Same as -010, but with a much larger set of
+         template rules, most of which will never match anything.</description>
+      <created by="Michael Kay" on="2018-09-10"/>
+      <environment>
+         <source role="." streaming="true" file="si-apply-templates-010.xml"/>
+      </environment>
+      <test>
+         <stylesheet file="si-apply-templates-011.xsl"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>//id = "10_ID"</assert>
+            <assert>//id = "9_ID"</assert>
+         </all-of>
+      </result>
+   </test-case>
+   
 
 </test-set>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/si-apply-templates/si-apply-templates-010.xml	Tue Sep 11 15:08:59 2018 +0100
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<table>
+    <row>
+        <id>10</id>
+        <email>fake@fake.com</email>
+        <address>dsffe</address>
+        <birthday>10/2018</birthday>
+        <country>FR</country>
+        <external>zz</external>
+        <internal>ww</internal>
+        <name>Jean</name>
+        <phone>000000</phone>
+        <city>Dfegd</city>
+    </row>
+    <row>
+        <id>9</id>
+        <email>fake@fake2.com</email>
+        <address>sdfzefzef</address>
+        <birthday>11/2012</birthday>
+        <country>GB</country>
+        <external>xx</external>
+        <internal>yy</internal>
+        <name>Jean-Claude</name>
+        <phone>000000</phone>
+        <city>dd</city>
+    </row>
+</table>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/si-apply-templates/si-apply-templates-010.xsl	Tue Sep 11 15:08:59 2018 +0100
@@ -0,0 +1,40 @@
+<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+  <xsl:mode streamable="yes"/>
+  <xsl:output method="xml"/>
+  <xsl:template match="email/text()">
+    <xsl:value-of select="current()"/>
+  </xsl:template>
+  <xsl:template match="address/text()">
+    <xsl:value-of select="current()"/>
+  </xsl:template>
+  <xsl:template match="birthday/text()">
+    <xsl:value-of select="current()"/>
+  </xsl:template>
+  <xsl:template match="country/text()">
+    <xsl:value-of select="current()"/>
+  </xsl:template>
+  <xsl:template match="external/text()">
+    <xsl:value-of select="current()"/>
+  </xsl:template>
+  <xsl:template match="internal/text()">
+    <xsl:value-of select="current()"/>
+  </xsl:template>
+  <xsl:template match="name/text()">
+    <xsl:value-of select="current()"/>
+  </xsl:template>
+  <xsl:template match="phone/text()">
+    <xsl:value-of select="current()"/>
+  </xsl:template>
+  <xsl:template match="city/text()">
+    <xsl:value-of select="current()"/>
+  </xsl:template>
+  <xsl:template match="id/text()">
+    <xsl:value-of select="concat(current(), '_ID')"/>
+  </xsl:template>
+  <xsl:template match=".">
+    <xsl:copy validation="preserve">
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates select="node()"/>
+    </xsl:copy>
+  </xsl:template>
+</xsl:stylesheet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/si-apply-templates/si-apply-templates-011.xsl	Tue Sep 11 15:08:59 2018 +0100
@@ -0,0 +1,120 @@
+<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+  <xsl:mode streamable="yes"/>
+  <xsl:output method="xml"/>
+  
+  <!-- This test is designed to exercise implementations that attempt to be smarter in their
+    strategy for rule evaluation than simply testing each rule in turn. -->
+  
+  <xsl:template match="email/text()">
+    <xsl:value-of select="current()"/>
+  </xsl:template>
+  <xsl:template match="email/text()[. = 'abcde']"/>
+  <xsl:template match="email/text()[. = 'abcde2']"/>
+  <xsl:template match="email/text()[. = 'abcde3']"/>
+  <xsl:template match="email/text()[. = 'abcde4']"/>
+  <xsl:template match="email/text()[. = 'abcde5']"/>
+  <xsl:template match="email/text()[. = 'abcde6']"/>
+  
+  <xsl:template match="address/text()">
+    <xsl:value-of select="current()"/>
+  </xsl:template>
+  <xsl:template match="address/text()[. = 'abcde']"/>
+  <xsl:template match="address/text()[. = 'abcde2']"/>
+  <xsl:template match="address/text()[. = 'abcde3']"/>
+  <xsl:template match="address/text()[. = 'abcde4']"/>
+  <xsl:template match="address/text()[. = 'abcde5']"/>
+  <xsl:template match="address/text()[. = 'abcde6']"/>
+  <xsl:template match="address/text()[. = 'abcde7']"/>
+  
+  <xsl:template match="birthday/text()">
+    <xsl:value-of select="current()"/>
+  </xsl:template>
+  <xsl:template match="birthday/text()[. = 'abcde']"/>
+  <xsl:template match="birthday/text()[. = 'abcde2']"/>
+  <xsl:template match="birthday/text()[. = 'abcde3']"/>
+  <xsl:template match="birthday/text()[. = 'abcde4']"/>
+  <xsl:template match="birthday/text()[. = 'abcde5']"/>
+  <xsl:template match="birthday/text()[. = 'abcde6']"/>
+  <xsl:template match="birthday/text()[. = 'abcde7']"/>
+  
+  <xsl:template match="country/text()">
+    <xsl:value-of select="current()"/>
+  </xsl:template>
+  <xsl:template match="country/text()[. = 'abcde']"/>
+  <xsl:template match="country/text()[. = 'abcde2']"/>
+  <xsl:template match="country/text()[. = 'abcde3']"/>
+  <xsl:template match="country/text()[. = 'abcde4']"/>
+  <xsl:template match="country/text()[. = 'abcde5']"/>
+  <xsl:template match="country/text()[. = 'abcde6']"/>
+  <xsl:template match="country/text()[. = 'abcde7']"/>
+  <xsl:template match="country/text()[. = 'abcde8']"/>
+  
+  <xsl:template match="external/text()">
+    <xsl:value-of select="current()"/>
+  </xsl:template>
+  <xsl:template match="external/text()[. = 'abcde']"/>
+  <xsl:template match="external/text()[. = 'abcde2']"/>
+  <xsl:template match="external/text()[. = 'abcde3']"/>
+  <xsl:template match="external/text()[. = 'abcde4']"/>
+  <xsl:template match="external/text()[. = 'abcde5']"/>
+  <xsl:template match="external/text()[. = 'abcde6']"/>
+  
+  <xsl:template match="internal/text()">
+    <xsl:value-of select="current()"/>
+  </xsl:template>
+  <xsl:template match="internal/text()[. = 'abcde']"/>
+  <xsl:template match="internal/text()[. = 'abcde2']"/>
+  <xsl:template match="internal/text()[. = 'abcde3']"/>
+  <xsl:template match="internal/text()[. = 'abcde4']"/>
+  <xsl:template match="internal/text()[. = 'abcde5']"/>
+  <xsl:template match="internal/text()[. = 'abcde6']"/>
+  
+  <xsl:template match="name/text()">
+    <xsl:value-of select="current()"/>
+  </xsl:template>
+  <xsl:template match="name/text()[. = 'abcde']"/>
+  <xsl:template match="name/text()[. = 'abcde2']"/>
+  <xsl:template match="name/text()[. = 'abcde3']"/>
+  <xsl:template match="name/text()[. = 'abcde4']"/>
+  <xsl:template match="name/text()[. = 'abcde5']"/>
+  <xsl:template match="name/text()[. = 'abcde6']"/>
+  
+  <xsl:template match="phone/text()">
+    <xsl:value-of select="current()"/>
+  </xsl:template>
+  <xsl:template match="phone/text()[. = 'abcde']"/>
+  <xsl:template match="phone/text()[. = 'abcde2']"/>
+  <xsl:template match="phone/text()[. = 'abcde3']"/>
+  <xsl:template match="phone/text()[. = 'abcde4']"/>
+  <xsl:template match="phone/text()[. = 'abcde5']"/>
+  <xsl:template match="phone/text()[. = 'abcde6']"/>
+  
+  <xsl:template match="city/text()">
+    <xsl:value-of select="current()"/>
+  </xsl:template>
+  <xsl:template match="city/text()[. = 'abcde']"/>
+  <xsl:template match="city/text()[. = 'abcde2']"/>
+  <xsl:template match="city/text()[. = 'abcde3']"/>
+  <xsl:template match="city/text()[. = 'abcde4']"/>
+  <xsl:template match="city/text()[. = 'abcde5']"/>
+  <xsl:template match="city/text()[. = 'abcde6']"/>
+  
+  
+  <xsl:template match="id/text()">
+    <xsl:value-of select="concat(current(), '_ID')"/>
+  </xsl:template>
+  <xsl:template match="id/text()[. = 'abcde']"/>
+  <xsl:template match="id/text()[. = 'abcde2']"/>
+  <xsl:template match="id/text()[. = 'abcde3']"/>
+  <xsl:template match="id/text()[. = 'abcde4']"/>
+  <xsl:template match="id/text()[. = 'abcde5']"/>
+  <xsl:template match="id/text()[. = 'abcde6']"/>
+  
+  
+  <xsl:template match=".">
+    <xsl:copy validation="preserve">
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates select="node()"/>
+    </xsl:copy>
+  </xsl:template>
+</xsl:stylesheet>