Re: Extend values of type ID

Elliotte Harold wrote:
> 
> Anne van Kesteren wrote:
> 
>> It would make much more sense, in my humble opinion, to make allow any
>> character as value with a minimum length of 1 character. With the
>> exclusion of some control characters I guess.
>
> ID values are considered to be names. These are the same rules as for 
> XML names. Why it was decided to make them names instead of name tokens 
> I'm not sure. However, allowing arbitrary strings would cause lots of 
> problems with white space. many contexts in which IDs would be used 
> could not easily deal with values that contain white space, especially 
> after taking into account the baroque rules for attribute value 
> normalization. For instance, it would completely break IDREFS if IDs 
> could contain white space.

I was not really aiming at allowing strings. But more things like:

  <foo xml:id="1"/>

  <foo xml:id="d[1]"/>

  <foo xml:id="{"/>

... et cetera. It should be possible to allow more possible values 
without creating problems. (Perhaps it would create some backwards 
compability problems with older parsers, but you are not required to 
write ID values this way.)

You could exclude 'whitespace' or apply some other algorithm that works. 
However, allowing numbers at the start of ID values and allowing some 
other characters as well that are currently excluded makes sense.


-- 
  Anne van Kesteren
  <http://annevankesteren.nl/>

Received on Monday, 14 February 2005 19:08:14 UTC