Click to See Complete Forum and Search --> : Urgent!!! Going Bald! XML drop down menu.


Bob_Hopes
04-26-2007, 04:19 AM
Hi Need some help, really new to the world of XML but heads buzzing with ideas on how i could use it. Hit my first problem though.

I have an xml file (see below) which i would like to use to populate a survey. I would like the Questiondesc field to poulate a label (comfortable with this). I would then like the the answer fields associated with that question desc field to populate a drop down menu and or radio button value. Don't have clue with this part... can you help please!!!

There is one other question although have started to look at this just yet. Based on the responses i would like to create a new xml with the same structure but only the responses selected... A pointer to a good reference or tutorial would be great or if any one has done something similar even better.

Your help would be greatly appreciated

Thanks in advance!

<DivisionName>
<DVName>GBGB</DVName>
<DvcodeNo>1</DvcodeNo>
<ClaimGroup>
<CustSurveyNo>5</CustSurveyNo>
<ClaimGroupType>Gas</ClaimGroupType>
<Questions>
<QuestionID>100</QuestionID>
<QuestionDesc>Call Abandoned ?</QuestionDesc>
<Answer>
<AnswerID>308</AnswerID>
<Answer>Didn't Abandoned</Answer>
<Ansoption />
</Answer>
<Answer>
<AnswerID>309</AnswerID>
<Answer>Abandoned</Answer>
<Ansoption />
</Answer>
</Questions>
<Questions>
<QuestionID>83</QuestionID>
<QuestionDesc>Q1. Was your call answered prompt and courteously?</QuestionDesc>
<Answer>
<AnswerID>213</AnswerID>
<Answer>Don't Know</Answer>
<Ansoption />
</Answer>
<Answer>
<AnswerID>214</AnswerID>
<Answer>Yes</Answer>
<Ansoption />
</Answer>
<Answer>
<AnswerID>215</AnswerID>
<Answer>No</Answer>
<Ansoption>
<Options>Time Waiting</Options>
</Ansoption>
<Ansoption>
<Options>Rude/Abrupt</Options>
</Ansoption>
<Ansoption>
<Options>Unhelpful</Options>
</Ansoption>
</Answer>
</Questions>
<Questions>
<QuestionID>84</QuestionID>
<QuestionDesc>Q2. Was our advisor able to understand and help you with the difficulties you were experiencing?</QuestionDesc>
<Answer>
<AnswerID>227</AnswerID>
<Answer>Don't Know</Answer>
<Ansoption />
</Answer>
<Answer>
<AnswerID>228</AnswerID>
<Answer>Yes</Answer>
<Ansoption />
</Answer>
<Answer>
<AnswerID>229</AnswerID>
<Answer>No</Answer>
<Ansoption>
<Options>Wrong Advice</Options>
</Ansoption>
<Ansoption>
<Options>Unable to Agree Claim</Options>
</Ansoption>
<Ansoption>
<Options>Poor Policy/Product Knowledge</Options>
</Ansoption>
<Ansoption>
<Options>Didn't Understand imapct of emergency</Options>
</Ansoption>
</Answer>
</Questions>
<Questions>
<QuestionID>85</QuestionID>
<QuestionDesc>Q3. Did we explain the next steps and that the contractor would contact you within 1 hr to arrange an appointment?</QuestionDesc>
<Answer>
<AnswerID>234</AnswerID>
<Answer>Don't Know</Answer>
<Ansoption />
</Answer>
<Answer>
<AnswerID>235</AnswerID>
<Answer>Yes</Answer>
<Ansoption />
</Answer>
<Answer>
<AnswerID>236</AnswerID>
<Answer>No</Answer>
<Ansoption />
</Answer>
</Questions>
</ClaimGroup>
</DivisionName>

Stephen Philbin
04-26-2007, 05:46 AM
You could probably style the XML with XSL-FO (http://www.w3.org/TR/xsl11/). I'm not sure about the enabling of scripting in the document. I think you might do that by defining an element in the DOCTYPE to facilitate scripting (I may well be wrong about that one though).

Not really much point doing all that when you could just transform the whole thing to XHTML or HTML with XSL-T (http://www.w3.org/TR/xslt) on the server side, though.