Project

Profile

Help

Bug #2782

closed

saxon:next-in-chain fails on 9.7

Added by Michael Kay over 8 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Saxon extensions
Sprint/Milestone:
-
Start date:
2016-06-06
Due date:
% Done:

100%

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

Actions #1

Updated by Michael Kay over 8 years ago

Fails when run from command line with:

java.lang.NullPointerException

at com.saxonica.serialize.SerializerFactoryPE.prepareNextStylesheet(SerializerFactoryPE.java:207)

at net.sf.saxon.lib.SerializerFactory.getReceiver(SerializerFactory.java:161)

at net.sf.saxon.s9api.Serializer.getReceiver(Serializer.java:743)

at net.sf.saxon.s9api.Xslt30Transformer.getDestinationReceiver(Xslt30Transformer.java:910)

at net.sf.saxon.s9api.Xslt30Transformer.applyTemplates(Xslt30Transformer.java:551)

at net.sf.saxon.Transform.processFile(Transform.java:1245)

at net.sf.saxon.Transform.doTransform(Transform.java:797)

at net.sf.saxon.Transform.main(Transform.java:78)

Fails when using a s9api Xslt30Processor directly:

saxon:next-in-chain is ignored when using an Xslt30Transformer

Fails when using a s9api XsltProcessor:

output is the output of the first stylesheet, the saxon:next-in-chain attribute is ignored.

Succeeds when using JAXP

(Rather surprisingly, because JAXP uses the s9api Xslt30Transformer underneath).

Actions #2

Updated by Michael Kay over 8 years ago

This is proving quite troublesome as the feature really needs a complete redesign.

One difficulty is that it relies heavily on the transformation destination being a serializer; the logic for looking at the xsl:output parameters is all associated with serialization. This isn't a problem when running from the command line, but if the transformation is invoked via s9api interfaces, serialization is optional. I think I may have to document a constraint here.

I'm focussing at the moment on the use of next-in-chain to handle the primary transformation result; for this case the right place to do the work appears to be in the s9api layer, rather than deeper at the PreparedStylesheet/Controller level which is where it happens at the moment. The downside of this is (a) that this doesn't work so well for secondary output documents, and (b) it will have to be replicated for .NET.

Actions #3

Updated by Michael Kay over 8 years ago

  • Status changed from New to In Progress

I now have this working on the 9.7 branch for 4 test scenarios: command line, JAXP API, s9api XsltTransformer, and s9api Xslt30Transformer. The code changes were very simple; but the key thing is that I have confined it to cases where the output of the (composite) transformation is a serialized output stream. The previous complications were all caused by trying to get it working with other kinds of Destination, and we wlll therefore document this as a restriction.

TODO: convert the changes and retest on the 9.8 branch; test use with secondary output trees.

Actions #4

Updated by Michael Kay over 8 years ago

Now tested successfully (in all 4 scenarios) with secondary result documents as well as the principal result.

Actions #5

Updated by Michael Kay over 8 years ago

  • Status changed from In Progress to Resolved
  • Assignee set to Michael Kay
  • Applies to branch 9.8 added
  • Fix Committed on Branch 9.7, 9.8 added

Now patched and tested on the 9.7 and 9.8 branches.

Unit tests have been added.

Actions #6

Updated by O'Neil Delpratt over 8 years ago

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

Bug fixed in maintenance release 9.7.0.6.

Actions #7

Updated by O'Neil Delpratt over 7 years ago

  • Applies to branch trunk added
  • Applies to branch deleted (9.8)
Actions #8

Updated by O'Neil Delpratt over 7 years ago

  • Fix Committed on Branch trunk added
  • Fix Committed on Branch deleted (9.8)

Please register to edit this issue

Also available in: Atom PDF