{ nextPage := get('nextPage', ()), startUrl := get('startUrl', ''), touchpoint := get('touchpoint', false()) }
  • Bestellungen|Requestsif (extract(., "[0-9]+") > "0") then requestedUrl := a/@href else ()
  • ?
  • Vormerkungen|Reservationsif (extract(., "[0-9]+") > "0") then bookCountOrdered := a/@href else ()
  • ?
Ausleihen|Loans
Bestellungen|Requestsif (extract(., "[0-9]+") > "0") then requestedUrl := a/@href else ()
?
Vormerkungen|Reservationsif (extract(., "[0-9]+") > "0") then orderedUrl := a/@href else ()
?

Ausleihen|Loans mode := 1

Bestellungen|Requestsmode := 2

Vormerkungen|Reservationsmode := 3

{nextPage := ()} {book := object()}
{$book.title} {$book.title}

{$book.actionURI := resolve-html(.)} {$book.status := ., $book.statusId := "curious"} {book._onPage := base-uri(), book._onPageStart := $startUrl} {$book.status := ., $book.statusId := "critical"} {book.actionURI := resolve-html(.), book.statusId := if ($mode eq 3) then "ordered" else if ($mode eq 2) then "provided" else "curious", book.cancelable := $mode eq 3, book._onPage := base-uri(), book._onPageStart := $startUrl} {$book.status := (br[last()]/following-sibling::text())[last()], $book.statusId := "critical"}
{ switch ($mode) case 3 return ( (: bestellt | ... br Vormerkung :) book.status := ./text()[1], book.issuedate := parse-date(extract(., '\d{2}\.\d{2}\.\d{4}', 0), 'dd.mm.yyyy|'), book.statusId := "ordered", book.cancelable := boolean($book.actionURI) ) case 2 return ( book.status := ./text()[1], book.issuedate := parse-date(extract(., '\d{2}\.\d{2}\.\d{4}', 0), 'dd.mm.yyyy|'), book.statusId := "provided", book.cancelable := boolean($book.actionURI) ) default return let $dates := extract(., '((\d{2}\.\d{2}\.\d{4}) *-)? *(\d{2}\.\d{2}\.\d{4})', (1,3)) return ( if ($dates[1]) then book.issuedate:=parse-date($dates[1], 'dd.mm.yyyy') else (), if ($dates[2]) then book.duedate:=parse-date($dates[2], 'dd.mm.yyyy') else vl:raise("DATUM KANN NICHT GELESEN WERDEN: " || .) ) }
{let $selected := .//span[contains(@class, "selectedlink")] return nextPage := $selected[if (count($selected) ge 2) then 2 else 1]/following-sibling::a[1]/@href[not(ends-with(., "anzPos=1"))] }
?