theredking
-
Posts
4 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by theredking
-
-
Thanks a lot man! I didn't even know how to use some of that stuff! Much apprechiated
-
Here is the XML file. Thanks for this!Would you provide a sample XML file, so I could test what you have up to now? I mean... it all looks good at first sight, excluding the fact that you have two "name" attributes in a single anchor, which however shouldn't be the cause of this.What if you place each group (question with it's answers) in a <fieldset> element maybe?<?xml version="1.0" ?><?xml-stylesheet type="text/xsl" href="quizdisplaypd.xsl"?><!-- <!DOCTYPE XMultipleChoice SYSTEM "quizpd.dtd"> --> <XMultipleChoice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="quizschemapd.xsd"> <QuizName>Parmjeet Dayal Great XML Assignment Quiz</QuizName> <Units> <Unit> <QuestionNo>1</QuestionNo> <Subject>Dave Chappelle Show</Subject> <Question>Who is Rick James?</Question> <Answer Corr="Y">Rick James</Answer> <Answer>Charlie Murphy</Answer> <Answer>Dave Chappelle</Answer> <Answer>Eddie Murphy</Answer> </Unit> <Unit> <QuestionNo>2</QuestionNo> <Subject>Dave Chappelle Show</Subject> <Question>Should you put feet on other peoples couches?</Question> <Answer>Yes</Answer> <Answer>No</Answer> <Answer>In someone else's house</Answer> <Answer Corr="Y">In Eddie Murphy's house, he can afford it</Answer> </Unit> <Unit> <QuestionNo>3</QuestionNo> <Subject>Wrestling</Subject> <Question>Who is the greatest wrestler of all time?</Question> <Answer>Hulk Hogan</Answer> <Answer>The Rock</Answer> <Answer Corr="Y">Goldberg</Answer> <Answer>Stone Cold Steve Austin</Answer> </Unit> <Unit> <QuestionNo>4</QuestionNo> <Subject>Music</Subject> <Question>Who is the lead singer of The Stone Roses is?</Question> <Answer>Noel Gallagher</Answer> <Answer Corr="Y">Ian Brown</Answer> <Answer>Chris Martin</Answer> <Answer>Snoop Dog</Answer> </Unit> </Units></XMultipleChoice>
-
Hello, i am writing an xslt to transform and display my quiz xml document. The questions are displayed and answers are displayed with radio buttons next to them. But i don't know to to provide them values or group them question by questions as all the radio buttons seem to be linked becasue when one is clicked it turns off another one from another question. I have tried amending this problem but with little success, any help would be much apprechiated. Thank you. my code is below.
<?xml version="1.0"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" > <xsl:template match ="/"> <html> <body> <form name="myform" action="http://www.manut.com" method="POST"> <center> <h2> <xsl:value-of select="XMultipleChoice/QuizName" /> </h2> </center> <hr> </hr> <!-- create the links --> <ul> <xsl:for-each select="XMultipleChoice/Units/Unit"> <li> <a> <xsl:attribute name="href"> <xsl:text>#Unit-</xsl:text> <xsl:value-of select="Question" /> </xsl:attribute> <xsl:value-of select="Question" /> </a> </li> </xsl:for-each> </ul> <!-- now the actual slides --> <xsl:for-each select="XMultipleChoice/Units/Unit"> <hr> </hr> <h3> <a> <xsl:attribute name="name"> <xsl:text>#Unit-</xsl:text> <xsl:value-of select="QuestionNo" /> </xsl:attribute> <xsl:value-of select="QuestionNo" /> - <xsl:attribute name="name"> <xsl:text>#Unit-</xsl:text> <xsl:value-of select="Subject" /> </xsl:attribute> <xsl:value-of select="Subject" /> </a> </h3> <li> <h3> <a> <xsl:attribute name="name"> <xsl:text>#Unit-</xsl:text> <xsl:value-of select="Question" /> </xsl:attribute> <xsl:value-of select="Question" /> </a> </h3> </li> <ul> [B] <xsl:for-each select="Answer" > <p align = "left"><input type = "radio" name = "name1" value = ""/><xsl:value-of select="." /></p> </xsl:for-each>[/B] </ul> </xsl:for-each> </form> </body> </html> </xsl:template> </xsl:stylesheet>
XML to JSP
in XML
Posted
I am trying to get questions for a multiple choice quiz stored in an xml file displayed on a JSP. I'm new to XML and am stuck as how to get the questions onto the JSP. I know that JDOM and mapping to a database are options but i am not finding examples on the web very helpful. Can anybody suggesat the easiest way to do this. Thank You. I have attached the xml for clarity.