OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] another naieve question - valid characters for ID values

[ Lists Home | Date Index | Thread Index ]

From: "Joe English" <jenglish@flightlab.com>
 
> Tim Bray wrote:
> > Rick Jones wrote:
> >
> > > Why do the the values of an ID attribute have to start with something
> > > besides a number?
> >
> > Inherited from SGML.  No other real good reason for it. -Tim
> 
> ... and SGML did it that way because an ID-valued attribute
> is a name for the element on which it appears, so it has
> the same lexical form as other names.

And names are different from numbers because then they can be used
as name tokens in programming languages and scripts. 

For example, I think it was Netscape 4's object model, an HTML element
was available as an object named by its ID/name.  An element ID that
started with a number would be treated as a number by the JavaScript
(causing an error.)  Whether this is so useful is debatable...

Cheers
Rick Jelliffe





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS