[jdom-interest] Reordering elements for DTD compliance

Stephen Colebourne scolebournenews at hotmail.com
Fri Sep 14 07:26:11 PDT 2001


Hi,
I am looking for some help on JDOM interaction with DTDs on output.

In the system I work on, we add elements to the JDOM tree at various points 
in the program in any order. At the end we need to output the XML compliant 
with a DTD. I was expecting that

DocType dtype = new org.jdom.DocType("root", "file://mydtd.dtd");
Document doc = new Document( element, dtype );
ByteArrayOutputStream out = new ByteArrayOutputStream();
new XMLOutputter(" ", true).output(doc, out);
System.out.println(out.toString());

would format the output DTD in the correct order according to the specified 
DTD file. But it doesn't, an an examination of the source code suggests that 
its not supposed to.

Am I missing something obvious, or is JDOM not designed to reformat to a DTD 
on output?

Any help appreciated

Stephen Colebourne
UK



_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp




More information about the jdom-interest mailing list