[Top][All Lists]

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

Re: Converting a string to valid XHTML id?

From: Lennart Borgman
Subject: Re: Converting a string to valid XHTML id?
Date: Thu, 2 Dec 2010 00:12:31 +0100

On Wed, Dec 1, 2010 at 11:32 PM, Davis Herring <address@hidden> wrote:
>> That sounds tempting but is wrong :-/ Percent-encoding doesn't produce
>> valid  ID values. From the html 4 specs:
>>  6.2 SGML basic types
>>   ....
>>  ID and NAME tokens must begin with a letter ([A-Za-z]) and may be
>>  followed by any number of letters, digits ([0-9]), hyphens ("-"),
>>  underscores ("_"), colons (":"), and periods (".").
> If you're referring to the leading letter, you're right -- I forgot about
> it.  Easy enough to fix: also use Lennart's "ANON-" prefix when the string
> begins with a non-letter or with the string "ANON-".
> Or is there something more fundamental that I'm missing?

Yes, % is not allowed. And the names should be unique.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]