module namespace shared = 'http://ossetic-studies.org/ns/abaevdict-site/shared'; declare namespace tei = "http://www.tei-c.org/ns/1.0"; import module namespace search = 'http://ossetic-studies.org/ns/abaevdict-site/search-modal' at '../components/search.xq'; (: =========================================================== :) (: ================== GLOBAL VARIABLES ======================= :) (: =========================================================== :) (: Number of items per page :) declare variable $shared:items-per-page as xs:integer := 20; (: These variables are declared in module scope because they are needed in different places, but they are still dynamically evaluated :) declare variable $shared:lookup := doc('abaevdict_index/lookup.xml')/tei:table/tei:entry; declare variable $shared:lookup-all := doc('abaevdict_index/lookup.xml')/tei:table/*; declare variable $shared:total := ceiling(count($shared:lookup) div $shared:items-per-page); (: This is still called sorted, because I haven't changed the code. But it's now equal to lookup, because the lookup itself is now sorted. :) declare variable $shared:sorted := $shared:lookup; (: =============================================================== :) (: ======================= COMMON STUFF ========================== :) (: =============================================================== :) declare function shared:head($title as xs:string, $script as node()* := ()) { {$script} {$title} }; (: Navigation header and search dialog :) declare function shared:header($lang as xs:string, $href-other as xs:string) { (
, search:content($lang) ) }; declare function shared:invert-lang($lang as xs:string) as xs:string { if($lang = 'en') then 'ru' else 'en' };