Referencing in XML for the IVO

Paul Harrison pharriso at eso.org
Wed Nov 30 00:41:20 PST 2005


Patrick Dowler wrote:
> With respect to the following, is there a way to say that at least one
> of the attributes must be present? Otherwise, a validating XML 
> parser cannot fully validate the document and client code has to
> check for null all over the place. The presence of required elements
> and attributes is really the most vanilla for of validity checking, and
> we are going to give that up if everything is nillable :-(
> 
> I realise that even then, use of xlink makes it impossible for the
> parser to fully validate... but it would be nice to know (from successfully
> parsing) that the document appears to be valid (assuming external 
> references via xlink are to the correct kind of thing).
> 


I think that this does illustrate a general design issue in our schema - 
use elements in preference to attributes where the underlying data 
structure is a choice
as then the parser can validate that one of the choice elements is 
present - this cannot be done with optional attributes. Using more 
elements to represent things instance documents look even uglier to the 
human reader, but let's face it, the prime purpose of xml is for 
computers to read.


-- 
Paul Harrison
ESO Garching
www.eso.org



More information about the dm mailing list