On Feb 3, 2005, at 2:04 PM, Andrew E Switala wrote:
> Even this limited type-checking cannot be done when there are type
> attributes as in <identifier type="isbn"> and <identifier type="uri">.
Which supports the position that wherever possible, one should use
elements.
However, the fact that you can't validate an element based on its
attribute value is not a general limitation: it is a limitation of the
DTD and XSD languages. RNG handles it fine.
Identifiers = ISBN | DOI
ISBN = element identifier { attribute type {"isbn"}, isbn-pattern }
DOI = element identifier { attribute type {"doi"}, doi-pattern }
The patterns would then just be regular expression patterns for each
respective id type.
One can only hope that XSD will evolve to support this in v2. It's a
major limitation that it doesn't now.
Bruce
|