1 <?xml version="1.0" encoding="iso-8859-1"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 4 <html xmlns="http://www.w3.org/1999/xhtml" 5 xmlns:template="http://www.boddie.org.uk/ns/xmltools/template"> 6 <head> 7 <title>Example</title> 8 </head> 9 <body template:element="structure"> 10 <form action="" method="POST"> 11 12 <!-- Template text between the start and the interesting part. --> 13 14 <div template:element="item"> 15 <p> 16 Some item: <input template:attribute="value" name="{template:field-name()}" type="text" value="{$this-value}" /> 17 <input name="remove={template:this-position()}" type="submit" value="Remove" /> 18 </p> 19 <p> 20 Item type: 21 <select template:element="type" name="{template:new-field('value')}"> 22 <option template:element="type-enum" template:expr="@value-is-set" template:expr-attr="selected" 23 template:value="@value" value="{@value}"></option> 24 </select> 25 </p> 26 <p> 27 Itself containing more items: 28 </p> 29 <p template:element="subitem"> 30 Sub-item: <input template:attribute="subvalue" name="{template:field-name()}" type="text" value="{$this-value}" /> 31 <input name="remove2={template:this-position()}" type="submit" value="Remove" /> 32 </p> 33 <p> 34 <input name="add2={template:this-position()}" type="submit" value="Add subitem" /> 35 </p> 36 </div> 37 <p> 38 <input name="add={template:this-position()}" type="submit" value="Add item" /> 39 </p> 40 41 <!-- Template text between the interesting part and the end. --> 42 43 </form> 44 </body> 45 </html>