【问题标题】:Android Studio - XML Serialization and XML Validation against .xsd schemaAndroid Studio - 针对 .xsd 架构的 XML 序列化和 XML 验证
【发布时间】:2015-06-30 12:43:02
【问题描述】:

我正在使用 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 库:

java.exe finished with non-zero exit value 1

我还发布了一个关于针对 xsd 进行 xml 验证的问题,但到目前为止我还没有得到任何建议: Android XML validation using XSD ( both xerces and SchemaFactory) error

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

【问题讨论】:

标签: android xml serialization xsd jaxb


【解决方案1】:

简短回答: 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?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-20
    • 2011-10-12
    相关资源
    最近更新 更多