This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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
Doubt from SCJP mock test
Question on Protected
Must subclass call constructor of super class
inheritence related questions in Java
Calling Superclass Methods and Forgetting to Use the Return Value