The xsl:eval Element
In previous hours, you used JavaScript to perform the data-reading operations. The sections of JavaScript code were delimited by the opening and closing <SCRIPT> tags where the scripting language was specified by assignment. The XSL equivalent of this is the <xsl:eval> tag.
An xsl:eval Example
To demonstrate how to embed a section of JavaScript code in an XSL file, you'll need to recall a function present in the JavaScript library. This function is the random number generator, which can be used to generate an arbitrary number within any desired range. It's a member of the Math library, so the notation to call it is as follows:
Math.random();
It will return a floating point number between 0 and 1.
Since your goal is to ...
Get Sams Teach Yourself XML in 24 Hours now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.