GeeCON Prague 2014*
The moose likes XML and Related Technologies and the fly likes JAXB XML generation repeats super class attributes with each Subclass node 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 XML generation repeats super class attributes with each Subclass node" Watch "JAXB XML generation repeats super class attributes with each Subclass node" New topic
Author

JAXB XML generation repeats super class attributes with each Subclass node

Gyanendra Maurya
Greenhorn

Joined: Sep 28, 2009
Posts: 1

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>

 
GeeCON Prague 2014
 
subject: JAXB XML generation repeats super class attributes with each Subclass node