1 <?xml version="1.0" encoding="iso-8859-1"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" 3 "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.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>Questionnaire</title> 8 <link xmlns:xlink="http://www.w3.org/1999/xlink" href="{$root}styles/styles.css" 9 rel="stylesheet" type="text/css" /> 10 </head> 11 12 <body template:element="questionnaire"> 13 <h1>Questionnaire</h1> 14 15 <div template:if="@submitted = 'true'"> 16 <p> 17 Thank you for sending your answers! 18 </p> 19 </div> 20 21 <form method="POST" action=""> 22 23 <div class="questionnaire"> 24 25 <div class="shadow"> 26 27 <table class="questionnaire"> 28 <tbody template:element="question" template:init="no"> 29 <tr> 30 <th class="question">Question #<span template:value="count(preceding-sibling::question) + 1">n</span></th> 31 <td class="question"> 32 <span template:value="@question-text">Question</span> 33 34 <!-- Hidden state. --> 35 36 <input template:attribute-field="question-text" type="hidden" name="..." value="..." /> 37 <input template:attribute-field="choice-response" type="hidden" name="..." value="..." /> 38 </td> 39 </tr> 40 <tr> 41 <th class="response">Response</th> 42 <td class="response"> 43 <div template:element="choice" template:init="no"> 44 45 <!-- Show a radio or checkbox if appropriate. --> 46 47 <p xml:space="preserve"> 48 49 <span template:if="not(response-type/@value = 'text')"> 50 51 <!-- Show checkboxes. --> 52 53 <input template:if="../@choice-response = 'multiple'" 54 type="checkbox" 55 template:attribute-button="selected,true,checked" 56 name="..." value="..." /> 57 58 <!-- Show radio boxes. --> 59 60 <input template:if="not(../@choice-response = 'multiple')" 61 type="radio" 62 name="{template:other-attributes('selected', ..)}" value="{count(preceding-sibling::choice) + 1}" 63 template:expr="../@selected = string(count(preceding-sibling::choice) + 1)" template:expr-attr="checked" /> 64 65 </span> 66 67 <span template:value="@response-choice">Choice</span> 68 </p> 69 70 <!-- Show a text box if appropriate. --> 71 72 <p template:if="response-type/@value and not(response-type/@value = 'choice')"> 73 <input template:attribute-field="response-text" type="text" size="40" name="..." value="..." /> 74 </p> 75 76 <!-- Hidden state. --> 77 78 <input template:element="response-type" template:attribute-field="value" type="hidden" name="..." value="..." /> 79 <input template:attribute-field="response-choice" type="hidden" name="..." value="..." /> 80 </div> 81 </td> 82 </tr> 83 </tbody> 84 </table> 85 86 </div> 87 88 </div> 89 90 <div class="operations" template:if="not(@submitted = 'true')"> 91 92 <p> 93 <input type="submit" value="Update" name="update" /> to refresh the form. 94 </p> 95 96 <p> 97 <input type="submit" value="Finish" name="finish" /> when you are happy with 98 your responses. 99 </p> 100 101 </div> 102 103 </form> 104 105 </body> 106 </html>