XmlBeans

Résolu/Fermé
bourbia Messages postés 1 Date d'inscription lundi 17 août 2009 Statut Membre Dernière intervention 17 août 2009 - 17 août 2009 à 14:46
crapoulou Messages postés 28158 Date d'inscription mercredi 28 novembre 2007 Statut Modérateur, Contributeur sécurité Dernière intervention 16 avril 2024 - 4 févr. 2010 à 23:28
Bonjour,

I'm getting a problem using newIstance of SchemaTypeLoader.

Here is my code:

 
SchemaTypeLoader stl = XmlBeans.typeLoaderUnion( new SchemaTypeLoader[] 
             { x.y.MyPrefixEventNameDocument.type.getTypeSystem(), XmlBeans.getContextTypeLoader()} ) ; 

SchemaType st = stl.findDocumentType(new QName("","EventName","MyPrefix")); //I don't use namespace 

EventName evt = (MyPrefixEventNameDocument)stl.newInstance(st, null); 


The problem is that I have another class a.b.AnotherPrefixEventNameDocument (same root element in 2 XML buffers), so I'm getting this exception:

java.lang.ClassCastException: a.b.impl.AnotherPrefixEventNameDocumentImpl

Can you help please?? (I'd like to avoid using namespaces if possible :) )

Hamdi

1 réponse

crapoulou Messages postés 28158 Date d'inscription mercredi 28 novembre 2007 Statut Modérateur, Contributeur sécurité Dernière intervention 16 avril 2024 7 990
4 févr. 2010 à 23:28
Hi !
Here is a French forum !
= = = = =>>> HERE is englaish <<<= = = = =
1