JDK-8114834 : LSSerializerImpl always serializes an entity reference node to" &entityName;" even if "entities" property is false
  • Type: Bug
  • Component: xml
  • Sub-Component: org.w3c.dom
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-06-17
  • Updated: 2017-01-03
  • Resolved: 2016-12-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b150Fixed
Related Reports
Relates :  
Description
In LSSerializer javadoc, it's written:
If the parameter "entities" is set to true, EntityReference nodes are serialized as an entity reference of the form " &entityName;" in the output. Child nodes (the expansion) of the entity reference are ignored. If the parameter "entities" is set to false, only the children of the entity reference are serialized.
 
But LSSerializerImpl always output " &entityName;" , I tested DOMSerializerImpl, it serialized node
     [element] tt
       [entity reference] ele
         [element] aa
           [element] bb
             [text] text
to " <tt><aa><bb>text</bb></aa></tt>" when lsSerializer.getDomConfig().setParameter("entities", Boolean.FALSE);
 
So I think LSSerializerImpl is incorrect.