Hi, I'm working with XML file that contains HTML specials characters like "é".
I use XStream to build objects according to xml file, but I can't handle
this kind of stuff. This is my very simple code :
String stoxml = xstream.toXML("a < b");
System.out.println(stoxml);
System.out.println(xstream.fromXML(stoxml));
and it works fine :
<string>a < b</string>
a < b
but if my code is :
stoxml = xstream.toXML("é");
System.out.println(stoxml);
System.out.println(xstream.fromXML(stoxml));
it becomes weird, it prints :
<string>&eacute;</string>
é
and then if my xml file looks like :
<blog author="Guilh é rme Silveira">
<entry>
<title>first</title>
<description>My first blog entry.</description>
</entry>
<entry>
<title>tutorial</title>
<description>
Today we have developed a nice alias tutorial. Tell your
friends! NOW!
</description>
</entry>
</blog>
from your (modified) example, it raise an
com.thoughtworks.xstream.io.StreamException: : unresolved: é
(position:START_TAG <blog author='null'>@1:28 in
java.io.InputStreamReader@157fb52)
...
Have you an Idea ?
Thanks for your time and your help.
Regards
K.
signature.asc
Description: OpenPGP digital signature
