Bug #30411, fix current-output-uri-016/017, current output URI is cleared upon dynamic function invocation and inside anonymous function bodies
authorabraaksm
Fri, 08 Mar 2019 16:45:49 +0100
changeset 2046 efd123cb8131
parent 2034 3ef14d11e09d
child 2047 fb9836ae6638
Bug #30411, fix current-output-uri-016/017, current output URI is cleared upon dynamic function invocation and inside anonymous function bodies
tests/fn/current-output-uri/_current-output-uri-test-set.xml
tests/fn/current-output-uri/current-output-uri-016.xsl
tests/fn/current-output-uri/current-output-uri-017.xsl
--- a/tests/fn/current-output-uri/_current-output-uri-test-set.xml	Wed Mar 06 17:41:52 2019 +0100
+++ b/tests/fn/current-output-uri/_current-output-uri-test-set.xml	Fri Mar 08 16:45:49 2019 +0100
@@ -222,28 +222,30 @@
    </test-case>
    
    <test-case name="current-output-uri-016">
-      <description>Test dynamic invocation of fn:current-output-uri</description>
+      <description>Test dynamic invocation of fn:current-output-uri, should return empty sequence</description>
       <created by="Abel Braaksma" on="2019-02-02"/>      
+      <modified by="Abel Braaksma" on="2019-03-08" change="Bug #30411, current output URI is cleared upon dynamic function invocation"/>
       <test>
          <stylesheet file="current-output-uri-016.xsl"/>
          <!-- sets the base output uri -->
          <output file="results/current-output-uri-016.xml"/>
       </test>
       <result>
-         <assert>ends-with(/out, 'results/current-output-uri-016.xml')</assert>
+         <assert>/out = 'current-output-uri-is-empty=true'</assert>
       </result>
    </test-case>
    
    <test-case name="current-output-uri-017">
       <description>Test fn:current-output-uri inside anonymous function body context</description>
       <created by="Abel Braaksma" on="2019-02-02"/>      
+      <modified by="Abel Braaksma" on="2019-03-08" change="Bug #30411, current output URI is cleared inside anonymous function bodies"/>
       <test>
          <stylesheet file="current-output-uri-017.xsl"/>
          <!-- sets the base output uri -->
          <output file="results/current-output-uri-017.xml"/>
       </test>
       <result>
-         <assert>ends-with(/out, 'results/current-output-uri-017.xml')</assert>
+         <assert>/out = 'current-output-uri-is-empty=true'</assert>
       </result>
    </test-case>
    
--- a/tests/fn/current-output-uri/current-output-uri-016.xsl	Wed Mar 06 17:41:52 2019 +0100
+++ b/tests/fn/current-output-uri/current-output-uri-016.xsl	Fri Mar 08 16:45:49 2019 +0100
@@ -6,7 +6,7 @@
     <xsl:variable name="outUri" select="current-output-uri#0" />    
   
     <xsl:template name="xsl:initial-template">
-        <out><xsl:value-of select="$outUri()"/></out>
+        <out>current-output-uri-is-empty=<xsl:value-of select="empty($outUri())"/></out>
     </xsl:template>
 
 </xsl:stylesheet>
--- a/tests/fn/current-output-uri/current-output-uri-017.xsl	Wed Mar 06 17:41:52 2019 +0100
+++ b/tests/fn/current-output-uri/current-output-uri-017.xsl	Fri Mar 08 16:45:49 2019 +0100
@@ -6,7 +6,7 @@
     <xsl:variable name="outUri" select="function() { current-output-uri() }" />    
   
     <xsl:template name="xsl:initial-template">
-        <out><xsl:value-of select="$outUri()"/></out>
+        <out>current-output-uri-is-empty=<xsl:value-of select="empty($outUri())"/></out>
     </xsl:template>
 
 </xsl:stylesheet>