W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2004

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

From: Andrew Clover <and-py@doxdesk.com>
Date: Sun, 11 Jul 2004 07:37:35 +0900
Message-ID: <40F06FAF.8070003@doxdesk.com>
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 '&amp;{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/
Received on Saturday, 10 July 2004 15:37:35 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:35 UTC