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

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

From: Ben Meadowcroft <ben@benmeadowcroft.com>
Date: Sun, 11 Jul 2004 00:37:31 +0100
Message-ID: <000901c466d6$e20995d0$07fc68d5@BensPC>
I guess that the W3c validator is the only one that doesn't have a problem
with the &! All the others I tried including IE and firefox reported
errors, I guess the [] is easier to stick with than doing &amp;{...} in
xhtml documents after all!

Ben

-----Original Message-----
From: whatwg-whatwg.org-bounces@lists.whatwg.org
[mailto:whatwg-whatwg.org-bounces at lists.whatwg.org] On Behalf Of Ben
Meadowcroft
Sent: 10 July 2004 20:06
To: whatwg at whatwg.org
Subject: [whatwg] WEB_FORMS 2.0 comment, repetition model,using reserved
macro scripting syntax


I have a comment on
http://www.whatwg.org/specs/web-forms/2004-06-27-call-for-comments/#repeat
ingFormControls why not use the script macro syntax &{identifier} rather
than the square brackets []?

The script syntax has been reserved for future use in HTML 4.01, and is
mentioned in Appendix B.

"This specification reserves syntax for the future support of script
macros in HTML CDATA attributes. The intention is to allow attributes to
be set depending on the properties of objects that appear earlier on the
page." -
http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.7.1

This sounds like it could be a good fit for the repetition template and
would be developing HTML in a way explicitly provided for in a previous
spec.

A template could be defined as:

<tr id="order" repeat="template" repeat-start="3">
    <td><input type="text" name="row&{order}.product"  value=""></td>
    <td><input type="text" name="row&{order}.quantity" value="1"></td>
</tr>

I created a simple test page to check if it would throw up any errors when
validating for XHTML (due to XML specific stuff) and it didn't throw any
errors (it did raise a couple of warnings though!), obviously I took out
the repeat-start attribute as well to make it validate.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Repeating validation test</title> </head> <body> <table>
   <tr>
    <th>Product</th>
    <th>Quantity</th>
   </tr>
   <tr id="order">
    <td><input type="text" name="row&{order}.product" value="" /></td>
    <td><input type="text" name="row&{order}.quantity" value="1" /></td>
   </tr>
  </table>
</body>
</html>

I think this is a better way forward than using []'s which I have to be
honest I don't like that much, I hope this is a useful point and hasn't
already been covered and dismissed (I did a quick search on the archives).
Any comments?

Regards,
--
Ben Meadowcroft
http://www.benmeadowcroft.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3034 bytes
Desc: not available
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20040711/75e287c1/attachment.bin>
Received on Saturday, 10 July 2004 16:37:31 UTC

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