[jdom-interest] SAXBuilder adds a newline!? - False alarm.

MarkW markw at wilsoncom.de
Tue Jul 17 03:04:52 PDT 2001

> Sure. I think that it is actually XMLOutputter that may be changing your
> file. Look at the various setNewlines() and setLineSeparator() and the
> in XMLOutputter. If you read in a formatted XML file, you want to tell
> XMLOutputter to do no formatting on thy way out, or it will double up on
> line-feeds and the like.

> -Brett

If i read the formatted (with LF+CR) template files using SAXBuilder and
then try to parse them using DOM (not jdom!) i get errors because the number
of child-nodes DOM thinks it has are more than in reality due to newlines
added by SAXBuilder (XMLOutputter is not involved; i used XMLOutputter to
look at what was being read).
I´m gradually migrating from DOM to JDOM and so i´ve got a mix of both at
the moment. When i get round to switching from DOM to JDOM in that class
i´ll let you know if it works with formatted xml-input.


More information about the jdom-interest mailing list