XQuery transform string into a datetime (exist-db) -


i using xquery 3.0 exist-db, , trying make string $value datetime object. i've got, it's not working:

let $value := '"2001-10-18t08:47:00"'  if ($key = 'start_time')              element { $key } { xs:datetime(string(replace($value, '"', ''))) } 

it's saying: illegal lexical form date-time-like value ''. ideas?

i'm unable reproduce error you're getting code - incomplete (lacks return , else clauses, doesn't define $key). paring issues away, code runs fine me, follows:

let $value := '"2001-10-18t08:47:00"' return     xs:datetime(replace($value, '"', '')) 

the result:

2001-10-18t08:47:00 

Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -