Hi Tobias,

I would do this following way:

Document doc;
...
...
XMLSerializer serialier = new XMLSerializer ();
StringWriter writer = new StringWriter ();
serialier.setOutputCharStream (writer);
serialier.serialize (doc);
System.err.println (writer.toString());

Thanks,
Dmitry

-----Original Message-----
From: Tobias McNulty [mailto:[EMAIL PROTECTED]
Sent: Friday, November 30, 2001 12:15
To: [EMAIL PROTECTED]
Subject: RE: XML output of DOM


>Hi Tobias,
>
>You may try org.apache.xml.serialize.XMLSerializer class or if you use
>Xalan: org.apache.xalan.serialize.SerializerToXML. You may find a lot of
>utilities for serializing XML browsing these packages.
>
>Thanks,
>Dmitry
>

Hello,

Thank you for the quick response.  I visited the Xerces reference and 
looked over the API for XMLSerializer.  Unfortunately I am still not 
sure how to use it -- for instance, I do not know what types of 
OutputFormat methods may be used.

Would you happen to have a simple example handy of taking a Document 
object and converting it to an XML String?

Thanks,

Toby
-- 
Tobias McNulty
Data Description, Inc.
840 Hanshaw Road, Suite 9
Ithaca, NY 14850
Phone: (607) 257-1000
E-mail: [EMAIL PROTECTED]
Web: www.datadesk.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to