Re: [Simple-support] How do you serialize an object as an attribute?
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2011-09-12 03:26:31
|
Use a Transform, they are for this very purpose. --- On Tue, 6/9/11, James Oltmans <Jam...@ip...> wrote: From: James Oltmans <Jam...@ip...> Subject: [Simple-support] How do you serialize an object as an attribute? To: "sim...@li..." <sim...@li...> Received: Tuesday, 6 September, 2011, 3:16 PM Let’s say I have an object (ID). ID:- Number- VersionThis can be easily expressed as a simple string in the format <number>-<version> e.g. 1234-1In most cases I’d like to express this as an attribute for other xml elements (id=”1234-1”)However, it’s currently in element format.e.g. <ID number=”1234” version=”1”> How do I get this annotated to read into and out of another object’s element’s attribute?e.g.<someOtherObject attribute1=”blah blah” id=”1234-1”/> To make this request more complicated, let’s say I want to preserve some backwards compatibility and be able to deserialize the old element based XML, how would I do that? Can I serialize the ID as an element in some cases where it is specified as an @Element in one including object or as an attribute in another including object where it is annotated as @Attribute there? Thanks! -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Malware Security Report: Protecting Your Business, Customers, and the Bottom Line. Protect your business and customers by understanding the threat from malware and how it can impact your online business. http://www.accelacomm.com/jaw/sfnl/114/51427462/ -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |