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