handling metadata with multiple values
Martin Hill @ ROE
mch at roe.ac.uk
Wed Aug 13 03:49:02 PDT 2003
>> I
>> have a list and then inquire what the list contains? Surely an
>> alternative
>> might be:
>>
>> <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??
>
>> or even
>>
>> <list containsOnly="ucd">
>> <item> foo </item>
>> <item> bar </item>
>> </list>
>>
If we use generic terms such as 'list' and 'item' we not only lose the
schema validation but also the other Useful XML Thing, which is that tags
should describe what they surround (VOTable suffers from this too :-).
Using specialised tags means programs can extract the values by searching
for definite tags, we can read the XML ourselves and understand straight
away what we're looking at, and programs can understand what the values are
from the tags (the tags being the metadata for the values)...
Finally this particular approach would require the parser to do the
validation/assign meaning, which rather implies that someone's going to
have to write code to do this in all the languages using it, and I'm too
lazy...
I must admit I'm not happy with this container approach; it doesn't 'feel'
like the way XML is commonly used, although that doesn't mean it's a Bad
Thing! I'll put together a summary pros/cons.
--
Martin Hill
Software Engineer, Astrogrid
07901 55 24 66
More information about the registry
mailing list