According to my schema book and the w3schools site you can can require
an attribute like this:
<xs:attribute name="lang" type="xs:string" use="required"/>
and as I understand it you can restrict it (enumerations, etc) in the same as you can simple elements.
Paul said:
> but let's face it, the prime purpose of xml is for > computers to read.
Me? Disagree? Surely not. But there must be some reason we use such a verbose form in unicode...
It's perfectly *possible* to make human-readable forms (eg VOTable, and I believe people find it's readability a great benefit), but you do have to do some work to get it. Let's not mention ADQL.
Paul Harrison wrote:
> 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). >>
-- Martin Hill VOTech Software Engineer @ ROE www.roe.ac.uk/~mch +44 7901 55 24 66Received on 2005-11-30Z12:02:35