{book := {
"title": $title,
"_searchId": encode-for-uri(concat("ZTEXT ", extract($title//a/@href, "\('(.*)'\)", 1))),
"_index": $lastIndex,
"year": $globyear
}, lastSearchedIndex := $lastIndex}
{let $temp := tokenize(., "-")!normalize-space(),
$year := $temp[last()][. castable as xs:integer],
$autpubcount := count($temp) - (if (exists($year)) then (1, $book.year := $year)[1] else 0)
return switch ($autpubcount)
case 0 return ()
case 1 return $book.author := $temp[1]
default return (
$book.author := $temp[1],
$book.publisher := $temp[$autpubcount]
)}
{book.statusId := local:img-to-status(.)}
?