xerces-j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 9793] New: - setPreserveSpace(true) doesn't play nice with setIndenting(true)
Date Tue, 11 Jun 2002 23:05:32 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=9793>.
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=9793

setPreserveSpace(true) doesn't play nice with setIndenting(true)

           Summary: setPreserveSpace(true) doesn't play nice with
                    setIndenting(true)
           Product: Xerces2-J
           Version: 2.0.1
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Serialization
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: ohmson@netscape.net


I have a DOM tree that I create programmatically. Subsequently I use
org.apache.xml.serialize.XMLSerializer to write out the XML. I would like to
preserve all the different kind of whitespace in the XML document; so I use
setPreserveSpace() in org.apache.xml.serialize.OutputFormat.

 It works well when the identation is off. Here's some output:

<?xml version="1.0" encoding="UTF-8"?>
<content><string id="11">I love         you</string></content>

 (note that there is a couple of tabs in the string)

But when I turn the identation on, the output is ugly: line breaks are
introduced at seemingly random places in the elements, e.g. between 2
attributes. The string content is correctly output though:

<?xml version="1.0" encoding="UTF-8"?>
<content><string
   id="11">I love          you</string></content>


What I would like to see is

<?xml version="1.0" encoding="UTF-8"?>
<content>
   <string id="11">I love          you</string>
</content>

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


Mime
View raw message