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="styles/styles.css" 9 rel="stylesheet" type="text/css" /> 10 </head> 11 12 <body template:element="questionnaire"> 13 <h1>Questionnaire</h1> 14 15 <form method="POST" action=""> 16 17 <div class="questionnaire"> 18 19 <div class="shadow"> 20 21 <table class="questionnaire"> 22 <tbody template:element="question" template:init="no"> 23 <tr> 24 <th class="question">Question #<span template:value="count(preceding-sibling::question) + 1">n</span></th> 25 <td class="question"> 26 <span template:value="@question-text">Question</span> 27 28 <!-- Hidden state. --> 29 30 <input template:attribute-field="question-text" type="hidden" name="..." value="..." /> 31 <input template:attribute-field="choice-response" type="hidden" name="..." value="..." /> 32 </td> 33 </tr> 34 <tr> 35 <th class="response">Response</th> 36 <td class="response"> 37 <div template:element="choice" template:init="no"> 38 39 <!-- Show a radio or checkbox if appropriate. --> 40 41 <p xml:space="preserve"> 42 43 <span template:if="not(response-type/@value = 'text')"> 44 45 <!-- Show checkboxes. --> 46 47 <input template:if="../@choice-response = 'multiple'" 48 type="checkbox" 49 name="{template:other-list-attributes('selected', 'value', ..)}" value="{@response-choice}" 50 template:expr="count(../selected[@value = current()/@response-choice]) > 0" template:expr-attr="checked" /> 51 52 <!-- Show radio boxes. --> 53 54 <input template:if="not(../@choice-response = 'multiple')" 55 type="radio" 56 name="{template:other-attributes('selected', ..)}" value="{@response-choice}" 57 template:expr="../@selected = @response-choice" template:expr-attr="checked" /> 58 59 </span> 60 61 <span template:value="@response-choice">Choice</span> 62 </p> 63 64 <!-- Show a text box if appropriate. --> 65 66 <p template:if="response-type/@value and not(response-type/@value = 'choice')"> 67 <input template:attribute-field="response-text" type="text" size="40" name="..." value="..." /> 68 </p> 69 70 <!-- Hidden state. --> 71 72 <input template:element="response-type" template:attribute-field="value" type="hidden" name="..." value="..." /> 73 <input template:attribute-field="response-choice" type="hidden" name="..." value="..." /> 74 </div> 75 </td> 76 </tr> 77 </tbody> 78 </table> 79 80 </div> 81 82 </div> 83 84 <div class="operations"> 85 86 <p> 87 <input type="submit" value="Update" name="update" /> to refresh the form. 88 </p> 89 90 <p> 91 <input type="submit" value="Finish" name="finish" /> when you are happy with 92 your responses. 93 </p> 94 95 </div> 96 97 </form> 98 99 </body> 100 </html>