[Typo3-dev] xhtml and ids

Martin Kutschker martin.t.kutschker at n0spam.blackbox.net
Thu Feb 17 15:25:56 CET 2005


"Martin Kutschker" <martin.t.kutschker at n0spam.blackbox.net> schrieb im 
Newsbeitrag 
news:mailman.1.1108649631.26618.typo3-dev at lists.netfielders.de...
> Hi!
>
> Argh! I just noticed that that the nice feature of PHP is incompatible 
> with SGML:
>
> http://www.w3.org/TR/html4/types.html
>
> 6.2 SGML basic types
>
> [snip] 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 (".").
>
> So you think no problem? Wrong.
>
> Because of the use-name-as-id philosphy cObj FORMs get invalid ids when 
> accessibility=1 *)

Hmpf, hit the wrong key. Here we go again.

In XHTML an id is a NMTOKEN. This is the same as above extended with a 
number of CJK and other Unicode "letter" characters. But no square brackets. 
Which means no XHTML validity :-(

I suggest to change "[" to ":" and to remove "]" from the generated id. 
Nested bracktes could be replaced by ".". Eg

foo[bar] => foo:bar
my[foo][bar] => my:foo:bar
my[foo[bar]] => my.foo:bar

Of course we could also use some real reversable scheme:

foo[bar] => foo:.bar.:

Would to be 100% perfect need an escape for :. and .: but who would use such 
names anyway?

Masi

*)

Ids have to be unique. The proposed solution of TSREF to use the name-wrap 
is IMHO not sufficent, because I don't want to change my form names just for 
the ids. I suggest an idWrap or an idPrep property for FORM. 





More information about the TYPO3-dev mailing list