Android的架构验证 [英] Android schema validation

查看:96
本文介绍了Android的架构验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个 XML 和我有一个 XSD 文件,我要验证与此XML架构,我可以得到任何例子做。而且在那里我必须把XSD文件在我的项目,这样我可以用该模式验证。

I have created an XML and i am having an XSD file and i have to validate the xml with this schema ,can i get any example for doing that . And where i have to place the xsd file in my project so that i can validate with that schema.

推荐答案

检查的 http://developer.android.com/reference/javax/xml/validation/package-summary.html 。 根据该文件javax.xml.validation中,因为API级别8支持。

Check http://developer.android.com/reference/javax/xml/validation/package-summary.html. According to the documentation javax.xml.validation is supported since API level 8.

(我会测试和ASAP报告)

(I will test that and report asap)

- 更新 - 好吧,这个问题不是那么简单:的SchemaFactory厂= SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); 未能在两个级别8和9级的API与一个IllegalArgumentException中所描述 <一href="http://developer.android.com/reference/javax/xml/validation/SchemaFactory.html#newInstance(java.lang.String" rel="nofollow">http://developer.android.com/reference/javax/xml/validation/SchemaFactory.html#newInstance(java.lang.String

−− Update −− Ok, the problem is not that simple: SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); failed on both level 8 and level 9 API with an IllegalArgumentException as described in http://developer.android.com/reference/javax/xml/validation/SchemaFactory.html#newInstance(java.lang.String

谷歌没有就这一问题,除了帮助查找同样的故障报告。 该API是在这里,但不执行(默认)。

Google doesn't help on that matter except to find the very same failure report. The API is here but not the implementation (as default).

这篇关于Android的架构验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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