From: Ben A. <ben...@gm...> - 2005-02-16 21:24:00
|
I tried that, too with no success: Type error: string 2005-05-01 cannot be cast into an xs:dateTime It would be nice to be able to associate a schema with my documents, but I don't see that implemented anywhere. -Ben On Wed, 16 Feb 2005 12:57:13 -0800, Piotr Kaminski <pi...@id...> wrote: > > Actually I tried that already and got this error: > > cannot convert string '2005-05-01T12:00:00-05:00' into a > > double [at line 62, column 80] [at line 62, column 80]. For > > kicks I tried changing the dateTime into a date, but got the > > same result. Am I doing something wrong here: > > > > {$myDate - fn:current-date()} > > Sounds like you're forgetting to convert a string into a typed dateTime > value somewhere along the line. Try to replace the above with: > > {xs:dateTime($myDate) - current-dateTime()} > > or > > {xs:date($myDate) - current-date()} > > Of course, you can also do the cast wherever you initialize $myDate > instead. In theory, if your schemas are all set up right and eXist > decides to honor them (which I don't think it does yet?), the value should > be correctly typed for you as it is retrieved from the database, but right > now your best bet is to cast explicitly. > > -- P. > > -- > Piotr Kaminski (pi...@id...) > It's the heart afraid of breaking that never learns to dance. > > > |