Hi Rajan,

The Xsd2Jibx code is outdated, and does not generate either code or 
bindings that make use of the features added to JiBX over the last 2-3 
years. JiBX does include choice support, using a choice='true' attribute 
on the <mapping> and <structure> elements, but as of now there's no way 
to get generated bindings that use this option.

A replacement for Xsd2Jibx is in the works, and I hope to have a 
preliminary version out in May.

  - 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



Rajan Desai wrote:
> Hi All,
>
> I am stumped and stuck with the JiBX handling of xsd:choice elements.
> Here is my schema:
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema targetNamespace="http://www.test.com/testapp"; 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
> xmlns:ogp="http://www.test.com/testapp";>
>
>     <xsd:element name="root">
>         <xsd:complexType>
>             <xsd:choice>
>                 <xsd:element ref="ogp:mainApp" minOccurs="1" 
> maxOccurs="1" />
>                 <xsd:element name="statusInfo" maxOccurs="1" 
> minOccurs="1" />
>             </xsd:choice>
>             <xsd:attribute ref="ogp:ver"></xsd:attribute>
>         </xsd:complexType>
>     </xsd:element>
>
>     <xsd:element name="mainApp">
>         <xsd:complexType>
>             <xsd:sequence>
>                 <xsd:element name="appinfo" maxOccurs="1" minOccurs="0" />
>                 <xsd:choice>
>                     <xsd:sequence>
>                                 <xsd:element name="op2" maxOccurs="1" 
> minOccurs="0" />
>                                 <xsd:element name="op1" maxOccurs="1" 
> minOccurs="0" />
>                     </xsd:sequence>
>                     <xsd:element name="receipt" maxOccurs="1" 
> minOccurs="1" />   
>                 </xsd:choice>
>             </xsd:sequence>
>         </xsd:complexType>
>     </xsd:element>
>
>    
>     <xsd:element name="statusInfo">
>         <xsd:complexType>
>             <xsd:sequence>
>                 <xsd:element name="status" maxOccurs="1" minOccurs="1" />
>                         <xsd:element name="message" maxOccurs="1" 
> minOccurs="1" />
>             </xsd:sequence>
>         </xsd:complexType>
>     </xsd:element>
> </xsd:schema>
>
> And the binding generated by xsd2jibxis:
> <?xml version="1.0" encoding="UTF-8"?>
> <binding>
>   <mapping name="root" class="com.test.testapp.Root">
>     <namespace uri="http://www.test.com/testapp"; default="elements"/>
>     <structure field="mainApp" usage="optional" 
> map-as="com.test.testapp.MainApp"></structure>
>     <value name="statusInfo" field="statusInfo" usage="optional"/>
>     <value field="unknownSimpleStructureName" usage="optional" 
> style="attribute"/>
>   </mapping>
>   <mapping name="mainApp" class="com.test.testapp.MainApp">
>     <namespace uri="http://www.test.com/testapp"; default="elements"/>
>     <value name="appinfo" field="appinfo" usage="optional"/>
>     <value name="receipt" field="receipt" usage="optional"/>
>   </mapping>
>   <mapping name="statusInfo" class="com.test.testapp.StatusInfo">
>     <namespace uri="http://www.test.com/testapp"; default="elements"/>
>     <value name="status" field="status" usage="required"/>
>     <value name="message" field="message" usage="required"/>
>   </mapping>
> </binding>
>
> Now the generated binding doesn't support CHOICE at all (or does it?).
> I have no idea, how can I change it to support my schema above.
>
> Can somebody HELP? (SOS :)
>
> Thanks for your time,
> RD
>
> ------------------------------------------------------------------------
> Take a break and play crossword puzzles - FREE! Play Now! 
> <http://games.msn.com/en/flexicon/default.htm?icid=flexicon_%20wlmemailtaglinemarch07>
>  
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> 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
>   

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to