|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: another naieve question - valid characters for ID values
From: "Joe English" <jenglish@f...> > 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








