I have a Java program that is writing information from a database to an XML
file. I create a DOM document, add an element, and set the value with:
Element id=parent.createElement("EventRuleInputDefinition");
...
id.setAttribute("Value", getVal());
Later, I then go to write the Document
In the code snippet you've shown you're writing to a StringWriter. That is
a character stream which collects its output into a StringBuffer so you're
not actually writing UTF-8 byte sequences anywhere here. Perhaps there's
some conversion code (which you've haven't shown) which takes that String
Thanks for the response.
The missing piece is
return sw.toString();
I changed sw to be a ByteArrayOutputStream and it seemed to do the trick.
Thanks.
-Original Message-
From: Michael Glavassevich [mailto:mrgla...@ca.ibm.com]
Sent: Thursday, October 02, 2014 11:09 AM
To: j-us