users@jaxb.java.net

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

From: Dmitri Colebatch <colebatchd_at_gmail.com>
Date: Mon, 30 Jan 2006 17:14:38 +1100

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?

cheers
dim