Project

Profile

Help

Is streaming not supported by SEF files?

Added by Martin Honnen about 4 years ago

I have run into an issue where it seems that my XSLT 3.0 code using streaming is running with streaming according to the -t output when I run the .xsl file; however, when I compile it with EE and run the generated .sef Saxon's -t output tells me it is building a tree:

Building tree for file:/C:/SomePath/SomeDir/./input1.xml using class net.sf.saxon.tree.tiny.TinyBuilder
Tree built in 5.1996ms
Tree size: 56 nodes, 467 characters, 5 attributes
Warning
  SXWN9000  The unnamed mode is streamable, but the input is not supplied as a stream

I first though that would only occur in a particular setting with a complex stylesheet but have it now reproduced with a simple test case. I have attached the tree files.

Compilation is done with java -jar 'C:\Program Files\Saxonica\SaxonEE10-2J\saxon-ee-10.2.jar' -t -nogo -export:sheet1.xsl.sef -xsl:.\sheet1.xsl -relocate:on -target:EE.

Execution with java -jar 'C:\Program Files\Saxonica\SaxonEE10-2J\saxon-ee-10.2.jar' -t -s:.\input1.xml -xsl:.\sheet1.xsl.sef which gives

Saxon-EE 10.2J from Saxonica
Java version 1.8.0_252
Using license serial number Vxxxxx
Stylesheet compilation time: 764.8114ms
Processing file:/C:/SomePath/SomeDir/./input1.xml
Using parser com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser
Building tree for file:/C:/SomePath/SomeDir/./input1.xml using class net.sf.saxon.tree.tiny.TinyBuilder
Tree built in 2.1816ms
Tree size: 56 nodes, 467 characters, 5 attributes
Warning
  SXWN9000  The unnamed mode is streamable, but the input is not supplied as a stream

Is streaming not supported by SEF files?


Replies (5)

Please register to reply

RE: Is streaming not supported by SEF files? - Added by Michael Kay about 4 years ago

The answer in the general case is that streaming is certainly possible with a stylesheet that has been exported to a SEF file. We run all our XSLT tests, including streaming tests, both with export=yes and export=no, where export=yes causes the test to be run from a SEF file.

What we perhaps don't test so thoroughly is use of a SEF file from the command line; I'll investigate that angle.

RE: Is streaming not supported by SEF files? - Added by Martin Honnen about 4 years ago

It seems that in the case of an SEF like the one I use the code https://saxonica.plan.io/projects/saxon/repository/he/revisions/master/entry/latest10/hej/net/sf/saxon/Transform.java#L1270 checking requirement.isAbsentFocus() gives false, therefore a tree is built.

No idea whether that logic is wrong or the export doesn't create the necessary element or attribute in the SEF.

RE: Is streaming not supported by SEF files? - Added by Martin Honnen about 4 years ago

If the XSLT code explicitly declares <xsl:global-context-item use="absent"/> then Saxon (tested with EE 10.2) puts a <glob use='pro'/> into the SEF on compilation and with that being present running the SEF from the command line uses streaming for the input.

Using <xsl:global-context-item use="optional"/> does not suffice, the the SEF has an element <glob use='opt'/> but the command line still infers or thinks it has to build a tree.

In all cases where the command line infers it has to build a tree the run-time however seems to be able to warn "SXWN9000 The unnamed mode is streamable, but the input is not supplied as a stream".

RE: Is streaming not supported by SEF files? - Added by Martin Honnen about 4 years ago

So what is the state on this, is the behaviour of the command line with not doing streaming with SEF files a quirk or bug in the Transform.java code or in the SEF file format?

    (1-5/5)

    Please register to reply