]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/xsl/MARC21slim2HTMLCard-holdings.xsl
removing the server search link
[Evergreen.git] / Open-ILS / xsl / MARC21slim2HTMLCard-holdings.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   version="1.0">
10   <xsl:output method="html" doctype-public="-//W3C/DTD HTML 4.01 Transitional//EN" doctype-system="http://www.w3.org/TR/html4/strict.dtd" />    
11   <xsl:template match="/">
12      <html>
13        <head>
14          <meta http-equiv="Content-Type" content="text/html" charset="utf-8"/>
15          <link href="{$base_dir}/htmlcard.css" rel="stylesheet" type="text/css" />
16        </head>
17        <body>
18         <xsl:apply-templates select="//marc:record"/>
19        </body>
20      </html>
21   </xsl:template>
22       
23   <xsl:template match="marc:record">
24     <div class="cardimage">
25      <xsl:apply-templates select="marc:datafield[@tag!='082' and @tag!='092' and @tag!='010']"/>
26      <span class="bottom">
27       <xsl:apply-templates select="xhtml:link[@rel='otherFormat' and contains(@href,'format=')]"/>
28       <xsl:apply-templates select="marc:controlfield[@tag='001']"/>
29       <xsl:apply-templates select="marc:datafield[@tag='082' or @tag='092' or @tag='010']"/>
30      </span>
31     </div>
32     <br/>
33     <xsl:apply-templates select="hold:volumes"/>
34     <br/>
35   </xsl:template>
36
37   <xsl:template match="xhtml:link">
38     <a>
39       <xsl:attribute name="href">
40         <xsl:value-of select="@href"/>
41       </xsl:attribute>
42       <xsl:value-of select="@title"/>
43     </a>
44     <br/>
45   </xsl:template>
46
47   <xsl:template match="hold:volumes">
48     <xsl:if test="count(hold:volume/hold:copies/hold:copy) &gt; 0">
49         <u>Holdings</u>
50     </xsl:if>
51     <ul>
52     <xsl:apply-templates select="hold:volume">
53       <xsl:sort select="@lib"/>
54     </xsl:apply-templates>
55     </ul>
56   </xsl:template>
57
58   <xsl:template match="hold:volume">
59       <li> <b><xsl:value-of select="./@label"/></b>
60         <xsl:apply-templates select="hold:copies"/>
61       </li>
62   </xsl:template>
63
64   <xsl:template match="hold:copies">
65     <ul>
66     <xsl:apply-templates select="hold:copy">
67       <xsl:sort select="hold:location"/>
68     </xsl:apply-templates>
69     </ul>
70   </xsl:template>
71
72   <xsl:template match="hold:copy">
73       <li> <xsl:value-of select="@barcode"/>
74         <ul>
75           <li>Circulating from <b><xsl:value-of select="hold:circlib"/></b></li>
76           <li>Located at <b><xsl:value-of select="hold:location"/></b></li>
77           <li>Status is <b><xsl:value-of select="hold:status"/></b></li>
78           <xsl:apply-templates select="hold:statcats"/>
79         </ul>
80       </li>
81   </xsl:template>
82
83   <xsl:template match="hold:statcats">
84     <xsl:if test="count(hold:statcat) &gt; 0">
85       <li>Statistical Catagories
86         <ul>
87         <xsl:apply-templates select="hold:statcat">
88           <xsl:sort select="@name"/>
89         </xsl:apply-templates>
90         </ul>
91       </li>
92     </xsl:if>
93   </xsl:template>
94
95   <xsl:template match="hold:statcat">
96       <li> <b><xsl:value-of select="@name"/></b>: <xsl:value-of select="."/> </li>
97   </xsl:template>
98
99   <xsl:template match="marc:controlfield">
100       <span class="oclc">#<xsl:value-of select="substring(.,4)"/></span>
101   </xsl:template>
102       
103   <xsl:template match="marc:datafield">
104     <xsl:if test="starts-with(@tag, '1')">
105       <p class="mainheading"><xsl:value-of select="."/></p>
106     </xsl:if>
107
108     <xsl:if test="starts-with(@tag, '24') and /marc:record/marc:datafield[@tag='100']">
109       <span class="title"><xsl:value-of select="."/></span>
110     </xsl:if>
111
112     <xsl:if test="starts-with(@tag, '24') and not(/marc:record/marc:datafield[@tag='100'])">
113       <span class="titlemain"><xsl:value-of select="."/></span><br/>
114     </xsl:if>
115
116     <xsl:if test="@tag='260'">
117       <xsl:value-of select="."/>
118     </xsl:if>
119
120     <xsl:if test="@tag='300'">
121       <p class="extent"><xsl:value-of select="."/></p>
122      </xsl:if>
123
124     <xsl:if test="starts-with(@tag, '5')">
125       <p class="note"><xsl:value-of select="."/></p>
126     </xsl:if>
127
128     <xsl:if test="@tag='650'">
129       <span class='counter'><xsl:number count="marc:datafield[@tag='650']"/>.</span> <xsl:apply-templates select="marc:subfield"/>
130     </xsl:if>
131
132     <xsl:if test="@tag='653'">
133       <span class="counter"><xsl:number format="i" count="marc:datafield[@tag='653']"/>.</span> <xsl:apply-templates select="marc:subfield"/>
134     </xsl:if>
135
136     <xsl:if test="@tag='010'">
137       <xsl:variable name="LCCN.nospace" select="translate(., ' ', '')"/>
138       <xsl:variable name="LCCN.length" select="string-length($LCCN.nospace)"/>
139       <xsl:variable name="LCCN.display" select="concat(substring($LCCN.nospace, 1, $LCCN.length - 6), '-', format-number(substring($LCCN.nospace, $LCCN.length - 5),'#'))"/>
140       <span class="LCCN">LCCN:<xsl:value-of select="$LCCN.display"/></span>
141     </xsl:if>
142
143     <xsl:if test="@tag='082' or @tag='092'">
144       <span class="DDC"><xsl:value-of select="marc:subfield[@code='a']"/></span>
145     </xsl:if>
146
147     <xsl:if test="@tag='856'">
148      <br/><xsl:apply-templates mode="link" select="marc:subfield" />
149     </xsl:if>
150   </xsl:template>
151
152   <xsl:template match="marc:subfield" mode="link">
153     <xsl:if test="@code='u'">
154       <span class="link">
155         <a class="url" href="{.}">
156                 <xsl:choose>
157                         <xsl:when test="../marc:subfield[@code='y']">
158                                 <xsl:value-of select="../marc:subfield[@code='y']"/>
159                         </xsl:when>
160                         <xsl:when test="../marc:subfield[@code='3']">
161                                 <xsl:value-of select="../marc:subfield[@code='3']"/>
162                         </xsl:when>
163                         <xsl:otherwise>
164                                 <xsl:value-of select="."/>
165                         </xsl:otherwise>
166                 </xsl:choose>
167         </a>
168       </span>
169     </xsl:if>
170   </xsl:template>
171   
172   <xsl:template match="marc:subfield">
173     <xsl:if test="@code!='2'">    
174      <xsl:if test="@code!='a'">--</xsl:if>
175      <xsl:value-of select="."/>
176     </xsl:if>
177   </xsl:template>
178
179 </xsl:stylesheet>