File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes JAXB 2.0 compiler Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "JAXB 2.0 compiler" Watch "JAXB 2.0 compiler" New topic

JAXB 2.0 compiler

Ranadhir Nag
Ranch Hand

Joined: Mar 09, 2006
Posts: 138
I am trying to use the JAXB 2.0 compiler to generate java classes for my schema.

But the compiler only seems to emit out the java classes for the types defined -and not the elements.
I believed that the xjc compiler emits out the elements as Impl classes.

The schema is as follows:
<xsd:schema xmlns:xsd="">
<xsd:element name="catalog" type="catalogType"/>
<xsd:complexType name="catalogType">
<xsd:element ref="journal" minOccurs="0" maxOccurs="unbounded"/>
<xsd:attribute name="section" type="xsd:string"/>
<xsd:attribute name="publisher" type="xsd:string"/>
<xsd:element name="journal" type="journalType"/>
<xsd:complexType name="journalType">
<xsd:element ref="article" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="article" type="articleType"/>
<xsd:complexType name="articleType">
<xsd:element name="title" type="xsd:string"/>
<xsd:element name="author" type="xsd:string"/>
<xsd:attribute name="level" type="xsd:string"/>
<xsd:attribute name="date" type="xsd:string"/>
chinna talluru

Joined: Jul 23, 2006
Posts: 24
true man. when i used jaxb2.0 recently i faced the same problem.
it didnt generated java class for simple element which is given below.

<xsd:element name="age" type="xsd:int"/> for this element i didnt get
java class. but in sun eg he is given the classs for the element.

still now i didnt get reason for that from this forum
I agree. Here's the link:
subject: JAXB 2.0 compiler
It's not a secret anymore!