xquery version "1.0"; declare namespace session="http://exist-db.org/xquery/session"; declare namespace util="http://exist-db.org/xquery/util"; declare namespace i18n="http://apache.org/cocoon/i18n/2.1"; import module namespace classmenu="http://www.risten.no/shared/classmenu" at "../xquery/classmenu.xqm"; import module namespace langmenu="http://www.risten.no/shared/langmenu" at "../xquery/langmenu.xqm"; import module namespace ristenutil="http://www.risten.no/shared/util" at "../xquery/ristenutil.xqm"; (: Main function - gathers the data required to build and pre-polutate the form, :) declare function local:main() as element()+ { (: previous selections are stored in session attributes, and used for preselecting the same values as in the previous edit :) let $class := session:get-attribute("class" ), $top := session:get-attribute("newrectop" ), $mid := session:get-attribute("newrecmid" ), $botm := session:get-attribute("newrecbotm"), $lang := session:get-attribute("newreclang"), $pos := session:get-attribute("newrecpos" ), $date := current-dateTime() return ( { classmenu:get-classification("SD-class") } { langmenu:get-termlangs(ristenutil:get-collection()) } ) };
{ let $start := util:system-time() return ( local:main(),

SearchTime { round-half-to-even( seconds-from-duration( util:system-time()-$start) , 3)}

) }