Merge branch 'master' of git.evergreen-ils.org:Evergreen into template-toolkit-opac
[working/Evergreen.git] / Open-ILS / xsl / CNBrowse2HTML.xsl
1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2   
3 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4   xmlns="http://www.w3.org/1999/xhtml"
5   xmlns:xhtml="http://www.w3.org/1999/xhtml"
6   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7   xmlns:marc="http://www.loc.gov/MARC21/slim"
8   xmlns:hold="http://open-ils.org/spec/holdings/v1"
9   xmlns:act='http://open-ils.org/spec/actors/v1'
10   version="1.0">
11   <xsl:output method="html" doctype-public="-//W3C/DTD HTML 4.01 Transitional//EN" doctype-system="http://www.w3.org/TR/html4/strict.dtd" />    
12   <xsl:template match="/">
13      <html>
14        <head>
15          <meta http-equiv="Content-Type" content="text/html" charset="utf-8"/>
16        </head>
17        <body>
18         <span>
19          <a>
20           <xsl:attribute name="href">
21            <xsl:value-of select="$prev"/>
22           </xsl:attribute>
23           <xsl:text>Previous</xsl:text>
24          </a>
25          <xsl:text> -- </xsl:text>
26          <a>
27           <xsl:attribute name="href">
28            <xsl:value-of select="$next"/>
29           </xsl:attribute>
30           <xsl:text>Next</xsl:text>
31          </a>
32         </span>
33         <hr/>
34         <xsl:apply-templates select="//hold:volume"/>
35         <hr/>
36         <span>
37          <a>
38           <xsl:attribute name="href">
39            <xsl:value-of select="$prev"/>
40           </xsl:attribute>
41           <xsl:text>Previous</xsl:text>
42          </a>
43          <xsl:text> -- </xsl:text>
44          <a>
45           <xsl:attribute name="href">
46            <xsl:value-of select="$next"/>
47           </xsl:attribute>
48           <xsl:text>Next</xsl:text>
49          </a>
50         </span>
51        </body>
52      </html>
53   </xsl:template>
54
55   <xsl:template match="hold:volume">
56    <div style="border:solid #999999 1px;">
57     <span>
58      <dl>
59       <xsl:value-of select="@prefix"/>
60       <xsl:value-of select="@label"/>
61       <xsl:value-of select="@suffix"/>
62       <dd><xsl:apply-templates select="marc:record"/></dd>
63       <dd><xsl:value-of select="act:owning_lib/@name"/></dd>
64      </dl>
65     </span>
66    </div>
67   </xsl:template>
68
69   <xsl:template match="marc:record">
70    <img>
71     <xsl:attribute name="src">
72       <xsl:variable name="isbnraw"><xsl:value-of select="marc:datafield[@tag='020']/marc:subfield[@code='a']"/></xsl:variable>
73       <xsl:choose>
74         <xsl:when test="substring-before($isbnraw,' ')">
75           <xsl:variable name="isbntrimmed"><xsl:value-of select="substring-before($isbnraw,' ')"/></xsl:variable>
76           <xsl:value-of select="concat('/opac/extras/ac/jacket/small/',$isbntrimmed)"/>
77         </xsl:when>
78         <xsl:otherwise>
79           <xsl:value-of select="concat('/opac/extras/ac/jacket/small/',$isbnraw)"/>
80         </xsl:otherwise>
81       </xsl:choose>
82     </xsl:attribute>
83    </img>
84    <a>
85     <xsl:attribute name="href">
86      <xsl:value-of select="concat('/opac/extras/unapi?format=htmlholdings-full;id=',@id)"/>
87     </xsl:attribute>
88     <xsl:value-of select="marc:datafield[@tag='245']/marc:subfield[@code='a']"/>
89    </a>
90    <xsl:text> By </xsl:text>
91    <xsl:value-of select="marc:datafield[@tag='100']/marc:subfield[@code='a']"/>
92    <xsl:text> / Published </xsl:text>
93    <xsl:value-of select="marc:datafield[@tag='260']/marc:subfield[@code='c']|marc:datafield[@tag='261']/marc:subfield[@code='d']|marc:datafield[@tag='262']/marc:subfield[@code='d']"/>
94    <span>
95      <xsl:attribute name="style">
96       <xsl:text>font-size:smaller;</xsl:text>
97      </xsl:attribute>
98      <xsl:text> (</xsl:text>
99      <a>
100       <xsl:attribute name="href">
101        <xsl:value-of select="concat('/opac/extras/unapi?format=opac;id=',@id)"/>
102       </xsl:attribute>
103       <xsl:text>Dynamic Details</xsl:text>
104      </a>
105      <xsl:text>)</xsl:text>
106    </span>
107   </xsl:template>
108
109 </xsl:stylesheet>