paulb@150 | 1 | <?xml version="1.0" encoding="iso-8859-1"?> |
paulb@150 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" |
paulb@150 | 3 | "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
paulb@150 | 4 | <html xmlns="http://www.w3.org/1999/xhtml" |
paulb@150 | 5 | xmlns:template="http://www.boddie.org.uk/ns/xmltools/template"> |
paulb@150 | 6 | <head> |
paulb@150 | 7 | <title>Example</title> |
paulb@175 | 8 | <script type="text/javascript" src="scripts/sarissa.js"> </script> |
paulb@175 | 9 | <script type="text/javascript" src="scripts/XSLForms.js"> </script> |
paulb@150 | 10 | </head> |
paulb@150 | 11 | <body template:element="structure"> |
paulb@150 | 12 | <form action="" method="POST"> |
paulb@150 | 13 | |
paulb@150 | 14 | <!-- Template text between the start and the interesting part. --> |
paulb@150 | 15 | |
paulb@150 | 16 | <div template:element="item"> |
paulb@150 | 17 | <p> |
paulb@150 | 18 | Some item: <input template:attribute="value" name="{template:this-attribute()}" type="text" value="{$this-value}" /> |
paulb@150 | 19 | <input name="remove={template:this-element()}" type="submit" value="Remove" /> |
paulb@150 | 20 | </p> |
paulb@160 | 21 | <p> |
paulb@150 | 22 | Item type: |
paulb@175 | 23 | <select template:element="type" name="{template:list-attribute('type-enum', 'value')}" multiple="multiple" |
paulb@175 | 24 | onchange="requestUpdate('{$application-url}comments', '{template:list-attribute('type-enum', 'value')}', |
paulb@179 | 25 | '{template:other-elements(../options)}', |
paulb@179 | 26 | '{template:child-attribute('value', template:child-element('comment', 1, template:other-elements(../options)))}', |
paulb@175 | 27 | '/structure/item/options')"> |
paulb@150 | 28 | <option template:element="type-enum" template:expr="@value-is-set" template:expr-attr="selected" |
paulb@150 | 29 | template:value="@value" value="{@value}" /> |
paulb@150 | 30 | </select> |
paulb@150 | 31 | </p> |
paulb@175 | 32 | <p template:element="options" template:id="comment-node" id="{template:this-element()}"> |
paulb@175 | 33 | <span template:element="comment">Comment: |
paulb@175 | 34 | <textarea template:attribute="value" name="{template:this-attribute()}" cols="40" rows="3"> |
paulb@175 | 35 | <span template:value="$this-value" template:effect="replace">Some comment</span> |
paulb@175 | 36 | </textarea> |
paulb@175 | 37 | </span> |
paulb@169 | 38 | </p> |
paulb@150 | 39 | <p> |
paulb@150 | 40 | Itself containing more items: |
paulb@150 | 41 | </p> |
paulb@150 | 42 | <p template:element="subitem"> |
paulb@150 | 43 | Sub-item: <input template:attribute="subvalue" name="{template:this-attribute()}" type="text" value="{$this-value}" /> |
paulb@150 | 44 | <input name="remove2={template:this-element()}" type="submit" value="Remove" /> |
paulb@150 | 45 | </p> |
paulb@150 | 46 | <p> |
paulb@150 | 47 | <input name="add2={template:this-element()}" type="submit" value="Add subitem" /> |
paulb@150 | 48 | </p> |
paulb@150 | 49 | </div> |
paulb@150 | 50 | <p> |
paulb@150 | 51 | <input name="add={template:this-element()}" type="submit" value="Add item" /> |
paulb@150 | 52 | </p> |
paulb@169 | 53 | <p> |
paulb@169 | 54 | <input name="update" type="submit" value="Update" /> |
paulb@169 | 55 | </p> |
paulb@150 | 56 | |
paulb@150 | 57 | <!-- Template text between the interesting part and the end. --> |
paulb@150 | 58 | |
paulb@150 | 59 | </form> |
paulb@150 | 60 | </body> |
paulb@150 | 61 | </html> |