Project

Profile

Help

Bug #4600

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

Added by Michael Kay about 1 year ago. Updated 9 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Serialization
Sprint/Milestone:
-
Start date:
2020-06-17
Due date:
% Done:

100%

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

Description

Test case output-0721 created in XSLT3 test suite

History

#1 Updated by Michael Kay about 1 year 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.

#2 Updated by Michael Kay about 1 year 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.

#3 Updated by Michael Kay about 1 year ago

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

#4 Updated by O'Neil Delpratt 11 months ago

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

Bug fix applied in the Saxon 10.2 maintenance release.

#5 Updated by O'Neil Delpratt 9 months ago

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

Bug fix applied on the Saxon 9.9.1.8 maintenance release.

Please register to edit this issue

Also available in: Atom PDF