1

I need to validate some xml files in the resources of an Android application against an XML Schema. Although there is an available API to create instances of SchemaFactory, there seems to be no implementation for XML Schema, as stated by the answers to these questions: 1, 2 and 3.

Are there any good and lightweight libraries to provide that functionality in the Android platform?

Community
  • 1
  • 1
Joao Azevedo
  • 207
  • 1
  • 7

1 Answers1

0

Try Lycia. Its around 270 kb. Here is nice step by step example for schema validation. It creates a schema, a small XML referring to schema (via schemaLocation) and then an example to parse the xml with schema validation

Santosh
  • 17,667
  • 4
  • 54
  • 79
  • Do you know if it's possible to explicitly validate a document against a specified XSD? I only seem to be able to do it through a validation aware parser, similar to the one in the example you provided. – Joao Azevedo Sep 22 '11 at 15:17
  • Can you please elaborate your particular use case ? – Santosh Sep 23 '11 at 08:54
  • I want to, given as input an XML and an XSD file, output a boolean stating whether the XML files validates against the given XML schema or not. – Joao Azevedo Sep 23 '11 at 10:35
  • I am trying something, will post I succeed :). – Santosh Sep 23 '11 at 16:26