[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] making a number from a decimal in XPath 2.0


Subject: Re: [xsl] making a number from a decimal in XPath 2.0
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Mon, 16 May 2005 12:42:38 -0400

Hey Dimitre,

At 04:16 AM 5/16/2005, you wrote:
Better:

($arg + $extent - 1) idiv $extent

Oh, nice! I hadn't seen idiv ... excellent. I'll use that, or a variant.


For my own edification, however...

At 07:44 PM 5/15/2005, you wrote:
> How do I make ceiling($arg div $extent) into an integer?

Use:
   xs:integer(ceiling($arg div $extent))

Cool. But when I have


<xsl:value-of
select="string-join((for $i in (1 to xs:integer(ceiling($length div $line-length))) return 'e'),'')"/>


I get

Error at xsl:value-of on line 129 of file:/C:/Data/ACH/ACH2005/XSL/box-measurer.
xsl:
XPST0003: XPath syntax error at char 74 on line 129 in {...gth div $line-lengt
h))) ret...}:
Cannot find a matching 1-argument function named {http://w3.org/2001/XMLSche
ma}integer()
Failed to compile stylesheet. 1 error detected.


As you can see from the above, I have the 'xs' namespace declared as

xmlns:xs="http://w3.org/2001/XMLSchema"

This must be something basic. Still running Saxon 8.4 (the free version). (And evidently, one thing that I'll have to learn is when casting happens by itself, and when not.)

Cheers,
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================


Current Thread
Keywords