XML output file with Control M Characters
Hi,
I am using JDOM API 1.0 on Solaris platform.
Using the XMLOuputter I write the XML data to a file. But the XML file contains Control-M characters at the end of each line..like
<User>^M
<Name>Satish</Name>^M
<id>12567</id>^M
</User>^M
File f =new File(path,Constants.USER_XML);
Document doc = getDocument();
XMLOutputter out =new XMLOutputter();
out.setFormat(Format.getPrettyFormat());
Format outFormat = out.getFormat();
outFormat.setLineSeparator(System.getProperty("line.separator"));
outFormat.setIndent(" ");
try{
FileWriter fw =new FileWriter(f);
out.output(doc,fw);
}catch(IOException iox){}
I am not writing the Control-M characters. Also I am using the default encoding which is UTF-8. So how to avoid the control characters. Thanks in advance.
Regards,
Satish

