I have an xsd (for basecamp xml) that contains
<xsd:complexType name="ProjectType">
<xsd:sequence>
<xsd:element name="announcement"
type="TypedNilableStringElementType"
maxOccurs="1"
minOccurs="1">
</xsd:element>
<xsd:element name="created-on"
type="TypedDateElementType"
maxOccurs="1"
minOccurs="1">
</xsd:element>
<xsd:element name="id"
type="TypedIntegerElementType"
maxOccurs="1"
minOccurs="1">
</xsd:element>
<xsd:element name="last-changed-on"
type="TypedDateTimeElementType"
maxOccurs="1"
minOccurs="1">
</xsd:element>
<xsd:element name="name"
type="xsd:string"
maxOccurs="1"
minOccurs="1">
</xsd:element>
<xsd:element name="show-announcement"
type="TypedBooleanElementType"
maxOccurs="1"
minOccurs="1">
</xsd:element>
<xsd:element name="show-writeboards"
type="TypedBooleanElementType"
maxOccurs="1"
minOccurs="1">
</xsd:element>
<xsd:element name="start-page"
type="xsd:string"
maxOccurs="1"
minOccurs="1">
</xsd:element>
<xsd:element name="status"
type="xsd:string"
maxOccurs="1"
minOccurs="1">
</xsd:element>
<xsd:element name="company"
type="SimpleCompanyType"
maxOccurs="1"
minOccurs="1">
</xsd:element>
</xsd:sequence>
</xsd:complexType>
and
<xsd:element name="project"
type="ProjectType">
</xsd:element>
I’m looking at http://java.sun.com/javaee/5/docs/tutorial/doc/bnbah.html and can’t understand what I’m doing differently from the sample schema in Table 17-13 where there is an element named purchaseOrder of type PurchaseOrderType. According to the tutorial, running xjc on the schema, one will get a PurchaseOrder.java interface and PurchaseOrderType.java interface.
When I run xjc on my schema I only get a ProjectType.java class, and when the xml actually consists of a single <project ...></project> element, this won’t parse because there is no Project.java class/interface to match.
Found the answer, finally (thanks google 🙂
http://weblogs.java.net/blog/kohsuke/archive/2006/03/why_does_jaxb_p.html