Greg,

if using a java library is also an option, I can recommend dom4j (http://dom4j.org/index.html).
It has an XMLWriter, and an OutputFormat (both in package org.dom4j.io), which let you do pretty formatting.

best wishes,
Oti.

On 6/29/07, Moore, Greg <Greg_W_Moore@adp.com > wrote:
Hi

It was great to see RC1 out a few days ago. You guys that are doing the
development are wonderful. Thanks for your time and contributions.

A script that I'm writing gets a string back from a server. This string
happens to be xml and it can be quite lengthy (usually <2K). What I'd
like is something that would reflow/reformat this so it stayed a string
(or even a list) so this it would turn, the example below: (which really
is all one string.)

<Inquiry
Refdata="test"><DataType>Inquiry</DataType><Client><RefNum>9999969123961
856770WCZ</RefNum></Client></Inquiry>

Info something that was properly formatted and indented. Like this:

<Inquiry refdata="test">
<someTag>
  <DataType>Inquiry</DataType>
    <Client>
      <RefNum>9999969123961856770WCZ</RefNum>
     </Client>
  </sometag>
</Inquiry>

It doesn't need to be a sax, dom, or element tree structure. Nothing is
going to be done with this text except for being displayed and maybe
printed.

Any pointers, suggestions or code would be most appreciated.

Thanks in Advance,
Greg W. Moore
ADP, Inc.



This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users