users@jaxb.java.net

Handeling Extensible Schemas with JAXB

From: Andrew Hughes <azza_at_lisasoft.com>
Date: Thu, 15 Feb 2007 08:08:36 +1030

Hi All,

The domain I am working with , uses schema's that are meant to be
extended. Consequently if the extensions do not have bindings, then "to
my knowledge" JAXB does not provide me with a usable solution?

For instance if I can create valid xml from my XSD:

   <Business>
       <Name official="The Code Factory Pty. Ltd."/>
   </Business>

But someone decides to extent the XML so it now contains a new element
called "<NameAlias>"

So its now:

   <Business>
       <Name official="The Code Factory Pty. Ltd.">
          <NameAlias alias="Code inc. Pty. Ltd./>
          <NameAlias alias="Code-Factory Pty. Ltd./>
       </Name>
   </Business>


In an ideal world this should be rejected told to please come back with
something that meets the specification... this is not reality however.

Most people like XML because they can customize it... they can add their
own data... and they can also ignore data.... Another problem is schema
versioning... some people change their schema's.. and some don't even
place version information to begin with.


How can JAXB handle these aspects of extensibility?



Thanks a heap for JAXB2!!!!!!!!! Verrrrry cool stuff!!!