Hi Mario, I'm afraid I didn't quite understand you. String or DOM interface are represenations of XML. They are used for different purposes. You don't need DOM to generate output as String, you need to traverse through XML nodes. But if you already have it you can obtain its text representation for any purpose you need using XMLSerializer. And you can use the same XMLSerializer to obtain text representation if you have SAX events as input.
Thanks, Dmitry -----Original Message----- From: Mario Rodriguez Villanea [mailto:[EMAIL PROTECTED] Sent: Monday, November 19, 2001 07:01 To: [EMAIL PROTECTED] Subject: XMLSerializer i've been wondering why must to use the XMLSerializer.serialize when i use DOM to generate the output as String please..help -----Original Message----- From: Voytenko, Dimitry [mailto:[EMAIL PROTECTED] Sent: Friday, November 16, 2001 4:14 PM To: '[EMAIL PROTECTED]' Subject: RE: Using GZipOutputStream with XMLSerializer Hi Salim, I used almost similar code many times and everything was OK. The only difference: I used SAX interfaces, instead of serializing DOM with XMLSerializer.serialize(Element). But it shouldn't make a difference. If below is your exact code, I think you just need to close the stream in the end, at least it defenetely should be done to avoid data loss. Thanks, Dmitry -----Original Message----- From: Salim Erradey [mailto:[EMAIL PROTECTED] Sent: Friday, November 16, 2001 13:23 To: [EMAIL PROTECTED] Subject: Using GZipOutputStream with XMLSerializer Hi, I have an issue with the size of XML files my application is generating, so I decided to write to a compressed file. I have tried using the GZipOutputStream with the org.apache.xml.serialize.XMLSerializer: GZIPOutputStream gzipOS = new GZIPOutputStream(new FileOutputStream(new File("xml.gz"))); XMLSerializer xmlSerializer = new XMLSerializer(gzipOS, outputFormat); xmlSerializer.asDOMSerializer(); xmlSerializer.serialize(document.getDocumentElement()); } I am getting an empty file with this. Do you know if it is possible ?, Has anyone tried this before ?. Feedback is greatly appreciated. Best Regards, Salim Erradey e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- 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]
