By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,165 Members | 850 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,165 IT Pros & Developers. It's quick & easy.

maximum length of html id name

P: n/a
hug
The valid character set for the ID= attribute of html tags is listed
here (http://www.htmlhelp.com/reference/html40/attrs.html) but I am
having difficulty finding the maximum allowable length of the id
string. ? tia.

--
http://www.ren-prod-inc.com/hug_soft...action=contact
Aug 24 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
hug <contact_info@sig_line.clickitwrites:
The valid character set for the ID= attribute of html tags is listed
here (http://www.htmlhelp.com/reference/html40/attrs.html) but I am
having difficulty finding the maximum allowable length of the id
string. ? tia.
http://www.w3.org/TR/html4/types.html says:
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 (".").
No maximum length

--
Chris
Aug 24 '06 #2

P: n/a

Chris Morris wrote:
hug wrote::
<snip>
>... I am having difficulty finding the maximum allowable
length of the id string. ? tia.

http://www.w3.org/TR/html4/types.html says:
>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 (".").

No maximum length
>From the SGML Declaration of HTML 4:-
| ATTSPLEN 65536 -- These are the largest values --
| LITLEN 65536 -- permitted in the declaration --
| NAMELEN 65536 -- Avoid fixed limits in actual --
| PILEN 65536 -- implementations of HTML UA's --

I believe that NAMELEN may be the significant setting (65,536
characters), though the note suggests that it should not actualy
reprresent a limit in practice.

Richard.

Aug 24 '06 #3

P: n/a
"Richard Cornford" <Ri*****@litotes.demon.co.ukwrites:
Chris Morris wrote:
hug wrote::
<snip>
... I am having difficulty finding the maximum allowable
length of the id string. ? tia.
http://www.w3.org/TR/html4/types.html says:
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 (".").
No maximum length

From the SGML Declaration of HTML 4:-

| ATTSPLEN 65536 -- These are the largest values --
| LITLEN 65536 -- permitted in the declaration --
| NAMELEN 65536 -- Avoid fixed limits in actual --
| PILEN 65536 -- implementations of HTML UA's --

I believe that NAMELEN may be the significant setting (65,536
characters), though the note suggests that it should not actualy
reprresent a limit in practice.
Yes, it's the largest value they were allowed. The intended effect is
"unlimited", although a strict SGML parser might disagree. Of course,
browser bugs and memory limitations might disagree first. The values
were quite a bit lower in 2.0 and in the 3.0 drafts - I suspect they
decided to set them to 'effectively unlimited' for lack of a better
value.

(I think LITLEN - the "Maximum length of a delimited literal" - is the
relevant one, but since they're all the same value it doesn't really
matter in this context)

The next one down:
TAGLVL 100
is interesting, too - no more than 100 levels of tag nesting are
allowed.

--
Chris
Aug 24 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.