Wednesday, January 23, 2013

[android-developers] Re: Exception when calling SchemaFactory.newInstance on Android 4.0

It's a knowed issue posted by google at
http://code.google.com/p/android/issues/detail?id=7395

The solution is use Apache Xerces ported to Android. There is a proyect here
http://code.google.com/p/xerces-for-android/

You have to do a svn chekout and export the proyect to a jar file to use as a
library in your android proyect.

The code to instance SchemaFactory change a little. I show you an example:

import mf.javax.xml.validation.Schema;
import mf.javax.xml.validation.SchemaFactory;
import mf.javax.xml.validation.Validator;
import mf.org.apache.xerces.jaxp.validation.XMLSchemaFactory;


SchemaFactory factory = new XMLSchemaFactory();
Schema esquema = factory.newSchema(".../file.xsd");


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate