users@jaxb.java.net

Re: No concrete java class generated for a global element that references a global type

From: Joe Fialli <Joseph.Fialli_at_Sun.COM>
Date: Tue, 31 Jan 2006 16:19:32 -0500

Dmitri Colebatch wrote:

>Hi all,
>
>I would swear that this has been asked in one way or another but I
>must be searching for the wrong things. I have a schema like this:
>
><xsd:schema
> targetNamespace="urn:missingRootElement"
> xmlns="urn:missingRootElement"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified">
>
> <xsd:complexType name="MyComplexType">
> <xsd:sequence>
> <xsd:element name="InnerString" type="xsd:string" maxOccurs="unbounded" />
> </xsd:sequence>
> </xsd:complexType>
>
> <xsd:element name="MyElement" type="MyComplexType" />
>
></xsd:schema>
>
>and when I run xjc over it all I get is:
>
>parsing a schema...
>compiling a schema...
>missingrootelement\MyComplexType.java
>missingrootelement\ObjectFactory.java
>missingrootelement\package-info.java
>
>ie - there's no MyElement class.
>
>I suppose I'm asking two questions:
>
>1. Is it possible to generate a MyElement class in the above example?
>2. What is the rationale behind not generating a MyElement class by default?
>
>
The short answer is to generate less classes by default.

Detailed rationale is explained in Section 5.6.3 in JAXB 2.0 Specification.
(https://jaxb.dev.java.net/spec-download.html)

-Joe

>cheers
>dim
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>
>