You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Jared Graber <jg...@zedak.com> on 2006/11/13 21:21:14 UTC

[betwixt]Mapping the same object to 2 sets of XML

I need to write a large data structure out to XML and it has to follow an
existing schema.

The problem I am having is that there are multiple collections in the
structure that contain objects of the same class and they need to be output
differently based on which collection they are in.

 

For 1 of the lists, I can only output 2 of the properties of the object to
XML.

For another, I need to output 7 of the properties of the object to XML.

 

These objects are of the same class. 

 

How would I go about doing this?

 

-Jared


RE: [betwixt]Mapping the same object to 2 sets of XML

Posted by Jared Graber <jg...@zedak.com>.
I found that the nightly builds have support for option inheritance, but it
seems it only works for elements and not attributes so that's not a big
help.

I didn't see a way to do this, but overriding the OptionRule and Options
classes would enable me to add the functionality I need to properly
implement a SuppressionStrategy, but I don't see a way to do this without
changing the existing code.  

Any ideas would be helpful.

-Jared


-----Original Message-----
From: Jared Graber [mailto:jgraber@zedak.com] 
Sent: Monday, November 13, 2006 3:21 PM
To: 'Jakarta Commons Users List'
Subject: [betwixt]Mapping the same object to 2 sets of XML

I need to write a large data structure out to XML and it has to follow an
existing schema.

The problem I am having is that there are multiple collections in the
structure that contain objects of the same class and they need to be output
differently based on which collection they are in.

 

For 1 of the lists, I can only output 2 of the properties of the object to
XML.

For another, I need to output 7 of the properties of the object to XML.

 

These objects are of the same class. 

 

How would I go about doing this?

 

-Jared



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org