[
Lists Home |
Date Index |
Thread Index
]
Jeni Tennison <jeni@jenitennison.com> wrote:
| My point was that they're not just names. If you declare an attribute
| as being of type ID, you not only say that the attribute must have a
| value that meets the lexical constraints of being a name, you also say
| that no other ID-type attribute in the document has the same value. If
| you declare an attribute as being of type ENTITY, as well as stating
| the format of the value of the attribute you state that there is an
| unparsed entity declared in the DTD with that name. And so on for
| NOTATION, IDREF and so on. They don't just constrain the value of the
| attribute, they constrain other aspects of the document.
Okay, I think I misunderstood what you meant by "limits on the scope of a
type definition". :-)
The NAME categories (ID et al) are somewhat special in SGML/XML. Apart
from ID, the others are all referential, pointing to constructs by what
amount to instrumental names, (i.e. names that function as aliases - IDs,
notation names and entity names). They have no purpose or significance
other than to connect parts of the graph that make up the document. That
is, they're just pointers and glue. We shouldn't expect to manipulate
them as values per se - that is, to perform "typed operations" on them,
such as mutating them as if they were strings, performing arithmetic on
them if they could be taken as numbers, etc. (About the only operation
permissible on them is to dereference them!) To that extent we shouldn't
expect a type system of values to say anything about them, other than to
recognize their special status as somewhat Lisp-ish symbols.
This goes back to my earlier comment that apart from string as the ur-type
XML has an intrinsic notion of NAME too - anything that is a NAME can't be
manipulated as a value: it can only be mapped to some referent - which,
btw, could be yet another NAME. (One of the reasons I'm not a fan of XSLT
is its poor support for lists of NAMEs; quite often these are association
lists encapsualting semantic understandings - but getting to such cheap
lookup tables from an operational perspective is a royal pain.)
| Yes, I agree. I think that the other kinds of constraints that these
| types impose should be dealt with at a different level of validation.
Or as run time errors?
|