为Android XSD验证 [英] XSD validation for Android

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

问题描述

我需要验证传入的XML反对我在Android XSD。我第一次尝试JAXB,但发现我Darvik问题。现在我打算使用的SimpleXML。可以简单的处理验证?如果是的话怎么样?

I need to validate an incoming XML against my XSD on Android. I first tried JAXB but found I got Darvik issues. Now I'm planning to use SimpleXML. Can Simple handle validation? If so how?

另外,XSD将驻留的XML,而不是作为一个URL在设备上。

Also the XSD will reside on the device with the XML and not as a URL.

推荐答案

您可以在Adnroid内使用Xerces和原生架构验证(在Java中) - 你要下载的Xerces源和(一些简单的操作后),它包括你自己code - 你将能够使用DocumentBuilderFactory.setShema方法

You can use xerces and native schema validation (in java) in adnroid - you have to download xerces sources and (after some simple manipulations) include it to your own code - you will be able to use DocumentBuilderFactory.setShema method.

<一个href=\"http://stackoverflow.com/questions/13142567/xml-schema-validation-xmlsignature-with-xerces-in-android\">XML模式验证+的XMLSignature与Android的的Xerces

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

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