• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAXB 2.0 compiler

 
Ranadhir Nag
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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="http://www.w3.org/2001/XMLSchema">
<xsd:element name="catalog" type="catalogType"/>
<xsd:complexType name="catalogType">
<xsd:sequence>
<xsd:element ref="journal" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="section" type="xsd:string"/>
<xsd:attribute name="publisher" type="xsd:string"/>
</xsd:complexType>
<xsd:element name="journal" type="journalType"/>
<xsd:complexType name="journalType">
<xsd:sequence>
<xsd:element ref="article" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="article" type="articleType"/>
<xsd:complexType name="articleType">
<xsd:sequence>
<xsd:element name="title" type="xsd:string"/>
<xsd:element name="author" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="level" type="xsd:string"/>
<xsd:attribute name="date" type="xsd:string"/>
</xsd:complexType>
</xsd:schema>
 
chinna talluru
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic