[jdom-interest] end-of-line character
Alex Chaffee
guru at edamame.stinky.com
Sun Jul 9 12:10:23 PDT 2000
On Fri, Jul 07, 2000 at 09:48:29AM -0400, Elliotte Rusty Harold wrote:
> At 1:11 AM -0700 7/6/00, Alex Chaffee wrote:
> >On Wed, Jul 05, 2000 at 01:06:11PM -0700, Jason Hunter wrote:
>
> >Let's make it an option. XMLOutputter should have a
> >"setLineEnding(String)" method; that should extract a char[] and stash
> >it in an instance var like the code I posted, for efficiency.
> >
>
> That's reasonable, though I'd prefer to store it as a string.
Yay! Now we're getting somewhere. Store it however you like; I vaguely
remember char[] being quicker to write() but I could be smoking crack.
Your reasoning about avoiding networking bugs makes perfect sense. As
long as it's settable, and as long as the setLineEnding() Javadoc
contains the following code, I withdraw my objections.
For reasons X,Y,Z (Rusty fill in here), XMLOutputter uses \r\n
by default. If you need a
different line-ending string, set it here. If you need to
output files conforming to the line-ending conventions of the
local operating system, use
outputter.setLineEnding(System.getProperty("line.separator")).
Heh, I just called English "code"... :-)
- Alex
--
Alex Chaffee mailto:alex at jguru.com
jGuru - Java News and FAQs http://www.jguru.com/alex/
Creator of Gamelan http://www.gamelan.com/
Founder of Purple Technology http://www.purpletech.com/
Curator of Stinky Art Collective http://www.stinky.com/
More information about the jdom-interest
mailing list