hi there,
quick question regarding javascript and xml.
I am using a single xml document and a single xslt.
I would like to display half the document until the user clicks a button and then display the second half.
I have the following code
I have also a template that matches the call within the function.
this does not seem to work (it works fine when i just output text to screen), I am completely new to the use of javascript within an xslt so any help or pointers in the right direction would be much appriciated. Also is this the best way of doing this or is there a method that does not require the use of javascript?
Thanks for all your time
rxg00u
quick question regarding javascript and xml.
I am using a single xml document and a single xslt.
I would like to display half the document until the user clicks a button and then display the second half.
I have the following code
Code:
<xsl:template match="EXAMML">
<html>
<head>
<link rel="stylesheet" href="exam.css" type="text/css" />
<title>
Exam paper: <xsl:value-of select = "COVERPAGEINFO/COURSE"/>
</title>
<body>
<div align = "right"><xsl:value-of select ="COVERPAGEINFO/COURSE/@code"/></div><br/>
</body>
<script type="text/javascript">
function myfunction()
{
document.write(<xsl:apply-templates select="COVERPAGEINFO"/>)
}
</script>
</head>
<form>
<input type="button"
onclick="myfunction()"
value="Call function">
</input>
</form>
ending tags are here
this does not seem to work (it works fine when i just output text to screen), I am completely new to the use of javascript within an xslt so any help or pointers in the right direction would be much appriciated. Also is this the best way of doing this or is there a method that does not require the use of javascript?
Thanks for all your time
rxg00u