xml-xalan-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 19591] New: - internal DTD subset incorrectly serialized
Date Fri, 02 May 2003 13:22:58 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19591>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19591

internal DTD subset incorrectly serialized

           Summary: internal DTD subset incorrectly serialized
           Product: XalanJ2
           Version: CurrentCVS
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: org.apache.xalan.serialize
        AssignedTo: xalan-dev@xml.apache.org
        ReportedBy: bruno@outerthought.org


If a document with an internal DTD subset is parsed and then serialized (without
XSL in between, pure SAX), the internal DTD subset written out before the <!DOCTYPE.

A bit strange since all code is there to support serializing internal DTD
subsets,  except for this one error.

Attached you'll find a small test file, the ouput of the serializer, and a small
testprogram to replicate the behaviour.

One additional finesse is that if you disable the declaration-handler, so that
only comments from the internal DTD subsets get through via the LexicalHandler,
the internal DTD subset will not be correctly opened (no [ will be written),
this is because the following code is missing in the comment() method in ToStream:
            if (m_inDoctype)
            {
                m_writer.write(" [");
                m_writer.write(m_lineSep, 0, m_lineSepLen);

                m_inDoctype = false;
            }

(which is the same as what's done in the other DeclHandler methods)

I have not yet looked into how this could be fixed, but it's probably a matter
of writing out the <![DOCTYPE during the startDTD event, instead of the endDTD
event.

Mime
View raw message