Hi Jonas, So you want to bind to different objects, depending on the actual value in an element. The only way I can suggest to handle that is by using a custom marshaller/unmarshaller for this structure. It'd need to parse past the <object> start tag and get the <type> element contents in order to know what type of object to create for the value.
You can find out the basics of custom marshaller/unmarshallers at http://jibx.sourceforge.net/tutorial/binding-custom.html#marunmar - Dennis Dennis M. Sosnoski SOA, Web Services, and XML Training and Consulting http://www.sosnoski.com - http://www.sosnoski.co.nz Seattle, WA +1-425-296-6194 - Wellington, NZ +64-4-298-6117 bill vezÿffffe9 wrote: > hi all, > I'm new to JiBX, and I'm not sure how to solve my problem. I didn't > find any answer in the mailing list. Here's the point: > I got an XML structure like this > <object> > <type>type1</type> > <value>val</value> > </object> > <object> > <type>type2</type> > <value>value</value> > </object> > > an i need to bind this to one of these classes according to the > element value of type > > type1 -> Foo > type2 -> Bar > > Is there a straight method to do that with JiBX in the binding > definition ? > is someone can show me an xml binding structure that solve this case > > thanks for your help > > Jonas > > > > > > ------------------------------------------------------------------------ > Lèche-vitrine ou lèche-écran ? *Yahoo! Magasinage* > <http://cf.shopping.yahoo.com>. > ------------------------------------------------------------------------ > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > ------------------------------------------------------------------------ > > _______________________________________________ > jibx-users mailing list > jibx-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jibx-users > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users