Android的XML验证使用XSD(包括Xerces和SchemaFactory的)错误 [英] Android XML validation using XSD ( both xerces and SchemaFactory) error

查看:560
本文介绍了Android的XML验证使用XSD(包括Xerces和SchemaFactory的)错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在,我使用的XSD有一些与PB XML验证。

Now, I'm having some pb with XML validation using XSD.

由于我使用的SchemaFactory:

Since I use SchemaFactory:

SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);

这给我:

Exception Ljava/lang/ExceptionInInitializerError; thrown while initializing Lorg/apache/xerces/impl/xs/SchemaGrammar;
Exception Ljava/lang/ExceptionInInitializerError; thrown while initializing Lorg/apache/xerces/impl/xs/XSConstraints;
java.lang.IllegalArgumentException: http://www.w3.org/2001/XMLSchema

然后我试图切换到Apache的Xerces和得到这个错误(因为要进口的Xerces):

Then I tried to switch to apache xerces and got this error (since importing xerces):

Error:Execution failed for task ':app:preDexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_31\bin\java.exe'' finished with non-zero exit value 1

我发现这些话题,但他们并没有帮助我:

I found these topics but they didn't help me:

验证(XSD)在Android的 XML

<一个href=\"http://stackoverflow.com/questions/10385914/xml-schema-conversion-issue-against-xsd-giving-illeagal-exception-in-android-app\">xml针对XSD架构转换的问题让Android应用程序Illeagal例外

<一个href=\"http://stackoverflow.com/questions/3129934/schemafactory-doesnt-support-w3c-xml-schema-in-platform-level-8\">SchemaFactory不支持在平台层面W3C XML模式8?

<一个href=\"http://stackoverflow.com/questions/28957412/why-java-exe-exit-with-value-1-in-android-studio\">why java.exe的出口与在Android Studio中值1

我使用的Andr​​oid 1.2.2工作室和一个是Android 4.4.2。
任何建议给我吗?谢谢,

I'm using Android Studio 1.2.2 and an Android 4.4.2. Any suggestion for me? Thanks,

推荐答案

简短的回答:针对Android的Xerces:的 HTTPS://$c$c.google.com/p/xerces-for-android/source/checkout

Short answer: xerces for android: https://code.google.com/p/xerces-for-android/source/checkout

这篇关于Android的XML验证使用XSD(包括Xerces和SchemaFactory的)错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆