[xsl] breaking xsl loop or template

Subject: [xsl] breaking xsl loop or template
From: "Prasad Akella" <avlnprasad@xxxxxx>
Date: Thu, 17 Feb 2005 18:08:00 +0100

i would like to break an xsl loop until some user action is done and then proceed further. for example

if the user were to write an exam with a set of questions being obtained from the xml, i should be able to display one question, wait till the user has entered the answer and only then display the next question. actually this is a problem when i am working with xforms as there is no interaction between xforms and xsl

my code looks like this

Online Exam
----------i write some stuff in xforms here------------and then call the template----
<xsl:apply-templates mode="content" select="Exam/Question"/>
------------------------ this is template doing the actual question paper---------
<xsl:template name="show" match="Question" mode="content">
<xsl:value-of select="@No"/>
<xforms:label id="marks">Marks:
<xsl:value-of select="Marks"/>
<xforms:label id="question">
<xsl:value-of select="Problem"/>
<xsl:if test="@Qtype='Blank'">
<xforms:input ref="/Exam/Question/Answer" id="{identity}">
<xsl:if test="@Qtype='Explain'">								
<xforms:textarea ref="/Exam/Question/Answer" id="{identity}">

----------------------- depending upon the type of question i would like to display controls so that the user can select answers
i also have single select (Radio) and multiselect (check box) -----------------------

the "ref" attribute with every xforms control indicates the xml element into which the data from the user has to be written. 

my problem is that all the questions are rendered continuously. once its over, the user interaction starts. so if i have 10 questions, then the 10 questions are rendered and then the user interaction of answering each question starts but i am not able to specify that this input from the user has to go into this answer tag where the question number is same. thus i end up with only my first answer tag being filled with the last answer since the position of the tree is back to start of Question. 

i am not able to pass variables into xforms nor take any input from xforms to xsl. can someone please help me with this problem. i am stuck with this for quite long. my xml looks like this - the "Answer" tag is used to record the user input. 

	<Question No="1" Qtype="Blank">
		<Problem>What does XML stand for</Problem>
		<Key>eXtensible Markup Language</Key>
<Question No="2" Qtype="Explain">
		<Problem>Explain the advantages of XML</Problem>
		<Key>1. XML is useful for writing text with tags
2. its free form
3. has many more advantages</Key>
with regards,
Prasad Akella
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193

Current Thread