[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: [jibx-users] Hot to instruct codegen to use ordered="false? sergio Thu Mar 29 01:00:53 2012

vitomeuli <vitomeuli <at> libero.it> writes:

> There's one case in which my ordered="false" attribute seems to have no
> effect.
> I have an XSD taken from OTA 2010B specs:
> http://old.nabble.com/file/p31789973/OTA_CommonTypes.xsd OTA_CommonTypes.xsd 
> The CustomerType is indeed a <xs:sequence>, so JiBX assumes correctly it
> contains elements in the specified order.
> Unfortunately the other party server ignores it, and sends messages in the
> wrong order.
> I've modified the JiBX generated mapping file:
> http://old.nabble.com/file/p31789973/org.ota.common.xml org.ota.common.xml 
> I added ordered="false", but I still get the same error:
> JiBX unmarshalling exception; nested exception is
> org.jibx.runtime.JiBXException: Expected
> "{http://www.opentravel.org/OTA/2003/05}Customer" end tag, found
> "{http://www.opentravel.org/OTA/2003/05}Email" start tag (line 79, col 17) 
> What can I do?
> Modify the schema setting <xs:all> in place of <xs:sequence>?
> Change position of the contained elements in the XSD?
> Why did it work in other cases, and not this time?
> Any suggestion is much appreciated
> Cheers
> Vito Meuli

I also faced this issue and I haven't found a solution from codegen. BUT... we 
can always run an automatic string replacement after the bindings are 
In my case, this is the plugin I've added after jibx's plugin:

                    <value><mapping ordered="false" allow-

This plugin runs right after codegen. And this is working fine to me and we can 
keep binding generation as part of the build process, without any manual 


This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
jibx-users mailing list