[whatwg] WEB_FORMS 2.0 comment, repetition model, using reserved macro scripting syntax

Andrew Clover and-py at doxdesk.com
Sat Jul 10 15:37:35 PDT 2004


Ben Meadowcroft <ben at benmeadowcroft.com> wrote:

> why not use the script macro syntax &{identifier} rather
> than the square brackets []?

1. Because it's malformed XHTML. XML 1.0 states the only use of & in an 
attribute value is for a (numeric) character reference or a (named) 
entity reference, neither of which can accomodate this. I would be 
surprised if the W3C's validator didn't complain about this; the Firefox 
Web Developer Toolbar's one does.

2. Because it has another, incompatible meaning - Netscape 4 actually 
implemented the ghastly hack described in Appendix B, which is why it 
was mentioned there.

3. Because with the error fixup procedures of IE and other browsers, 
it's indistinguishable from '&{identifier};' at a DOM level.

> Any comments?

4. Square brackets are still pretty bad. You can't have them in an 
attribute of type ID, so 'id' attributes in a WF doctype would have to 
be of another non-ID type, with browser hacks to make them actually IDs 
after all, or something, ugh. Also they cause pain for PHP users and 
others who like to put literal square brackets in their names; the 
nbzwsp-hack is in insufficient workaround as it doesn't, AFAICS, allow 
PHP-[ and WF-[ to be mixed.

5. Deep breath:

I believe the entire idea of repeat-sections to be an poor solution to a 
question that can already be better answered by plain old JavaScript.

It *easy* to provide a library that uses the DOM method Node.cloneNode 
followed by some manual or automated fixup to attribute values to 
produce repeat sections.

Requiring this feature at browser level, with the added complexity of 
the clumsy square-bracket-hack and the extra-nasty nbzwsp-hack, is a 
Really Bad Idea in my personal opinion.

-- 
Andrew Clover
mailto:and at doxdesk.com
http://www.doxdesk.com/



More information about the whatwg mailing list