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: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to