[jdom-interest] XMLOutputter extraspacing in reused Documents

Jon Baer jonbaer at digitalanywhere.com
Thu May 10 03:02:11 PDT 2001

Normally Ive used JDOM for outputting an XML stream without having to reuse the XML
document, but in something I just did I get extra returns in the previously built
Document between the Elements:

<?xml version="1.0"?>
<aiml version="1.0">


    <pattern>THIS IS TARGET * 1</pattern>

    <template>Sorry.  I don't know.</template>


  <pattern>THIS IS TARGET * 2</pattern>
  <template>Sorry.  I don't know.</template>

Using the latest build I beleive, any ideas?

- Jon


File file = new File(TARGETS_AIML);
   SAXBuilder builder = new SAXBuilder();
   Document doc = builder.build(file);
   XMLOutputter out = new XMLOutputter(" ", true);
   Element root = doc.getRootElement();

More information about the jdom-interest mailing list