Skip to content
Snippets Groups Projects
Commit f1db2081 authored by Christian Schaper's avatar Christian Schaper
Browse files

print dates with certainty specifications

parent 4b4e1118
Branches merge1.4
No related tags found
1 merge request!2Merge1.4
......@@ -222,7 +222,14 @@ declare function date:printDate($date as element()?, $lang as xs:string, $get-la
else if(normalize-space($date) castable as xs:date) then date:format-date(xs:date(normalize-space($date)),$picture-string, $lang)
else $get-language-string('dateUnknown', ())
return
if(exists($myDate)) then string($myDate)
if(exists($myDate)) then
if(exists($date/@cert)) then
switch($date/@cert)
case 'high' return $get-language-string('prob', (string($myDate), $lang))
case 'medium' return $get-language-string('circa', (string($myDate), $lang))
case 'unknown' return $get-language-string('certUnknown', (string($myDate), $lang))
default return $get-language-string('prob', (string($myDate), $lang))
else string($myDate)
else error($date:DATE_FORMAT_ERROR, string-join(('date:printDate()', 'wrong date format', serialize($date, <output:serialization-parameters><output:method>text</output:method></output:serialization-parameters>)), ' ;; '))
)
else ()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment