Bug #4600


xsl:output with parameter document using method="adaptive" and character maps goes into infinite recursion

Added by Michael Kay about 2 years ago. Updated over 1 year ago.

Start date:
Due date:
% Done:


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


Test case output-0721 created in XSLT3 test suite

Actions #1

Updated by Michael Kay about 2 years ago

  • Status changed from New to In Progress

The code at SerializerFactory#210 under if (paramDoc != null) { creates a new Properties object on top of the existing properties object and then copies all the properties from the parameter document into the new Properties object.

This properties object then goes to the Adaptive output method. When the adaptive output method is called upon to serialize a node, it obtains a new serializer for this node by calling the SerializerFactory, having layered yet another Properties object, this time with method set to the json-node-output-method (I'm not sure why, because there's no JSON involved here...). We then call QueryResult.serialize with these new properties, and this goes back into the SerializerFactory, which notices that there is a parameter document referenced in the properties object, and reads it to create yet another layer on the Properties stack. Eventually the stack fills and we crash.

Somehow, once a parameter document has been read and applied to the Properties object, it needs to be removed from the Properties object so that it isn't processed again.

Actions #2

Updated by Michael Kay about 2 years ago

Solved the infinite recursion by removing the parameter-document property (actually, setting it to an empty string) when the parameter document is processed.

The spec for the adaptive output method says "A document, element, text, comment, or processing instruction node is serialized using the XML output method described in 5 XML Output Method." so we are wrong to be using the json-node-output-method here.

Actions #3

Updated by Michael Kay about 2 years ago

  • Status changed from In Progress to Resolved
  • Applies to branch 9.9 added
  • Fix Committed on Branch 10, 9.9 added
Actions #4

Updated by O'Neil Delpratt almost 2 years ago

  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 10.2 added

Bug fix applied in the Saxon 10.2 maintenance release.

Actions #5

Updated by O'Neil Delpratt over 1 year ago

  • Status changed from Resolved to Closed
  • Fixed in Maintenance Release added

Bug fix applied on the Saxon maintenance release.

Please register to edit this issue

Also available in: Atom PDF