diff --git a/content/parameters.xql b/content/parameters.xql index cdf9d8b..6688fb8 100644 --- a/content/parameters.xql +++ b/content/parameters.xql @@ -232,7 +232,9 @@ declare %private function parameters:cast-value ($value as item()?, $schema as m case "date" return xs:date($value) case "date-time" return - xs:dateTime($value) + if ( $value castable as xs:dateTime ) + then xs:dateTime($value) + else parse-ietf-date($value) (: Headers like If-Modified-Since are formatted as IETF date which is not castable as xs:dateTime :) case "binary" return xs:base64Binary($value) case "byte" return @@ -243,4 +245,4 @@ declare %private function parameters:cast-value ($value as item()?, $schema as m default return string($value) -}; \ No newline at end of file +};