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 ji...@apache.org on 2004/04/12 23:23:49 UTC

[jira] Updated: (XERCERJ-347) setPreserveSpace(true) doesn't play nice with setIndenting(true)

The following issue has been updated:

    Updater: Serge Knystautas (mailto:sergek@lokitech.com)
       Date: Mon, 12 Apr 2004 2:22 PM
    Changes:
             Attachment changed from diff.txt
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://issues.apache.org/jira/browse/XERCERJ-347?page=history

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XERCERJ-347

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XERCERJ-347
    Summary: setPreserveSpace(true) doesn't play nice with setIndenting(true)
       Type: Bug

     Status: Open

    Project: Xerces2-J

   Assignee: Xerces-J Developers Mailing List
   Reporter: Ohmson

    Created: Tue, 11 Jun 2002 11:05 PM
    Updated: Mon, 12 Apr 2004 2:22 PM
Environment: Operating System: All
Platform: All

Description:
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>


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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