Android XML 使用 XSD 验证(xerces 和 SchemaFactory)错误
Android XML validation using XSD ( both xerces and SchemaFactory) error
现在,我正在使用 XSD.
进行一些带有 XML 验证的 pb
因为我使用了 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 以来):
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
我找到了这些主题,但它们对我没有帮助:
Validator (xsd) for xml in android
xml schema conversion issue against xsd giving Illeagal exception in android applications
SchemaFactory doesn't support W3C XML Schema in platform level 8?
why java.exe exit with value 1 in android studio
我正在使用 Android Studio 1.2.2 和 Android 4.4.2。
对我有什么建议吗?谢谢,
简答:android 的练习:https://code.google.com/p/xerces-for-android/source/checkout
现在,我正在使用 XSD.
进行一些带有 XML 验证的 pb因为我使用了 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 以来):
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
我找到了这些主题,但它们对我没有帮助:
Validator (xsd) for xml in android
xml schema conversion issue against xsd giving Illeagal exception in android applications
SchemaFactory doesn't support W3C XML Schema in platform level 8?
why java.exe exit with value 1 in android studio
我正在使用 Android Studio 1.2.2 和 Android 4.4.2。 对我有什么建议吗?谢谢,
简答:android 的练习:https://code.google.com/p/xerces-for-android/source/checkout