Project

Profile

Help

Bug #3201

closed

Identity Transformer does not pass unparsed entities through

Added by Michael Kay about 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
JAXP Java API
Sprint/Milestone:
-
Start date:
2017-04-13
Due date:
% Done:

100%

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

Description

See http://stackoverflow.com/questions/43387074/accessing-unparsed-entities-in-xslt-with-a-saxtransformerfactory-and-transformer

Saxon's JAXP identity transformer drops unparsed entities. It appears that the JDK version doesn't.

This can be fixed by adding simple implementations of setUnparsedEntity() to two classes: the ComplexContentOutputter, and the ContentHandlerProxy. It needs a little care, however. In the SAX interface, unparsed entity events are set to a DTDHandler, and in general we might expect that a DTDHandler won't know what to do with unparsed entity events if the rest of the DTD isn't being passed as well. Also the DTDHandler interface expects the notation name to be preserved, while the notation name of an unparsed entity is not included in XDM and therefore cannot be passed down the Saxon Receiver pipeline.

Passing unparsed entities through the identity transformer probably isn't enough to achieve compatibility with the JDK version, because it's quite possible that the JDK version retains the whole DTD, plus other things like CDATA sections.

I think we have a clean story though if (a) the identity transformer retains everything that is retained in XDM, and (b) we only emit unparsed entities if we know the recipient is a TransformerHandler, not a general DTDHandler.

Actions #1

Updated by Michael Kay about 7 years ago

  • Category set to JAXP Java API
  • Status changed from In Progress to Resolved
  • Assignee set to Michael Kay
  • Priority changed from Low to Normal
  • Applies to branch 9.7, 9.8 added
  • Fix Committed on Branch 9.7, 9.8 added
Actions #2

Updated by O'Neil Delpratt almost 7 years ago

  • Fix Committed on Branch trunk added
  • Fix Committed on Branch deleted (9.8)
Actions #3

Updated by O'Neil Delpratt almost 7 years ago

  • Applies to branch deleted (9.8)
Actions #4

Updated by O'Neil Delpratt almost 7 years ago

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

Bug fix applied in the 9.7.0.19 maintenance release.

Please register to edit this issue

Also available in: Atom PDF