I am using XQuery 3.0 for exist-db, and am trying to make the string $value a dateTime object. This is what I've got, but it's not working:
let $value := '"2001-10-18T08:47:00"'
if ($key = 'start_time')
then
element { $key } { xs:dateTime(string(replace($value, '"', ''))) }
It's saying: illegal lexical form for date-time-like value ''. Any ideas?