Meaningless Drivel is fun!*
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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>

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAXB XML generation repeats super class attributes with each Subclass node
 
Similar Threads
inheritence related questions in Java
Question on Protected
Calling Superclass Methods and Forgetting to Use the Return Value
Doubt from SCJP mock test
Must subclass call constructor of super class