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