Problem with special character parsing
843834Feb 14 2002 — edited Feb 22 2002Hi,
I have an app that creates a DOM structure that may contain some special character such as accent letters.
Then I transform the DOM structure to obtain a XML string.
Here is my code:
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.newDocument();
... contruction of the DOM ...
ByteArrayOutputStream os = new ByteArrayOutputStream();
StreamResult result = new StreamResult(os);
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer();
DOMSource source = new DOMSource(doc);
transformer.transform(source, result);
String XMLstring = os.toString();
My problem is that the special character in the XMLstring are not the same as in the DOM source.
How can I solve this problem?
PLEASE HELP!!!!!!!!!!!!
Thanks in advance