Hi Pawel, I can't access the schema to take a look, but you should be able to try this with the JiBX 1.2 beta 1 code, which includes a replacement for xsd2jibx. If you still have problems using 1.2 beta 1, please create a Jira and attach a project to recreate the problem.
- Dennis Dennis M. Sosnoski SOA and Web Services in Java Training and Consulting http://www.sosnoski.com - http://www.sosnoski.co.nz Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117 Duda, Pawel (NSN - PL/Wroclaw) wrote: > Hi, > > I have a following XML document: > > <?xml version="1.0" encoding="UTF-8" ?> > <taskConf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://pduda.com.pl taskConf.xsd" > xmlns="http://pduda.com.pl"> > <task xsi:type="softwareDownload" shortName="download"> > <gid>111</gid> > <p1>222</p1> > <p2>333</p2> > </task> > <task xsi:type="softwareUpload" shortName="upload"> > <gid>111</gid> > </task> > </taskConf> > > > I want to bind it as a TaskConf class with a list of tasks (abstract > Class). Each of the tasks would extend the abstract class to: > SoftwareUpload or SoftwareDownload classes. Of course, there are more. > I've tried it with many binding.xml's. Here's one generated by xsd2JiBX: > > <?xml version="1.0" encoding="UTF-8"?> > <binding> > <mapping name="task" class="pl.com.pduda.CoreTask"> > <namespace uri="http://pduda.com.pl" default="elements"/> > <value name="shortName" field="shortName" usage="optional" > style="attribute"/> > </mapping> > <mapping name="softwareUpload" class="pl.com.pduda.SoftwareUpload"> > <namespace uri="http://pduda.com.pl" default="elements"/> > <structure map-as="pl.com.pduda.CoreTask"/> > <value name="gid" field="gid" usage="required"/> > </mapping> > <mapping name="softwareDownload" > class="pl.com.pduda.SoftwareDownload"> > <namespace uri="http://pduda.com.pl" default="elements"/> > <structure map-as="pl.com.pduda.CoreTask"/> > <value name="gid" field="gid" usage="required"/> > <value name="p1" field="p1" usage="required"/> > <value name="p2" field="p2" usage="required"/> > </mapping> > <mapping name="taskConf" class="pl.com.pduda.TaskConf"> > <namespace uri="http://pduda.com.pl" default="elements"/> > <collection field="taskList"> > <structure map-as="pl.com.pduda.CoreTask"/> > </collection> > </mapping> > </binding> > > > Unfortunately it crashes at run-time: > > Exception in thread "main" org.jibx.runtime.JiBXException: Expected > "{http://pduda.com.pl}taskConf" end tag, found > "{http://pduda.com.pl}softwareDownload" start tag (line 5, col 42) > at > org.jibx.runtime.impl.UnmarshallingContext.parsePastCurrentEndTag(Unmars > hallingContext.java:800) > at > pl.com.pduda.JiBX_SWMGMT_testEJB_binding__jibxClasses_com_pl_pduda_bindi > ngTaskConf_access.unmarshal() > at > org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(Unmarshallin > gContext.java:2773) > at > org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(Unmarshalli > ngContext.java:2916) > at pl.com.pduda.main.StarterXML.main(StarterXML.java:73) > > > Any ideas on how to implement this? Thank you! > > > Kind regards, > Pawel Duda > > ------------------------- > Pawel Duda > mobile: +48 784 031 665 > e-mail: pawel.d...@nsn.com <mailto:pawel.d...@nsn.com> > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword > _______________________________________________ > jibx-users mailing list > jibx-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jibx-users > > ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com _______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users