Hi Wolle, I think the problem here is that you didn't specify any handling for the <sub1.1> element, so when JiBX sees this element while unmarshalling it assumes it's past the elements which were named in the binding - and since it hasn't seen a <sub1.2> yet it complains about that being missing. You should be able to just add a <structure name="sub1.1" usage="optional"/> to your binding (as another child of the <structure name="sub1" ordered="false"> element) to tell JiBX to discard the sub1.1 element if it sees one.
- 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 Wolf-Dieter Mische wrote: > Hello again, > > after my compiling problem is solved I have another one. > > I had following xml structure: > <root> > <sub1> > <sub1.1> > <element1.1>text1.1</element1.1> > <element1.2>text1.2</element1.2> > <element1.3>text1.3</element1.3> > </sub1.1> > <sub1.2> > <element2>text2</element2> > </sub1.2> > <sub1.3> > <element3>text3</element3> > </sub1.3> > </sub1> > </root> > No how have the binding file to, if I just want to unmarshall it into one > class like this: > public class root { > public String element2; > public String element3; > } > > I tried it with following binding.xml, but receiving this exception: > org.jibx.runtime.JiBXException: Missing required element "sub1.2" > > <binding> > <mapping name="root" class="org.domain.Root" ordered="false"> > <structure name="sub1" ordered="false"> > <structure name="sub1.2" ordered="false"> > <value name="element2" field="element2"/> > </structure> > <structure name="sub1.3" ordered="false"> > <value name="element3" field="element3"/> > </structure> > </structure> > </mapping> > </binding> > > Is it possible to map such a structure? > > > King regards > Wolle > > ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users