Project

Profile

Help

Maintenance. Planio will be undergoing a scheduled maintenance this weekend. Between Saturday, July 24 at 9:00 UTC and Sunday, July 25, 22:00 UTC your account might observe occasional downtimes which may last up to several minutes in some cases.

Bug #4760

Streaming from the command line doesn't work if the stylesheet is compiled to a SEF file

Added by Michael Kay 10 months ago. Updated 9 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Streaming
Sprint/Milestone:
-
Start date:
2020-09-28
Due date:
% Done:

100%

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

Description

When a transformation is invoked from the command line, with a source document and stylesheet, where the initial mode is a streamable mode, then if the stylesheet is supplied as a SEF file, the transformation runs, but doesn't use streaming: it produces the message

Warning 
  SXWN9000  The unnamed mode is streamable, but the input is not supplied as a stream

For more details see https://saxonica.plan.io/boards/3/topics/8001

History

#1 Updated by Michael Kay 10 months ago

When the stylesheet is supplied from source code, at Transform#1264 pss.getGlobalContextRequirement() returns null, so buildSourceTree is false; when it is supplied from a SEF file, it returns a non-null GlobalContextRequirement with absentFocus=false, so buildSourceTree is true.

#2 Updated by Michael Kay 10 months ago

The test case can be fixed by ensuring that PackageLoaderHE.readGlobalContext doesn't create a GlobalContextRequirement in the rebuilt package if there is no <glob/> entry in the SEF file.

It just remains to create a regression test...

#3 Updated by Michael Kay 10 months ago

Attempting to test this in a JUnit test, verifying that no warnings are output.

This encounters a different problem. If I set an initializer that calls Configuration.setLogger(), then Verifier fails with an NPE trying to display the license message. The license message is sent to config.getStandardErrorOutput(), which is null if a Logger has been set. The implication is that config.setLogger() simply doesn't work. At any rate, the relationship of config.setStandardErrorOutput() and config.setLogger() is complex and poorly explained.

Tried getting around this by making the Logger extend StandardErrorLogger, but that doesn't work either, because the ErrorReporter used by the run-time Controller doesn't use the Logger registered with the Configuration.

So I'm coming to the conclusion that when running from the command line, there's no way to redirect warnings to a destination other than System.err, which makes this test rather hard to write.

I found another way to write the test: register an Initializer which registers a SourceResolver; the SourceResolver detects that the supplied Source is an in-memory document tree rather than a stream. I'll raise a separate bug on the Logger issues.

#4 Updated by Michael Kay 10 months ago

  • Status changed from New to Resolved
  • Applies to branch 10, trunk added
  • Fix Committed on Branch 10, trunk added

Fixed.

#5 Updated by O'Neil Delpratt 9 months ago

Bug fix applied in the Saxon 10.3 maintenance release

#6 Updated by O'Neil Delpratt 9 months ago

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

Please register to edit this issue

Also available in: Atom PDF