Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
Normally if you want to use < or > and other reserved charaters in xml
you need to use the 'special' replacements for it like < for < it whould be nice if xstream whould do this also. It seems this doesn't happen with a Map, i haven't tested it with other kind of objects.
Hi Wiebren,
XStream should automatically replace such characters with the XML equivalent.
For example:
Map map = new HashMap();
map.put("hello <", "world >");
String xml = xstream.toXml(map);
This results in:
<map>
<entry>
<string>hello <</string>
<string>world ></string>
</entry>
</map>
(I've just run this and it behaves as you would expect).
Could you post some sample code that demonstrates the problem you are having, or better still a failing JUnit test.
Additionally, please make sure you are using the latest version of XStream (1.1.1).
thanks
-Joe