Project

Profile

Help

Bug #5484

closed

Streaming with xsl:source-document: early exit

Added by Michael Kay over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Streaming
Sprint/Milestone:
-
Start date:
2022-05-11
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
11, trunk
Fix Committed on Branch:
11, trunk
Fixed in Maintenance Release:
Platforms:

Description

There are tests such as sx-intersect-021 that are annotated with early-exit-possible="true" where we are not in fact doing an early exit.

In this particular example, the code within the xsl:source-document instruction is statically reduced to <out>0</out> - it doesn't use any information from the source document at all. Perhaps that's not something that happens in real life very often, but we should handle it intelligently.

A complicating factor here is the possible presence of accumulators. I'm not sure how this works if we actually do an early exit. For example what happens with

<xsl:source-document href="in.xml">
  <xsl:if test="exists(*/item)">Gotcha!</xsl:if>
  <xsl:value-of select="accumulator-after('xxx')"/>
</xsl:source-document>

As far as I can see, the call on exists() is going to throw a QuitParsingException when it hits the first item and the xsl:source-document instruction is going to exit without evaluating the accumulator.

Need some test cases in this area...

Please register to edit this issue

Also available in: Atom PDF