[jdom-interest] XMLOutputter and newlines afterdeclaration/doctype

Eric Rosenberg eric at computerwizards.com
Thu Dec 19 11:02:02 PST 2002


It sounds like the behavior of the XMLOutputter class contradicts the 
class javadoc.

 From the class javadoc:

Text Mode Resulting behavior.
/Default/ All content is printed in the format it was created, no 
whitespace or line separators are are added or removed.


and...
------------------------------------------------------------------------


      setNewlines

public void *setNewlines*(boolean newlines)

    Sets whether newlines (|lineSeparator|) should be printed.


*Parameters:*
    |newlines| - |true| indicates new lines should be printed, else new
lines are ignored (compacted).*See Also:*
    |setLineSeparator(String)|
<http://www.jdom.org/docs/apidocs/org/jdom/output/XMLOutputter.html#setLineSeparator%28java.lang.String%29>


Vadim's request to make the behavior of the class match what is 
specified in its javadoc seems reasonable to me. He's reason for wanting 
to do it is irrelevant. If the JDOM maintainers don't agree that the 
class should be changed then perhaps at least the javadoc should be 
corrected.

Eric Rosenberg




Vadim.Strizhevsky at morganstanley.com wrote:

>On Thu, 19 Dec 2002, Elliotte Rusty Harold wrote:
>
>  
>
>>At 11:37 AM -0500 12/19/02, <Vadim.Strizhevsky at morganstanley.com> wrote:
>>
>>    
>>
>>>1) Because its not valid XML as I desire to store multiple mesages in
>>>single file.
>>>      
>>>
>>Then JDOM won't help you. JDOM is about XML.
>>    
>>
>
>Yes, it is about XML, and should be. Therefore you should let me
>output XML the way I _want_ to. Don't worry about why I want to do that,
>that's my buseiness. If JDOM is a generic library and you already have all
>these customization options on XMLOutputter, what use are they if they
>don't provide full control. Or at least one that make sense, and not
>arbitrary done by the author who on behalf of the user makes the decision
>of what's best, by ignoring the request.
>
>  
>
>>>2) performance.
>>>      
>>>
>>You've done the testing necessary to prove that XML parsing is a problem?
>>    
>>
>
>Yes. XML parsing and XMLoutputer is number 1 performance bottlenecks. I've
>done some mods to XMLOuttpuer to increase performance even furhter. But
>this for a separate mail.
>
>  
>
>>Sounnds like you're trying to use XML like a database, always a mistake.
>>    
>>
>
>You're arguing about specific instance, but that's not the point, it
>should be upto me how I use it. I could store in DB, whatever, I'm just
>trying to get it on one line. That's not such a big requirement.
>
>  
>
>>>You present an argument of human readability. But in reality humans
>>>don't actually read XML that much in my world. They usually use tools to
>>>display the particular XML in custom/convinient way. However what
>>>happens more often is that various systems/programs pass XML between them
>>>over various media, (network, MQ, files, etc...) As far those system
>>>concerned they don't care what it looks like, but may care how much space
>>>it occupies. Yea 4bytes is not huge deal, but in principle you
>>>trying to represent xml as concisely as possible, but you just can't
>>>completely do it.
>>>
>>>      
>>>
>>That's your principle, not mine. Excessive worrying about size can be
>>just as damaging as excessive worrying about speed. Fact is, in
>>almost any application you're going to waste more on the empty space
>>in disk blocks or even network packets than you're talking about
>>saving.
>>    
>>
>
>True, so maybe that was a bad example. But my logical argument stands,
>which you removed and didn't address.
>
>Why do you all feel that it is such a big or unusual thing to ask for,
>to be able to produce XML with no white space or newlines? You already
>have API that is supposed to control this, but you arbitrarily decided
>to not observe it in one place. That just doesn't make any logical sense
>to me.
>
>I wonder was that behavior there from the very first version or was added
>later on someone's request for nicer look? without CVS I can't tell this.
>
>-Vadim
>
>
>_______________________________________________
>To control your jdom-interest membership:
>http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com
>
>.
>
>  
>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20021219/4eec2b59/attachment.htm


More information about the jdom-interest mailing list