| From | Sent On | Attachments |
|---|---|---|
| Brett McLaughlin | Jun 19, 2000 2:46 pm | |
| Jason Hunter | Jun 19, 2000 4:07 pm | |
| Elliotte Rusty Harold | Jun 19, 2000 4:51 pm | |
| Elliotte Rusty Harold | Jun 19, 2000 6:48 pm | |
| Elliotte Rusty Harold | Jun 20, 2000 10:16 am | |
| Jason Hunter | Jun 20, 2000 11:45 am | |
| Thomas M. Sasala | Jun 20, 2000 1:01 pm | |
| Alex Chaffee | Jun 21, 2000 2:29 am | |
| Elliotte Rusty Harold | Jun 21, 2000 6:38 am | |
| Elliotte Rusty Harold | Jun 21, 2000 11:26 am | |
| Kevin Regan | Jun 21, 2000 11:27 am |
| Subject: | [jdom-interest] PrintWriter in XMLOutputter | |
|---|---|---|
| From: | Elliotte Rusty Harold (elh...@metalab.unc.edu) | |
| Date: | Jun 20, 2000 10:16:54 am | |
| List: | org.jdom.jdom-interest | |
I've uploaded a new version of XMLOutputter to
http://metalab.unc.edu/xml/jdom/XMLOutputter.java
This uses Writer instead of PrintWriter and doesn't suppress IOExceptions. I tested this against all the examples in my upcoming talk and it seemed to be bug-for-bug compatible with the old version.
The one open question in this version is what to use for a line separator. Right now I'm using \r\n since that's most cross-platform compatible and friendliest to various network protocols. However, \n alone might be slightly friendlier to XML parsers. Another possibility is to ask for System.getProperty("line.separator"). However, I'm loathe to make the output platform dependent. What do people think?
The value used is stored in a private field called newline so it's easy to change, if it turns out I've made the wrong choice here.
+-----------------------+------------------------+-------------------+ | Elliotte Rusty Harold | elh...@metalab.unc.edu | Writer/Programmer | +-----------------------+------------------------+-------------------+ | The XML Bible (IDG Books, 1999) | | http://metalab.unc.edu/xml/books/bible/ | | http://www.amazon.com/exec/obidos/ISBN=0764532367/cafeaulaitA/ | +----------------------------------+---------------------------------+ | Read Cafe au Lait for Java News: http://metalab.unc.edu/javafaq/ | | Read Cafe con Leche for XML News: http://metalab.unc.edu/xml/ | +----------------------------------+---------------------------------+





