Actions
Bug #4835
closedIllegalStateException: transform() with delivery-format=raw and xsl:result-document
Start date:
2020-11-21
Due date:
% Done:
100%
Estimated time:
Legacy ID:
Applies to branch:
10, trunk
Fix Committed on Branch:
10, trunk
Fixed in Maintenance Release:
Platforms:
Description
delivery-format
option in compiled.xsl
and xsl:result-document
in tested.xsl
do not seem to work side by side.
$ cat compiled.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet exclude-result-prefixes="#all" version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template name="xsl:initial-template">
<xsl:variable as="map(*)" name="transform-options">
<xsl:map>
<xsl:map-entry key="'delivery-format'" select="'raw'" />
<xsl:map-entry key="'stylesheet-location'">tested.xsl</xsl:map-entry>
<xsl:map-entry key="'initial-template'"
select="QName('http://www.w3.org/1999/XSL/Transform', 'xsl:initial-template')" />
</xsl:map>
</xsl:variable>
<xsl:sequence select="transform($transform-options)?output" />
</xsl:template>
</xsl:stylesheet>
$ cat tested.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet exclude-result-prefixes="#all" version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template as="element(a)" name="xsl:initial-template">
<xsl:result-document href="out.xml">
<out />
</xsl:result-document>
<a />
</xsl:template>
</xsl:stylesheet>
$ java -jar saxon-he-10.3.jar -xsl:compiled.xsl -it
java.lang.IllegalStateException: The result sequence has not yet been closed
at net.sf.saxon.s9api.RawDestination.getXdmValue(RawDestination.java:84)
at net.sf.saxon.functions.TransformFn$RawDeliverer.lambda$resolve$0(TransformFn.java:1187)
at net.sf.saxon.event.CloseNotifier.close(CloseNotifier.java:40)
at net.sf.saxon.event.ProxyReceiver.close(ProxyReceiver.java:103)
at net.sf.saxon.event.ComplexContentOutputter.close(ComplexContentOutputter.java:710)
at net.sf.saxon.expr.instruct.ResultDocument.processInstruction(ResultDocument.java:413)
at net.sf.saxon.Configuration.processResultDocument(Configuration.java:2351)
at net.sf.saxon.expr.instruct.ResultDocument.process(ResultDocument.java:385)
at net.sf.saxon.expr.instruct.ResultDocument.processLeavingTail(ResultDocument.java:379)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:752)
at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
at net.sf.saxon.expr.CardinalityChecker.process(CardinalityChecker.java:326)
at net.sf.saxon.expr.instruct.NamedTemplate.expand(NamedTemplate.java:266)
at net.sf.saxon.trans.XsltController.callTemplate(XsltController.java:850)
at net.sf.saxon.s9api.Xslt30Transformer.callTemplate(Xslt30Transformer.java:480)
at net.sf.saxon.functions.TransformFn.call(TransformFn.java:784)
at net.sf.saxon.expr.FunctionCall.iterate(FunctionCall.java:548)
at net.sf.saxon.expr.Expression.evaluateItem(Expression.java:852)
at net.sf.saxon.expr.LookupExpression.iterate(LookupExpression.java:337)
at net.sf.saxon.expr.Expression.process(Expression.java:949)
at net.sf.saxon.expr.instruct.NamedTemplate.expand(NamedTemplate.java:266)
at net.sf.saxon.trans.XsltController.callTemplate(XsltController.java:850)
at net.sf.saxon.s9api.Xslt30Transformer.callTemplate(Xslt30Transformer.java:480)
at net.sf.saxon.Transform.processFile(Transform.java:1306)
at net.sf.saxon.Transform.doTransform(Transform.java:853)
at net.sf.saxon.Transform.main(Transform.java:82)
Fatal error during transformation: java.lang.IllegalStateException: The result sequence has not yet been closed
Updated by Michael Kay over 3 years ago
- Category set to XSLT conformance
- Status changed from New to In Progress
- Assignee set to Michael Kay
- Priority changed from Low to Normal
Reproduced as XSLT3 test case transform-008
Updated by Michael Kay over 3 years ago
- Status changed from In Progress to Resolved
- Applies to branch 10, trunk added
- Fix Committed on Branch 10, trunk added
Changed RawDeliverer to close the output destination on completion.
Updated by O'Neil Delpratt about 3 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 10.5 added
Bug fix applied to Saxon 10.5 maintenance release.
Please register to edit this issue
Actions