5

In java there is class SchemaFactory which is used for schema validation but it is not available in android. Is there any other option available?

MysticMagicϡ
  • 28,593
  • 16
  • 73
  • 124
Sam97305421562
  • 3,027
  • 10
  • 35
  • 45

3 Answers3

1

So long as the SchemaFactory class requires no JNI code you can just import its .jar file into your Android project and use it directly.

Alnitak
  • 334,560
  • 70
  • 407
  • 495
1

There is currently no XSchema support in Android. This was true in version 1.0, and I just looked at the changes in 1.5 and no changes have been made to any of the xml packages, so it appears to me it's still true. I don't have the source > 1.0 though.

In the 1.0 source code there's the following comments in various parser classes:

// TODO No XSchema support in Android 1.0. Maybe later.

So you'll have to bundle your own classes or skip schema validation altogether for now. It's probably not a high priority feature for them.

JRL
  • 76,767
  • 18
  • 98
  • 146
0

You could try using the validator from the XML implementation directly. Either see if you can find the validator classes in whatever XML parser comes with Android, or use a standalone validator like MSV

millimoose
  • 39,073
  • 9
  • 82
  • 134