<html>

  <DIV class="DisplayRecord">
   <t:loop><t:switch>
      <DIV class="CatInfoCont">
        <TABLE>
          <t:loop><t:switch>
            <TR><TH>T I T E L</TH><TD>{$book.title}</TD></TR>
            <TR><TH>Autor</TH><TD>{$book.author}</TD></TR>
            <TR><TH>Erscheinungsjahr</TH><TD>{$book.year}</TD></TR>
            <TR><TH>ISBN</TH><TD>{$book.isbn := replace(., "ISBN *", "")}</TD></TR>
            <TR><TH>Link</TH><TD><a><t:read var="book.Link: {replace(., '[.]', '')}!" source="x'{@href}'" /></a></TD></TR>
            <TR><TH>{currentfield := replace(normalize-space(.), "[.]", "")}</TH>
                <TD><t:read source="if (./a/contains(@href, '://')) then x'{.} ( {./a/@href} )' else ." var="book.{$currentfield}!"/></TD></TR>
          </t:switch></t:loop>
        </TABLE>
      </DIV>

      <DIV class="ItemInfoCont">
        <table> <colgroup>
          <t:siblings-header>
           <col class="barcode" />?
           <col class="shelf" />
           <col class="collection" />?
           <col class="volume" />?
           <col class="branch" />?
           <col class="status" />?
           <col class="dueDate" />?
           <col class="res" />?
           <col/>*
          </t:siblings-header>
        </colgroup>
        <tbody>
          <tr>{$holding := {"orderable": false()}}
          <t:siblings>
            <td>{$holding.barcode}</td>
            <td>{$holding.id}</td>
            <td>{$holding.libraryLocation}</td>
            <td>{normalize-space()[.]!($holding("Band!"):=.)}</td>
            <td>{$holding.libraryBranch}</td>
            <td>{$holding.status}</td>
            <td>{normalize-space()[string-length()>1]!($holding.dueDate:=parse-date(.))}</td>
            <td>{$holding._order-id := .//input/@name, $holding.orderable := exists($holding._order-id) }</td>
            <td/>
          </t:siblings>
          {$book.holdings[]:=$holding}
          </tr>+
        </tbody>
        </table>
        <a title="Reserve Title">{
          book._order-url := @href, 
          if (empty($book.holdings.orderable[.])) then $book.holdings := $book.holdings!map:put(., "orderable", true()) else ()
        }</a>?
        <div class='SubmitIssuesReserves' t:test="$book.holdings.orderable[.]">
        {$order-form := form(ancestor::form[1], (.//input)), $book.orderTitle := "vormerken"}
        </div>
      </DIV>
   </t:switch></t:loop>
  </DIV>

</html>