[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: using xt-extensions for getting a string of date

Subject: Re: using xt-extensions for getting a string of date
From: Phil Lanch <phil@xxxxxxxxxxxxxxx>
Date: Wed, 08 Mar 2000 17:23:24 +0000
java int.parse
felix@xxxxxxxxxxxxxxxxxxxxxx wrote:
> 
> > <xsl:value-of
> > select="date:to-string(date:new(int:parse-int($year),int:parse-int
> > ($month),int:parse-int($day)))"/>
> 
> Well actually I use
> <xsl:variable name="year" select="substring(@date,1,4)"/>
> and it doesn't matter if I try the string($year), or not. Both
> versions fail.

that's what happens when i post 'solutions' without trying them ...

the problem is that, as the XT documentation says,-

"On return from an extension function ... any numeric type is allowed and will
be converted to a number."

-i.e. the (Java) int that int:parse-int() returns is converted to an (XSLT)
number - which is then converted to a (Java) double when it's passed to
date:new() - hence the error.

i suppose there must be a way to do what you want in Java without running into
this kind of automatic conversion, but i can't think what it is ...

perhaps this feature of XT should be removed, & replaced with a new extension
function, xt:number(), which would convert any Java numeric type to an XSLT
number.  James C?

-- 

cheers

phil

"How did you enjoy yourself with these people?
Answer: very much, almost as much as I do when alone."


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.