<html>
<head>
{
$base := (let $base := .//base/@href
 return if ($base) then $base
 else let $script := .//script[matches(., "&lt;base *href", "i")]
 return if ($script) then resolve-uri(extract($script, '"(/[^"]+=[^"'']+)', 1), base-uri())
 else base-uri()) || "/"}
</head>
<body>
{singleResult := false(), nextPage := ""}
<template:switch-prioritized>
  
  <table>
    <tr><td height="18" class="tab1">Kurzliste</td></tr>
    <tr>
      
      <table summary="Result header">
      <strong class="pages">{search-result-count := extract(., "[0-9]+$") * 1}</strong>?
      <!--<a><img alt="vorherige Seite"/>{prevPage := @href}</a>-->
      <a><img alt="nächste Seite"/>{nextPage :=  $base || @href}</a>
      <t:if test="extract($nextPage, '([0-9]+)([^0-9]+)?$', 1) <= 1">{nextPage := ""}</t:if> <!-- it's looping -->
      </table>?
      
      <table summary="hitlist">
      
      <tr valign="top">
        <td></td> <!-- icon -->
        <td></td> <!-- number -->
        <td class="hit">
          <a>{book := {"title": deep-text(), "home-url": $base || @href}}</a>
          <br/>
          {let $text-year := extract(text(),             "^(.*?)\[?((ca[.] *)?[0-9]{4}( *- *)?([0-9]{4})?)\]?$", (1,2))
          return (
          book.author := extract(replace($text-year[1], ".? - .*", ""), " */? *-? *([^-]*)", 1),
                         (: replace(text(), "( *([-,.])? *\[?(ca[.] *)?[0-9]{4}( *- *)?([0-9]{4})?\]?)$", "") :)
          book.year   := $text-year[2]
          )
          } 
        </td>
      </tr>+
      
      </table>
      
    </tr>
  </table>
  
  <table>
    <tr><t:switch>
      <td height="18" class="tab1">Titeldaten</td>
      <td height="18" class="tab1">Detailanzeige</td>
    </t:switch></tr>
    <table>{singleResult := true(), search-result-count := 1}</table>
  </table>
  
  <strong class="error">Es wurde nichts gefunden.</strong>

  <strong class="error">Nichts gefunden.</strong>
  
  <form method="POST" name="browslistform" class="form">    <!-- nicht gefunden, opac schlägt alternativen vor -->
    <input type="submit" value="absenden" name="" class="button"/>
    <input type="checkbox" name="SST" class="form"/>
  </form>

  <strong class="error">{vl:raise(.)}</strong>
  
</template:switch-prioritized>
</body>
</html>