how to generate XML (in String representation) in java
Posted
by flyingfromchina
on Stack Overflow
See other posts from Stack Overflow
or by flyingfromchina
Published on 2010-06-11T15:33:48Z
Indexed on
2010/06/11
15:53 UTC
Read the original article
Hit count: 107
I have defined a java class, but only need to output some of the fields of this class into an XML. The returned type must be a String. I first opted for the easiest way using a StringBuffer. However, when I tried to process the output String represenation, it failed. I think it is mostly likely because there are some characters that are not encoded in the UTF-8 in the input. Could someone tell me what is the best way to handle this? Thanks.
© Stack Overflow or respective owner