Project

Profile

Help

Bug #3584

closed

Streaming fallback for template rules should affect the whole mode or possibly the whole stylesheet

Added by Michael Kay almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Streaming
Sprint/Milestone:
-
Start date:
2017-12-29
Due date:
% Done:

100%

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

Description

When one template rule in a mode is found to be not streamable, and the STREAMING_FALLBACK configuration option is enabled, we are marking that particular template rule as non-streamable. This isn't going to work: once we've started streaming a document, we can't suddenly pass a streamed node to a template rule that does (say) preceding-sibling::node on it.

Test case: run Transform with options

-xsl:si-value-of-101.xsl -t -s:si-value-of-100.xml --streamingFallback:on

in XSLT30 test suite directory tests/strm/si-value-of

With -jit:off we get a hard XTSE3430 failure (after a fallback warning). With -jit:on we get a fallback warning and then a run-time NPE.

Actions #1

Updated by Michael Kay almost 7 years ago

  • Description updated (diff)
  • Category set to Streaming
  • Applies to branch 9.8, trunk added
Actions #2

Updated by Michael Kay almost 7 years ago

The options streamingFallback and jit are basically incompatible. If we use JIT compilation then we might not discover that a template rule is non-streamable until we're half way through processing the source document, and at this point we have streamable nodes (we haven't built a tree) so it's too late to switch to non-streaming. I think the simplest way to tackle this is that if streamingFallback has been requested, we ignore the request (and fail anyway) if a non-streamable template is found during JIT processing.

Actions #3

Updated by Michael Kay almost 7 years ago

In the case of xsl:source-document we need to change the strategy. Currently this compiles into different code depending on the value of the streamable attribute. If fallback to non-streaming is necessitated because some template rule is non-streamable, it may be too late to recompile the xsl;source-document instruction. It therefore needs to be able to make a run-time switch into non-streamed execution - which is probably a good thing anyway, because it means we can give better diagnostics.

Actions #4

Updated by Michael Kay almost 7 years ago

The changes here are starting to become sufficiently extensive that I think patching 9.8 to make this work is probably not a good idea. Instead I propose to fix the bug by dropping the feature (streaming fallback) on the 9.8 branch, and implementing it afresh on the development branch.

Actions #5

Updated by Michael Kay almost 7 years ago

  • Status changed from New to Resolved
  • Fix Committed on Branch 9.8, trunk added

For 9.9 I've implemented this and tested for a number of non-streamability conditions in the new test set streaming-fallback.

For 9.8 I've made cases that won't readily work (especially non-streamable template rules) no longer attempt fallback, with an explanation.

Actions #6

Updated by O'Neil Delpratt almost 7 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 9.8.0.8 added

Bug fix applied in the Saxon 9.8.0.8 maintenance release.

Please register to edit this issue

Also available in: Atom PDF