XML Creation using java translates CR in HTML Entity

I've got a pretty serious problem with XML Creation using standard java objects, my code is as follows:\[code\]//Generate DOMDOMSource source = this.generateDomDocument(params...);//WRITE XML FILETransformerFactory transformerFactory = TransformerFactory.newInstance();Transformer transformer = transformerFactory.newTransformer();//Propertiestransformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, STRING_FIELD_DTD);transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");transformer.setOutputProperty(OutputKeys.INDENT, "yes");//Convert and write to disktransformer.transform(source, new StreamResult( new OutputStreamWriter(new FileOutputStream(fileName), "UTF-8")));\[/code\]Problem is, the transformer is transforming Carriage Returns in \[code\]
\[/code\] entities which I should not have in the resulting XML. This is an example, I have a result file with translations written in several different languages (that's why I use UTF-8) and they are all the same when they contain CarriageReturns in the text:\[code\]<content langID="EN"> <desc> Test string
do not copy.</desc>\[/code\]To clear things up, this is what I expect in the XML:\[code\]<content langID="EN"> <desc> Test stringdo not copy.</desc>\[/code\]I looked up the issue on google and here too but there seems to be no solution or workaround.
 
Back
Top