Android Studio - XML 序列化和 XML 针对 .xsd 模式的验证

Android Studio - XML Serialization and XML Validation against .xsd schema

我正在使用 Android 应用程序和 XML。 通过使用 Jaxb,我从 .xsd 文件中获得了 java xml 类。

我想从这些 xml 类 生成一个 xml 文件,然后根据 .xsd 文件进行验证。

我在这里找到了一个例子: http://www.mkyong.com/java/jaxb-hello-world-example/

但是我不能使用javax.xml.bind.Marshaller:

Error:(76, 27) error: cannot access XMLEventWriter
class file for javax.xml.stream.XMLEventWriter not found

然后我添加javax.xml.stream lib:

java.exe finished with non-zero exit value 1

我还发布了一个关于 xml 验证 xsd 的问题,但到目前为止我还没有得到任何建议:

对我有什么建议吗? 谢谢,

简答: XML 验证:android 的 xerces:https://code.google.com/p/xerces-for-android/source/checkout

XML连载:http://simple.sourceforge.net/

.xsd 到 java 个对象:Jaxb 或 Jibx

Is there a need in JAXB implementation for Android?