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 <script type="text/javascript" src="scripts/sarissa.js"> </script> 9 <script type="text/javascript" src="scripts/XSLForms.js"> </script> 10 </head> 11 <body template:element="structure"> 12 <form action="" method="POST"> 13 14 <!-- Template text between the start and the interesting part. --> 15 16 <div template:element="item"> 17 <p> 18 Some item: <input template:attribute="value" name="{template:this-attribute()}" type="text" value="{$this-value}" /> 19 <input name="remove={template:this-element()}" type="submit" value="Remove" /> 20 </p> 21 <p> 22 Item type: 23 <select template:element="type" name="{template:list-attribute('type-enum', 'value')}" multiple="multiple" 24 onchange="requestUpdate('{$application-url}comments', '{template:list-attribute('type-enum', 'value')}', 25 '{template:other-elements(../options)}', '{template:other-attributes('value', ../options/comment)}', 26 '/structure/item/options')"> 27 <option template:element="type-enum" template:expr="@value-is-set" template:expr-attr="selected" 28 template:value="@value" value="{@value}" /> 29 </select> 30 </p> 31 <p template:element="options" template:id="comment-node" id="{template:this-element()}"> 32 <span template:element="comment">Comment: 33 <textarea template:attribute="value" name="{template:this-attribute()}" cols="40" rows="3"> 34 <span template:value="$this-value" template:effect="replace">Some comment</span> 35 </textarea> 36 </span> 37 </p> 38 <p> 39 Itself containing more items: 40 </p> 41 <p template:element="subitem"> 42 Sub-item: <input template:attribute="subvalue" name="{template:this-attribute()}" type="text" value="{$this-value}" /> 43 <input name="remove2={template:this-element()}" type="submit" value="Remove" /> 44 </p> 45 <p> 46 <input name="add2={template:this-element()}" type="submit" value="Add subitem" /> 47 </p> 48 </div> 49 <p> 50 <input name="add={template:this-element()}" type="submit" value="Add item" /> 51 </p> 52 <p> 53 <input name="update" type="submit" value="Update" /> 54 </p> 55 56 <!-- Template text between the interesting part and the end. --> 57 58 </form> 59 </body> 60 </html>