Hi Cliff, Good suggestion. I've just added this "indent" property to DomRepresentation in SVN trunk. Its value is true by default. Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ <http://www.restlet.org/> http://www.restlet.org Noelios Technologies ~ Co-founder ~ <http://www.noelios.com> http://www.noelios.com
_____ De : Cliff Binstock [mailto:cliff.binst...@coyotereporting.com] Envoye : vendredi 6 fevrier 2009 00:40 A : discuss@restlet.tigris.org Objet : RE: DOM formatting Stephen, Thanks . for the input . still seems like it should be more trivial [ DomRepresentation#setIndent(boolean), perhaps ] Cliff Binstock Coyote Reporting _____ From: Stephen Groucutt [mailto:stephen.grouc...@gmail.com] Sent: Thursday, February 05, 2009 1:41 PM To: discuss@restlet.tigris.org Subject: Re: DOM formatting Hi, Have you considered subclassing DomRepresentation and overriding its createTransformer() method to set the output properties you want (in your case, OutputKeys.INDENT to yes)? I had a case where I had to modify some properties of the XML being produced, and I found that the easiest way to do it was to subclass the representation in this way. On Thu, Feb 5, 2009 at 4:12 PM, Cliff Binstock <cliff.binst...@coyotereporting.com> wrote: The DOMRepresentation, writes out the DOM as-is. Certainly this is great in most cases. However, it would be nice if there was "pretty-print" option that provided easy-to-look at XML. Of course, I can (and probably will) run the DOM through my own transformation to pretty-print, but it seems like use case might be a common desire. My current use case is building a Document with Elements, but no Text nodes, so the resultant XML is one unreadable line. If there is an existing trivial way to do this, great. If not, consider this a feature request. Thanks! Cliff Binstock Coyote Reporting ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1112206