Hi Marvin,

The problem is that your values are defined as global elements in the
schema. Since they're global elements, they need to be separate classes
by default (because they can actually be used as documents according to
the schema - that's the meaning of a global element).

This is a common pattern with a certain unfortunate schema style (named
"Garden of Eden" by its proponents, with no visible sense of irony).

I think you should be able to use Xsd2Jibx customizations to avoid the
class proliferation caused by this type of schema. Try using the
prefer-inline='true' customization
(http://jibx.sourceforge.net/fromschema/codegen-customs.html#prefer-inline)
combined with the includes='...' customization
(http://jibx.sourceforge.net/fromschema/codegen-customs.html#includes)
to specify the elements or types you want generated as separate classes.
It's been a while since I've worked with any schemas of this type,
though, so I might be off on the details.

  - Dennis

Dennis M. Sosnoski
Java SOA and Web Services Consulting <http://www.sosnoski.com/consult.html>
Axis2/CXF/Metro SOA and Web Services Training
<http://www.sosnoski.com/training.html>
Web Services Jump-Start <http://www.sosnoski.com/jumpstart.html>


On 03/02/2011 04:37 AM, Marvin Wolfthal wrote:
> Hi,
> Sorry if this is a newbie question, I'm a newbie. All my elements
> declared as xs:string are being generated as top-level classes.
>
> <xs:element name="PrimaryNamedInsuredFlag" type="xs:string"/>
>
> <xs:element name="CustomerRecord">
>         <xs:complexType>
>             <xs:sequence>
>                 <xs:element ref="PrimaryNamedInsuredFlag"/>
>                 . . .
>
> Is there a way to do this?
>
> class  CustomerRecord
> {
>     private String primaryNamedInsuredFlag;
>
>
>     String getPrimaryNamedInsuredFlag()
>     {
>         return primaryNamedInsured;
>
>
>
>
> ------------------------------------------------------------------------------
> Free Software Download: Index, Search & Analyze Logs and other IT data in 
> Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
> generated by your applications, servers and devices whether physical, virtual
> or in the cloud. Deliver compliance at lower cost and gain new business 
> insights. http://p.sf.net/sfu/splunk-dev2dev 
>
>
> _______________________________________________
> jibx-devs mailing list
> jibx-devs@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jibx-devs
>   
------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
jibx-devs mailing list
jibx-devs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-devs

Reply via email to