handling metadata with multiple values

Matthew Graham mjg at cacr.caltech.edu
Tue Aug 12 16:00:16 PDT 2003


> > <list containsOnly="ucd">
> >    <ucd> foo </ucd>
> >    <ucd> bar </ucd>
> > </list>
> 
> This is a "type-safe" list in that one declares (enforces?) it to have only
> certain types of children; that would be great if it can be done such that
> all validation is done by the XML parser (ie. well-formed and conforming to
> an XSD). Any gurus know how to do that??

If you use JAXB to generate the Java source classes that correspond to the
XML elements from the schema that you end up with type-safe lists
automatically. For example, VODescription has a list that can only contain
GenericResource objects; however, the checking only comes when you try and
marshal the Java objects back to XML.



More information about the registry mailing list