[whatwg] [WF2] Web Forms 2.0: Repetition and type ID

fantasai wrote:
> I'd like to suggest that ID attributes use a different syntax
> than [] to mark repetition placeholders, one that fits with the
> XML restrictions on IDs. The current syntax makes it impossible
> to define ID attributes as "type ID" in any of the three major
> XML validation schemas, which affects both the usefulness of
> authoring tools that rely on IDness (e.g. for navigational tags
> or for catching duplication and referential errors) and the
> integrity of other specs (such as the CSS 2.1 specification) that
> rely on such definitions.
> 
> I don't care what the syntax is (I suggest :-replaceable-: for
> lack of anything better), and it doesn't have to apply to other
> attributes where [replaceable] is more natural.

    Couldn't we just solve this with an attribute called "templateid" 
that would be used in place of the |id| attribute for templates. We 
could then use |id| for backwards compatibility.

| <html xmlns="http://www.w3.org/1999/xhtml">
|  <head>
|   <title>Solar System</title>
|  </head>
|  <body>
|   <form>
|    <h1> Solar system </h1>
|    <p> <label> System Name: <input name="name"/> </label> </p>
|    <h2> Planets </h2>
|    <ol>
|     <li repeat="template" repeat-start="0" templateid="planets">
|      <label>
|       Name: <input name="planet[planets].name" required="required"/>
|      </label>
|      <h3> Moons </h3>
|      <ul>
|       <li repeat="template" repeat-start="0"
|        templateid="planet[planets].moons">
|        <input name="planet[planets].moon[planet[planets].moons]"/>
|        <button type="remove">Delete Moon</button/>
|       </li>
|      </ul>
|      <p><button type="add" template="planet[planets].moons">
|       Add Moon
|      </button></p>
|      <p><button type="remove">Delete Planet</button></p>
|     </li>
|    </ol>
|    <p><button type="add" template="planets">Add Planet</button></p>
|    <p><button type="submit">Submit</button></p>
|   </form>
|  </body>
| </html>

Received on Saturday, 2 July 2005 13:03:01 UTC