• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAXB XML generation repeats super class attributes with each Subclass node

 
Gyanendra Maurya
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi ,
I am using JAXB to emit XML from a hierarchy of Java class.
It emits XML with each super class property with the subclass node.
But I want Super class properties only once.
For example I would like to have my XML look as-
<Superclass>
<SupClassProp1/>
<SupClassProp2/>

<Subclass>
<SubclassProp1>
<SubclassProp2>
</Subclass>

<Subclass>
<SubclassProp1>
<SubclassProp2>
</Subclass>
...
</Superclass>

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic