Random Entry: TAC and SAMA are taking Minister of Health and Rath to court
< The 'this is me' phenomenon | Horse Riding >
< The 'this is me' phenomenon | Horse Riding >
This is a brief description of how it works.
Wow, it has been a busy week and I am looking forward to another one. I spent about three days working on this system. It is a method for creating online questionnaires via an xml file that will include on-the-fly form validation and create answers based on the question's xml.
This is how it roughly works.
question.xml contains a description of the question, the way you want to ask it, and if it is a text box type question a regexp of what characters are allowed and an error message to display if the user mis-types.
question.xsl converts this XML to a pretty HTML form.
question.php this does the actual XSLT transform to get rid of buggy XML client problems. It also handles the user's POST'ing of the form. What it does is take question.xml, remove everything unecessary for the answers, inserts the users answers and creates answers.xml which you can mail or store or whatever.
question.css this makes the questionnaire form look pretty and do the cool on-the-fly form validation error message.
xmlform.js this is the client-side javascript that parses question.xml for the form validation stuff.
answer.xml this is the users answer, when this is actually implemented I will mail these to myself, but you can check out your demonstration in the meantime.
answer.xsl this trnasforms the answer into something human readable.
answer.css so far exactly the same as question.css just renamed.
Try it. Go here and do the questionnaire.
I now know *LOTS* more about XML, XSLT, PHP, Javascript and DOM. A good learning session.
UPDATE -- 24th May 04:51am
I have added support for parsing the answer xml's and putting them into a database. See this post for more details. Also the full package can be downloaded from here
This is how it roughly works.
question.xml contains a description of the question, the way you want to ask it, and if it is a text box type question a regexp of what characters are allowed and an error message to display if the user mis-types.
question.xsl converts this XML to a pretty HTML form.
question.php this does the actual XSLT transform to get rid of buggy XML client problems. It also handles the user's POST'ing of the form. What it does is take question.xml, remove everything unecessary for the answers, inserts the users answers and creates answers.xml which you can mail or store or whatever.
question.css this makes the questionnaire form look pretty and do the cool on-the-fly form validation error message.
xmlform.js this is the client-side javascript that parses question.xml for the form validation stuff.
answer.xml this is the users answer, when this is actually implemented I will mail these to myself, but you can check out your demonstration in the meantime.
answer.xsl this trnasforms the answer into something human readable.
answer.css so far exactly the same as question.css just renamed.
Try it. Go here and do the questionnaire.
I now know *LOTS* more about XML, XSLT, PHP, Javascript and DOM. A good learning session.
UPDATE -- 24th May 04:51am
I have added support for parsing the answer xml's and putting them into a database. See this post for more details. Also the full package can be downloaded from here
Trackbacks
Trackback specific URI for this entry
No Trackbacks

