|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: javascript in XSLT
At 03:57 PM 4/29/2002, you wrote:
The JavaScript should really go between the <head> and </head> tags. Move the call-template up one line. I assume (you provided no XML data, but I gather from your comments) that there are 5 "result" elements in your XML. If this assumption is incorrect, this means that there will be several <form name="results" ...> in your output. This is incorrect for your purpose, as the name document.results would not be unique. It seems to be the case though, since you say that document.result.length is 5, when document.result.marks.length should have the value 5. I recommend you alter the templates to output only one <form> element, and a single checkbox for each result (if I'm assuming your data correctly). This would look like the following (I also changed your onclick attribute slightly): <xsl:template match="Results"> <html> <head> <title>Search Results</title> <xsl:call-template name="markRecords" /> </head> <body> <form name="results"> <xsl:apply-templates select="result" /> </form> </body> </html> </xsl:template> <xsl:template match="result"> <xsl:variable name="key" select="Key" /> <input name="marks" type="checkbox" onclick="saveme('{$key}', this.checked);" /> <br /> </xsl:template>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








