users@jaxb.java.net

Re: Extensible soutions using JAXB?

From: Andrew Hughes <azza_at_lisasoft.com>
Date: Fri, 25 May 2007 11:40:53 +0930

Hi Ernst,

No, not ATOM... but an RSS format never the less (plus others). I must
confess that I don't really follow your explaination... are you
suggesting that I can write java class that can be used in conjunction
with JAXB to harvest all extension/unbound elements from the document? I
hope so, it sounds pretty cool! Could you please elaborate on my
assumptions and how this is done? I'm very interested.

Thanks for everyone replying to this thread.

--AH



Ernst, Matthias wrote:
>> I have asked this before and I'm still hunting a solution.... If an
>> unexpected element is added to the XML content, how can I use JAXB to
>> handle this?
>>
>
> Andrew,
>
> implementing Atom :-) ?
>
> You can annotate a field like this:
>
> @XmlAnyElement @XmlElementRef
> public List<Object> extensionElements;
>
> It will collect
> * known root elements (classes with @XmlRootElement) as unmarshalled
> objects (due to @XmlElementRef)
> * all other (unknown) elements as DOM nodes.
>
> Pretty neat IMHO.
>
> Matthias
>
>


-- 
Regards,
*Andrew Hughes*
Software Engineer
LISAsoft Pty. Ltd. (Adelaide)
------------------------------------------------------------------------
      LISAsoft Pty. Ltd.
<http://www.lisasoft.com>
*ADELAIDE Office*
<http://terrapages.net/mapbutton/RetrieveButtonServlet?buttonID=4>
38 Greenhill Road
Wayville SA 5034
Australia
*Telephone +61 8 8272 1555*
*Facsimile +61 8 8271 1199* 	
	*SYDNEY Office*
<http://terrapages.net/mapbutton/RetrieveButtonServlet?buttonID=1>
Suite 112 The Lower Deck
Jones Bay Wharf
19-21 Pirrama Road
Pyrmont NSW 2009 AUS
*Telephone +61 2 8570 5060*
*Facsimile +61 2 8570 5099* 	
	*MELBOURNE Office*
<http://terrapages.net/mapbutton/RetrieveButtonServlet?buttonID=3>
Level 7 520 Collins Street
Melbourne VIC 3000
Australia
*Telephone +61 3 9629 1799*
*Facsimile +61 3 9629 4955*
------------------------------------------------------------------------