Vormerkungbook.orderable := true(), book._order-url := @href?
declare function local:parse-column($node){
$node ! (
let $weirdscript := 'document.write(convert_special_characters("'
return if (.//script[contains(., $weirdscript)]) then
string-join( .//text()!(
if (../name() eq "script") then
. => substring-after($weirdscript) => substring-before('"));')
else .
) , " ")
else string()
)
}; ()
Titel | | {$book.title := local:parse-column(.)} |
Person | | {$book.author := local:parse-column(.)} |
Autor | | {$book.author := local:parse-column(.)} |
Erschienen | | {
let $temp := local:parse-column(.)
return (
book.year := extract($temp, "[0-9]+ *$"),
if (contains($temp, ":")) then (
book.location := substring-before($temp, ":"),
book.publisher := translate(substring-after($temp, ":"), "0123456789", "")
) else ()
)
} |
ISBN | | {book.isbn := local:parse-column(.) ! ( if (contains(., ":")) then substring-before(., ":") else . )} |
EAN | | {$book(if (not($book.isbn)) then "isbn" else "EAN!") := local:parse-column(.) ! (if (contains(., ":")) then substring-before(., ":") else .)} |
Signatur | | {$book.id := local:parse-column(.)} |
{$temp} | | {$book(concat($temp, "!")) := local:parse-column(.)} |
|
Bestand i := 0, header := (),
let $divs := following::div
for $div in $divs
(:for tumbling window $window in $divs start when true() end next $n when starts-with($n/@id, 'stock_header'):)
let $id := $div/@id
return (
if (starts-with($id, "stock_header")) then
$header := $div/string()
else if (starts-with($id, "stock_content")) then
for tumbling window $lines in $div/(text()|element()) start when true() end $e when $e/self::br return
let $t := $lines!normalize-space(inner-text())[.] where exists($t) return
$book(concat("Exemplar ", $i := $i + 1, "!")) := join(($header, $lines), "
")
else ()
)[0]
?