XStream is a simple library to serialize objects to XML and back again.
The JSON outputted by XStream’s JsonHierarchialStreamDriver does not create JSON that is digestible by dojo. It creates brackets around some {“values”} without the corresponding key:. To remove these erroneous brackets, use this java code/regular expression:
XStream xs= new XStream(new JsonHierarchicalStreamDriver());
String erroneousJsonStr= xs.toXML(z);
Pattern pt= Pattern.compile("(\\{)(\\\β[^\\\β]+\\\β)([^:}]*)(\\})");
Matcher mt= pt.matcher(erroneousJsonStr);
String correctJsonStr= mt.replaceAll("$2");
xstream: del.icio.us/tag/xstream
Ajax
Java
xml
JavaScript
JSON
xstream
ΡΠ΅ΡΠΈΠ°Π»ΠΈΠ·Π°ΡΠΈΡ
Ajax
Java
xml
JavaScript
JSON
xstream
ΡΠ΅ΡΠΈΠ°Π»ΠΈΠ·Π°ΡΠΈΡ