W3C home > Mailing lists > Public > xproc-dev@w3.org > November 2010

Re: Random Number Generator

From: Leif Warner <abimelech@gmail.com>
Date: Mon, 29 Nov 2010 13:37:52 -0800
Message-ID: <AANLkTimVLmjxHJaKrpE+ZdjOn93_KNjGje-WS5093MDA@mail.gmail.com>
To: XProc Dev <xproc-dev@w3.org>
In the free version of Saxon, this can still be done by writing and
registering an integrated extension function.
But also maybe this should be done as a custom Calabash extension step, that
generates a random parameter you could feed into the stylesheet.

-Leif

On Mon, Nov 29, 2010 at 12:50 PM, James Sulak <jsulak@gmail.com> wrote:

> That said, if you have a paid version of Saxon 9.2 available, you
> should be able to point Calabash to it using the classpath and access
> the java: bindings as before. (I haven't tried this myself.)
>
> -James
>
> On Mon, Nov 29, 2010 at 2:20 PM, David Lee <dlee@calldei.com> wrote:
> > Saxon HE 9.2 no longer exposes the java:  bindings.
> > Calabash is using Saxon HE 9.2
> >
> >
> > ----------------------------------------
> > David A. Lee
> > dlee@calldei.com
> > http://www.xmlsh.org
> >
> > -----Original Message-----
> > From: xproc-dev-request@w3.org [mailto:xproc-dev-request@w3.org] On
> Behalf
> > Of Betty Harvey
> > Sent: Monday, November 29, 2010 3:38 PM
> > To: XProc Dev
> > Subject: Random Number Generator
> >
> >
> > I have included the following variable in my XSLT for generating a
> > random number:
> >
> >  <xsl:variable name="seed">
> >            <xsl:value-of select="math:random() * 1000"
> >                xmlns:math="java:java.lang.Math"/>
> >  </xsl:variable>
> >
> > This is working well in the XSLT and Saxon 9.  However, when I call the
> > XSLT from Calabash I get the following error:
> >
> > Description: XPath syntax error at char 14 on line 89 in {math:random() *
> > 1000}:
> >    Cannot find a matching 0-argument function named
> > {java:java.lang.Math}random()
> >
> > Are there any tricks of the trade in XProc to get a random number
> generator
> > working in XSLT.
> >
> > TIA!
> >
> > Betty
> >
> > /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
> > Betty Harvey                         | Phone:  410-787-9200  FAX: 9830
> > Electronic Commerce Connection, Inc. |
> > harvey@eccnet.com                    | Washington,DC XML Users Grp
> > URL:  http://www.eccnet.com          | http://www.eccnet.com/xmlug
> > /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/
> > Member of XML Guild (www.xmlguild.org)
> >
> >
> >
>
>
Received on Monday, 29 November 2010 21:38:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 29 November 2010 21:38:27 GMT