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!

Problem with special character parsing

843834Feb 14 2002 — edited Feb 22 2002
Hi,

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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 22 2002
Added on Feb 14 2002
3 comments
80 views