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