{ if (get("singleMode", false())) then $book := {"_recordId": get("singleModeRecordId","")} else (), .//div[@resource]//table[@summary]//tr/vl:set-book-property(th, td), css("div#record div.row.result")/*[.//label]/vl:set-book-property(.//label, normalize-space(join(following-sibling::*))), css("div#detailview-leftcol div.detailview-content-item")/vl:set-book-property(./div[1], ./div[2]), (:ub leipzig:) css("div.tab-content div.description-tab table.table")//tr/vl:set-book-property(th, td) }
$generalOrderUrl := .//a/@href[contains(., "Hold") and contains(., "login")] ? ? ? ? ? ? ? ? ? {$holding := {"orderable": exists($generalOrderUrl), "_orderUrl": $generalOrderUrl }} {$book.holdings[] := $holding} +
Bücherei|Library|CollectionBereich|AreaStandort|LocationSignatur|Call NumberBarcodeStatusZss-Heft|Journal ItemVorbestellungen|ReservationsEntliehen bis|Checked Out until*
{$holding.libraryBranch} {$holding.libraryLocation} {if (exists(($holding.libraryBranch, $holding.libraryLocation))) then $holding.id := . else $holding.libraryBranch := . } {$holding.id} {$holding.barcode} {$holding.statusStr := (let $big := *[contains(@class, "text-")] return if ($big) then $big[1] else .), extract(., "[0-9.-]{10}")[.]!($holding.duedate:=parse-date(.)) } {$holding("Journal!") := .} {$holding.pendingOrders} {normalize-space()[.]!($holding.duedate:=parse-date(.))} { $holding.orderable := true(), $holding._orderUrl := @href }?
? let $temp := css("div.detailview-content-item")/( let $a := .//a let $ahold := $a[contains(@href, "Hold") or contains(@href, "StorageRetrieval")] let $b := .//b return if (exists($ahold) or exists(.//strong)) then {|{ "orderable": exists($ahold), "_orderUrl": $ahold[1]/@href, (: "orderTitle": $ahold[1],:) "libraryBranch" ?: get("templib", ()) }, for tumbling window $notes in .//node() start $s when name($s) eq "strong" end next $n when name($n) eq "strong" let $key := switch (translate($notes[1], ": ", "")) case "Standort" return "libraryLocation" case "Signatur" return "id" case "Barcode" return "barcode" default return $notes[1] || "!" return {$key: normalize-space(join(tail($notes/self::text())))} |} else if (empty($a)) then (.//b/($templib := .))[0] else vl:set-book-property($a, $a)[0] ) where $temp return $book.holdings := $temp
?