Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Can i get the o/p XML with tab formating with javax.xml.transform.* ?

843834Sep 25 2002 — edited Mar 24 2003
My input Xml though tab formated after i run it through my code ..
using dom and filnally saves the file using the javax.xml.transform.*

the output XML file is onle line long file! My major problem is i'm not being able to "check in " into clearcase ..otherwise i wont be so bothered about the problem .Apart from me explicitly running it through a SAX parser and formatting it with \t and \n is there a neater/SIMPLER way?
TransformerFactory xformFactory = TransformerFactory.newInstance();
   Transformer transformer = xformFactory.newTransformer();
   FileOutputStream file = new FileOutputStream(fileName);

   transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM,dtd.getDtdFilePath());


   transformer.transform(new DOMSource(xmlDcument),new StreamResult(file));
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 21 2003
Added on Sep 25 2002
6 comments
244 views