Project

Profile

Help

Bug #1997

Updated by O'Neil Delpratt about 10 years ago

Bug reported by user at http://sourceforge.net/p/saxon/support-requests/66/ 

 In the following example the output of $var564_resultof_filter[fn:exists($var565_cur/NonExistingElement)] is empty. 
 Therefore there is nothing to loop through. Although Saxon is evaluating the inner statement which fails on xs:dateTime function. $var565_cur/NonExistingElement is not available and fn:string will return an empty string. 

 The underneath exception: Invalid dateTime value "T12:00:00Z" (Non-numeric year component) is thrown. 

 Saxon (9.4.0.7) is evaluating code in a loop that not meant to be hit because there are no items in the collection. 

 <pre> 
 <xsl:for-each \<xsl:for-each select="$var564_resultof_filter[fn:exists($var565_cur/NonExistingElement)]"> 
 <ElementToGenerateForEachItemInLoop> \<ElementToGenerateForEachItemInLoop> 
 <xsl:sequence \<xsl:sequence select="xs:string(xs:dateTime(fn:concat(fn:string($var565_cur/NonExistingElement), 'T12:00:00Z')))"/> 
 </ElementToGenerateForEachItemInLoop> \</ElementToGenerateForEachItemInLoop> 
 </xsl:for-each> 
 </pre> \</xsl:for-each>

Back