I don't think JiBX's functionality extends to finding out what the root element is. This kind of thing is already handled well by apis such as SAX, DOM, or XMLPull. JiBX is a marshaller/unmarshaller and its really fast and great at what it does. But if you want to find out the root element of an object, you have a vast, huge, extensive number of ways to do it using XML APIs, and after that use JiBX to (un)marshal.

Peace
C


Pascal Dimassimo wrote:

I notice from the usage documentation on the jibx site that in order to unmarshall a xml document into a object, I need to know in advance what the type of the object is:

IBindingFactory bfact =
        BindingDirectory.getFactory(Customer.class);
IUnmarshallingContext uctx =
        bfact.createUnmarshallingContext();
Object obj = uctx.unmarshalDocument(
        new FileInputStream("filename.xml"), null);


What if I don't know that "filename.xml" is actually holding a Customer object? Is there a way to make jibx look in the mapping automatically to find which object the root element of "filename.xml" is refering to?


Thanks


-- _________________________________________ < __ __ ____ > < | | \/ ___\ Chris Hill > < | | / /_/ > [EMAIL PROTECTED] > < |____/\___ / http://ubergeek.tv > < /_____/ The Smell of Geek! > <----------------------------------------->



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
jibx-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to