如何使用XStream对其进行序列化/反序列化,其中包含xml属性?

时间:2012-05-29 10:39:22

标签: xml serialization xstream

我正在使用XStream来序列化/反序列化Java Object。它是简单的pojo类,但它的属性也是xml。我如何序列化工作正常,但我无法反序列化。

示例:

public class Foo implements Serializable {

   .....
   String xmlProperty;
   ....
}

因为这个xmlProperty也是xml XStream无法反序列化它。 我收到的错误是:

Caused by: org.xml.sax.SAXParseException; lineNumber: 32; columnNumber: 25; The processing instruction target matching "[xX][mM][lL]" is not allowed.

0 个答案:

没有答案
相关问题