Randy,
thanks for your update. I have further refined the Java mappings; please check out the latest stable snapshot [1].
Since 7.0, many details of our Java bindings have improved, but it’s generally difficult to find a solution that matches all cases. As there’s no lossless mapping available for Java and XQuery data types, we generally tend to recommend the usage of XQuery functions whenever possible. BaseX provides some few additional converter functions for dates that may be helpful to perform some of the tasks that are otherwise only possible via Java [2].
Best, Christian
[1] http://files.basex.org/releases/latest/ [2] http://docs.basex.org/wiki/Conversion_Module#Dates_and_Durations ___________________________
On Fri, Dec 14, 2012 at 9:15 PM, Randy reed randywreed@gmail.com wrote:
Hi all,
I switched from 6.8 to 7.5 and I'm generating an error I didn't get in 6.8 when using Java Bindings There error is :[FORG0006] Invalid call of Java function: TimeZone.inDaylightTime(java(), java()) It appears that its problem is using the output of one java function in another function.
Is there some new way to do this in 7.5? Thanks Randy
The code is:
declare namespace tz = "java:java.util.TimeZone"; declare namespace dt = "java:java.util.Date"; declare namespace df = "java:java.text.DateFormat"; declare namespace cal = "java:java.util.Calendar"; declare namespace sdf = "java:java.text.SimpleDateFormat";
let $odate := xs:long(1345665817) let $edate := xs:long($odate)*1000 let $fdate := dt:new(xs:long($edate)) let $tmz := tz:getDefault() let $tbool := tz:inDaylightTime($tmz, $fdate)
return (
<results> <jdate>{$fdate}</jdate> <Timezone>{$tmz}</Timezone> <Daylight>{$tbool}</Daylight> </results> )
-- Dr. Randall Reed Assistant Professor, Dept. of Philosophy and Religion Appalachian State University _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk