You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2004/03/24 23:50:52 UTC

DO NOT REPLY [Bug 27924] New: - Entity Reference nodes with no children should always be serialized

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=27924>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=27924

Entity Reference nodes with no children should always be serialized 

           Summary: Entity Reference nodes with no children should always be
                    serialized
           Product: Xerces2-J
           Version: 2.6.2
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: DOM
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: nnissar@ca.ibm.com


DOM L/S PR clarification to LSSerializer states that "Entity Reference nodes 
with no children (no corresponding Entity node or the corresponding Entity 
nodes have no children) are always serialized." [1]

Currently, EntityReference nodes are serialized as an entity reference of the 
form "&entityName;" in the output only if the parameter 'entities' is set to 
true.  In the event that an Entity Reference node has no children 
and 'entities' is false, we break from the method without having serialized 
anything.

Proposed patch serializes the EntityReference node in the form "&entityName;" 
if 'entities' parameter is true or if the EntityReference has no children 
(checked by seeing if node.getFirstChild returns null - I think this should 
accurately cover the 'childless' scenario, or else we could check that 
node.getChildNodes().length()==0)

Also, minor PR change to LSSerializer.write:  When writing to a LSOutput, it 
may be required to look for encoding information by looking at 
Document.inputEncoding (was Document.actualEncoding)    [1]

[1] http://www.w3.org/2004/02/PR-DOM-Level-3-LS-20040227/load-save.html#LS-
LSSerializer

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org