Re: [xsl] date formating

Subject: Re: [xsl] date formating
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Mon, 20 Aug 2001 16:14:19 +0100
Hi Roman,

> I'm a new to this list so I don't know what XSLT processor you are
> talking about but I'd suspect that node is passed into your
> extension function.
> I use Xalan processor and the way it would work is that for
> <xsl:variable name="moreover-date"
>       select="harvest_time" />
> if would store a node/Element in the variable.
> Easiest fix I think would be change it to look like:
> <xsl:variable name="moreover-date">
>         <xsl:value-of select="harvest_time" />
> </xsl:variable>
>
> In this case the text value is stored in the variable.

That's not quite true. In the second case, the $moreover-date variable
holds a result tree fragment, a little node tree whose root node has a
single child -- a text node with the value of the harvest_time
element. If you want the variable to hold a string, then you should
use:

  <xsl:variable name="moreover-date" select="string(harvest_time)" />

But I think that Xalan does a pretty good job of converting the
arguments that you pass in to extension function to the types of the
arguments that you've declared on the methods, at least in Java, so
you don't have to worry too much about passing in the wrong kind of
object (unlike in MSXML/JavaScript).

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


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


Current Thread