On Thu, Apr 23, 2009 at 11:16 AM, Richard Quadling <rquadl...@googlemail.com
> wrote:

>  Interesting. Initially, I thought you can't have a . in an ID, but
> http://dev.w3.org/html5/spec/Overview.html#the-id-attribute says only
> spaces are disallowed.


It's not safe to look at the HTML5 language definition and assume that the
same would work for the HTML4.01 documents, since the latter is a
SGML-derived language and the former is a whole new separate language with
its own parsing rules.

While the HTML form of HTML5 bears a close resemblance to SGML and XML, it
is a separate language with its own parsing rules.[1]

That being said, the current HTML recommendation also allows dots in the
ID[2].



> The issue is how would $$('#mail.com') differentiate between ...
>
> <span id="mail" class="com">
> and
> <span id="mail.com">
>
> No matter how you fiddle with the selector, the "." gets in the way.
>

As for the selector problem, I'd expect $('google.com') to work just like
document.gEBI and fetch the right element, but the $$ selector should, IMHO,
behave similarly to the Selectors API[3], allowing you to escape the dot in
the selector, if you want to match an ID like the one said above.


> If possible, I would change my id's and classes to only use the _
> symbol as this symbol is of no importance in any of the languages
> (well, except as a single character in SQL's LIKE syntax).
>

Agreed.

[1] http://dev.w3.org/html5/spec/Overview.html#parsing
[2] http://www.w3.org/TR/html401/types.html#type-name
[3] http://www.w3.org/TR/selectors-api/

Gabriel Gilini

www.usosim.com.br
gabr...@usosim.com.br

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to