[jdom-interest] XMLOutputter and newlines after declaration/d octype

Elliotte Rusty Harold elharo at metalab.unc.edu
Wed Dec 18 20:09:25 PST 2002


At 1:00 AM +0100 12/19/02, Norrman Per wrote:

>I think Vadim is right. XMLOutputter#printDocType (and other methods)
>should respect the newLines flag. If I parse the document
>
><?xml version="1.0" ?><!DOCTYPE repository SYSTEM "repository.dtd"
>><repository/>
>
>it should not come back as
>
><?xml version="1.0" ?>
><!DOCTYPE repository SYSTEM "repository.dtd" >
><repository/>
>

That's a different issue. Parsers do not preserve white space in the 
prolog and you should not care whether JDOM does or not. A process 
that does care which is based on an XML parser is broken and needs to 
be fixed. THe only process of significance which is not based on an 
XML parser is human editing, and here JDOM does what is best for that 
case. I simply do not see any plausible reason to do anything 
differently.
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          XML in a  Nutshell, 2nd Edition (O'Reilly, 2002)          |
|              http://www.cafeconleche.org/books/xian2/              |
|  http://www.amazon.com/exec/obidos/ISBN%3D0596002920/cafeaulaitA/  |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
+----------------------------------+---------------------------------+



More information about the jdom-interest mailing list