Re: Another newbie post

Mike Brown <[email protected]>
Newsgroups gmane.text.xml.xslt.extensions
Message-ID <[email protected]>
Justin Morgan wrote:
> I set up a test file because I want to use the math:random() function in 
> an XSL document. I downloaded the math:random function package and wrote 
> the XSL file below. With an XML document at hand, I ran this command 
> (the Xalan processor): java org.apache.xalan.xslt.Process -in essay.xml 
> -xsl test.xsl -out test.html. And I got this error:
> 
> (Location of error unknown)XSLT Error 
> (javax.xml.transform.TransformerException): 
> javax.xml.transform.TransformerException: Instance method call to method 
> random requires an Object instance as first argument
> 
> Here's the XSL file:
> 
> <xsl:stylesheet version="1.0"
>           xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>           xmlns:math="http://exslt.org/math"
>           extension-element-prefixes="math">
> <xsl:import href="math.random.xsl" />
> <xsl:template match="/">
> <html>
> <head/>
> <body>
> <p>
> <xsl:value-of select="math:random()"/>
> </p>
> </body>
> </html>
> </xsl:template>
> </xsl:stylesheet>
> 
> Can anyone please help me?

This seems to be a pervasive problem that I would ascribe to unclear 
documentation -- you don't need to download anything if your processor has 
EXSLT support already! Xalan supports math:random, so get rid of that
reference to math.random.xsl.

I'm guessing that's all you need to do.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.