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 Itself containing more items: 21 </p> 22 <p template:element="subitem"> 23 Sub-item: <input template:attribute="subvalue" name="{template:field-name()}" type="text" value="{$this-value}" /> 24 <input name="remove2={template:this-position()}" type="submit" value="Remove" /> 25 </p> 26 <p> 27 <input name="add2={template:this-position()}" type="submit" value="Add subitem" /> 28 </p> 29 </div> 30 <p> 31 <input name="add={template:this-position()}" type="submit" value="Add item" /> 32 </p> 33 34 <!-- Template text between the interesting part and the end. --> 35 36 </form> 37 </body> 38 </html>