| 1 | <h:html xmlns="http://www.w3.org/2002/xforms" |
|---|
| 2 | xmlns:h="http://www.w3.org/1999/xhtml" |
|---|
| 3 | xmlns:ev="http://www.w3.org/2001/xml-events" |
|---|
| 4 | xmlns:xsd="http://www.w3.org/2001/XMLSchema" |
|---|
| 5 | xmlns:jr="http://openrosa.org/javarosa"> |
|---|
| 6 | <h:head> |
|---|
| 7 | <h:title>Demo Form</h:title> |
|---|
| 8 | |
|---|
| 9 | <model> |
|---|
| 10 | <instance> |
|---|
| 11 | <!-- the XML inside here is what gets filled out and submitted when you complete the form --> |
|---|
| 12 | <student> |
|---|
| 13 | <name /> |
|---|
| 14 | <sex /> |
|---|
| 15 | <interests /> |
|---|
| 16 | </student> |
|---|
| 17 | </instance> |
|---|
| 18 | |
|---|
| 19 | <!-- binds allow us to add properties to the questions, like data types, skip logic, etc. |
|---|
| 20 | <bind ... /> |
|---|
| 21 | --> |
|---|
| 22 | </model> |
|---|
| 23 | </h:head> |
|---|
| 24 | |
|---|
| 25 | <h:body> |
|---|
| 26 | <!-- This is where we define the questions that the user will fill out --> |
|---|
| 27 | <input ref="name"> |
|---|
| 28 | <label>What is your name?</label> |
|---|
| 29 | </input> |
|---|
| 30 | |
|---|
| 31 | <select1 ref="sex"> |
|---|
| 32 | <label>Are you male or female?</label> |
|---|
| 33 | <item> |
|---|
| 34 | <label>Male</label> |
|---|
| 35 | <value>m</value> |
|---|
| 36 | </item> |
|---|
| 37 | <item> |
|---|
| 38 | <label>Female</label> |
|---|
| 39 | <value>f</value> |
|---|
| 40 | </item> |
|---|
| 41 | </select1> |
|---|
| 42 | |
|---|
| 43 | <select ref="interests"> |
|---|
| 44 | <label>What are your interests?</label> |
|---|
| 45 | |
|---|
| 46 | <item> |
|---|
| 47 | <label>Eating Ugali</label> |
|---|
| 48 | <value>ugali</value> |
|---|
| 49 | </item> |
|---|
| 50 | <item> |
|---|
| 51 | <label>Watching TV</label> |
|---|
| 52 | <value>tv</value> |
|---|
| 53 | </item> |
|---|
| 54 | <item> |
|---|
| 55 | <label>Music</label> |
|---|
| 56 | <value>music</value> |
|---|
| 57 | </item> |
|---|
| 58 | <item> |
|---|
| 59 | <label>Making XForms</label> |
|---|
| 60 | <value>xforms</value> |
|---|
| 61 | </item> |
|---|
| 62 | </select> |
|---|
| 63 | |
|---|
| 64 | </h:body> |
|---|
| 65 | </h:html> |
|---|