samedi 25 avril 2015

SimpleXML java staying in strict mode even if I use strict/required=false


I am trying to use SimpleXML in non strict mode but the only thing that seems to work is to put required=false on every single field. Using false in read or in @Root doesn't seem to turn off strict mode.

MyClass myclass = serializer.read(MyClass.class, new File(args[0]), false);

Results in..

org.simpleframework.xml.core.ValueRequiredException: Unable to satisfy @org.simpleframework.xml.Attribute(name=, required=true, empty=)

I am using SimpleXML java v2.7.1 under Java 1.8.

Any ideas why?


Aucun commentaire:

Enregistrer un commentaire