cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <nicola...@apache.org>
Subject Re: Garbage or The Quest for the Perfect Template Language
Date Tue, 05 Aug 2003 16:26:11 GMT

Ugo Cei wrote, On 05/08/2003 16.50:

> Sylvain Wallez wrote:
> 
>> Checkout the last paragraph of JXPath's PackageFunctions description 
>> [1], this may be what you're looking for : the whole classpath is 
>> accessible through fully-qualified names.
>>
>> [1] 
>> http://jakarta.apache.org/commons/jxpath/apidocs/org/apache/commons/jxpath/PackageFunctions.html

>>
>> Sylvain
> 
> 
> I've read it and tried to do the following:
> 
> <jx:out 
> value='#{java.text.SimpleDateFormat.format(java.text.SimpleDateFormat.new("dd/MM/yyyy"),

> someDate)}'/>
> 
> where ``someDate'' evaluates to an instance of java.util.Date, but I get 
> the following error:
> 
> org.apache.commons.jxpath.JXPathException: Undefined function: 
> java.text.SimpleDateFormat.format

In
http://jakarta.apache.org/commons/jxpath/users-guide.html

At
http://jakarta.apache.org/commons/jxpath/users-guide.html#Extension%20Functions

Seems like it should be

   format(java.text.SimpleDateFormat.new("dd/MM/yyyy"), someDate)

Usually when I use jxpath I use this though, it makes it much easier:
http://jakarta.apache.org/commons/jxpath/apidocs/org/apache/commons/jxpath/PackageFunctions.html

>     Ugo (still searching for the perfect template language)


-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------



Mime
View raw message