[whatwg] id and xml:id

fantasai fantasai.lists at inkedblade.net
Sun Apr 2 08:56:53 PDT 2006


Henri Sivonen wrote:
> Since UAs handle whitespace in the id attribute inconsistently (see  
> below), old specs imply or require whitespace trimming and ids with  
> whitespace are unreferencable from whitespace-separated lists of ids,  I 
> suggest adding the following language concerning document conformance:
> 
> The value of the id attribute must be a string that consists of one  or 
> more characters matching the following production: [#x21-#xD7FF]| 
> [#xE000-#xFFFD]|[#x10000-#x10FFFF] (any XML 1.0 character excluding  
> whitespace).

I'd rather see the id attribute restricted to an NCName token insofar
as possible. We can make an exception for Hixie's repetition templates,
but otherwise I think it should be compatible with the XML ID syntax.

So

   xsd:id {
     pattern: "\S*";
   }

The concept of "idness" is a useful one for many tools, and even if
browsers don't care what characters there are, other tools do. We can't
express IDness in a schema if we insist on ignoring its syntactic
restrictions.

~fantasai



More information about the whatwg mailing list