usi xsl: handle more fields
[metaproxy-moved-to-github.git] / xml / xslt / pz22usi.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet version="1.0" 
3                 xmlns="http://www.loc.gov/mods/v3"
4                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6                 xmlns:id="http://indexdata.com/xml/modsExtension/"
7                 xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
8                 x-exclude-result-prefixes="mods">
9   <xsl:output method="xml" indent="yes" />
10   <!-- <xsl:template match="text()"/> -->
11
12   <xsl:template match="/pz:record">
13       <mods version="3.4"
14           xsi:schemaLocation="http://www.loc.gov/mods/v3
15                               http://www.loc.gov/standards/mods/v3/mods-3-4.xsd">
16       <originInfo>
17         <dateIssued><xsl:value-of select="normalize-space(pz:metadata[@type='date'])"/></dateIssued>
18         <publisher><xsl:value-of select="pz:metadata[@type='publication-name']"/></publisher>
19         <place>
20           <placeTerm type="text">
21             <xsl:value-of select="pz:metadata[@type='publication-place']"/>
22           </placeTerm>
23         </place>
24         <xsl:if test="pz:metadata[@type='medium'] = 'book'">
25           <issuance>monographic</issuance>
26         </xsl:if>
27       </originInfo>
28       <location>
29         <url usage="primary"><xsl:value-of select="pz:metadata[@type='electronic-url']"/></url>
30         <url access="preview">$THUMBURL</url>
31       </location>
32       <titleInfo>
33         <title><xsl:value-of select="pz:metadata[@type='title']"/></title>
34       </titleInfo>
35       <xsl:for-each select="pz:metadata[@type='author']">
36         <name type="personal">
37           <displayForm><xsl:value-of select="."/></displayForm>
38           <role>
39             <roleTerm type="text">author</roleTerm>
40           </role>
41         </name>
42       </xsl:for-each>
43       <xsl:for-each select="pz:metadata[@type='title-responsibility']">
44         <name type="personal">
45           <displayForm><xsl:value-of select="."/></displayForm>
46         </name>
47       </xsl:for-each>
48       <xsl:for-each select="pz:metadata[@type='description']">
49         <abstract type="description"><xsl:value-of select="."/></abstract>
50       </xsl:for-each>
51       <xsl:for-each select="pz:metadata[@type='subject']">
52         <subject>
53           <topic><xsl:value-of select="."/></topic>
54         </subject>
55       </xsl:for-each>
56       <id:relevance>$RELEVANCE</id:relevance>
57       <!-- <location> is repeatable for multiple holdings -->
58       <location>
59         <holdingSimple>
60           <copyInformation>
61             <subLocation>
62               <xsl:value-of select="pz:metadata[@type='locallocation']"/>
63             </subLocation>
64             <shelfLocator>
65               <xsl:value-of select="pz:metadata[@type='callnumber']"/>
66             </shelfLocator>
67             <id:circ>
68               <id:available><xsl:value-of select="normalize-space(pz:metadata[@type='available'])"/></id:available>
69               <id:due>$DUE</id:due>
70             </id:circ>
71           </copyInformation>
72         </holdingSimple>
73       </location>
74       <relatedItem type="host">
75         <titleInfo>
76           <title><xsl:value-of select="pz:metadata[@type='journal-title']"/></title>
77           <!-- or -->
78           <title><xsl:value-of select="pz:metadata[@type='series-title']"/></title>
79           <!-- or -->
80           <title>$BOOKTITLE</title>
81         </titleInfo>
82         <part>
83           <detail type="volume">
84             <number><xsl:value-of select="pz:metadata[@type='volume']"/></number>
85           </detail>
86           <detail type="issue">
87             <number>$ISSUE</number>
88           </detail>
89           <extent unit="pages">
90             <start>$STARTPAGE</start>
91             <end>$ENDPAGE</end>
92           </extent>
93         </part>
94       </relatedItem>
95       <physicalDescription>
96         <form><xsl:value-of select="pz:metadata[@type='physical-format']"/></form>
97         <internetMediaType>$FORMAT</internetMediaType>
98         <extent><xsl:value-of select="pz:metadata[@type='physical-extent']"/></extent>
99       </physicalDescription>
100       <id:citation>$CITATION</id:citation>
101       <identifier type="issn">$ISSN</identifier>
102       <identifier type="isbn"><xsl:value-of select="pz:metadata[@type='isbn']"/></identifier>
103       <identifier><xsl:value-of select="pz:metadata[@type='id']"/></identifier>
104       <accessCondition type="copyright">$COPYRIGHT</accessCondition>
105       <accessCondition type="copyrightabstract">$COPYRIGHTABSTRACT</accessCondition>
106       <language usage="primary">
107         <languageTerm type="text">$LANGUAGEITEM</languageTerm>
108       </language>
109       <language objectPart="summary">
110         <languageTerm type="text">$LANGUAGEABSTRACT</languageTerm>
111       </language>
112     </mods>
113   </xsl:template>
114 </xsl:stylesheet>