Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] regexp


  • From: nick at nickfitz.co.uk (Nick Fitzsimons)
  • Subject: [Javascript] regexp
  • Date: Tue Apr 25 12:51:52 2006

Steve Clay wrote:
> Tuesday, April 25, 2006, 12:00:29 PM, Nick Fitzsimons wrote:
> 
>>Unfortunately word boundaries can occur within classNames, as they
>>include hyphens, meaning the above would incorrectly find a match on
>>class="highlighted-blob"
> 
> 
> Oops, I just ran into that a few days ago parsing markup (attributes can
> have hyphens).
> 
> What are the (or where can I find definitive lists of) allowable chars in
> the names of XML elements and attributes, and XHTML ids and classes?
> 
> Steve

As far as HTML is concerned, there's a summary of the formal SGML 
definition in the HTML 4.01 spec at:

<http://www.w3.org/TR/html4/types.html#h-6.2>

The DTD defines "id" as of type ID and "class" as of type CDATA.

As for XML, "id" is  in the XML 1.0 spec(3rd edition) at
<http://www.w3.org/TR/2004/REC-xml-20040204/#id>
and you can follow the links from there for Name and NameChar, which 
should allow you to see what's permitted.

HTH,

Nick.
-- 
Nick Fitzsimons
http://www.nickfitz.co.uk/