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:this-attribute()}" type="text" value="{$this-value}" /> 17 <input name="remove={template:this-element()}" type="submit" value="Remove" /> 18 </p> 19 <p> 20 Item type: 21 <select template:element="type" name="{template:list-attribute('type-enum', 'value')}" multiple="multiple"> 22 <option template:element="type-enum" template:expr="@value-is-set" template:expr-attr="selected" 23 template:value="@value" value="{@value}" /> 24 </select> 25 </p> 26 <p template:element="comment" template:id="comment-node" id="{template:this-element()}"> 27 Comment: 28 <textarea template:attribute="value" name="{template:this-attribute()}" cols="40" rows="3"> 29 <span template:value="$this-value" template:effect="replace">Some comment</span> 30 </textarea> 31 </p> 32 <p> 33 Itself containing more items: 34 </p> 35 <p template:element="subitem"> 36 Sub-item: <input template:attribute="subvalue" name="{template:this-attribute()}" type="text" value="{$this-value}" /> 37 <input name="remove2={template:this-element()}" type="submit" value="Remove" /> 38 </p> 39 <p> 40 <input name="add2={template:this-element()}" type="submit" value="Add subitem" /> 41 </p> 42 </div> 43 <p> 44 <input name="add={template:this-element()}" type="submit" value="Add item" /> 45 </p> 46 <p> 47 <input name="update" type="submit" value="Update" /> 48 </p> 49 50 <!-- Template text between the interesting part and the end. --> 51 52 </form> 53 </body> 54 </html>