Hi Joshua

The trick is to use XMLWriter which allows you to specify how you want to
output the XML, with pretty printing, custom indentation size and so forth.
There are some examples of this in the quick start guide in the section
called 'Writing a document to a file'

http://dom4j.org/guide.html

Also note that the XMLWriter is capable of outputting whatever nodes you
want, you don't have to output the whole document. The write() method is
overloaded to take an Attribute, an Element and so on.

James
----- Original Message -----
From: "Joshua Paech" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 24, 2002 2:16 AM
Subject: [dom4j-user] Formatting of 'asXML()' result


> I want to print out particular dom4j Elements containing a few attributes
> plus some text. If I do an element.asXML(), the String returned is all one
> line. Is it possible to get newlines inserted between each attribute?
>
> _______________________________________________
> dom4j-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/dom4j-user


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to