|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | | -<xsl:stylesheet version="1.0" |
3 | | - xmlns:mcrxml="xalan://org.mycore.common.xml.MCRXMLFunctions" |
| 2 | +<xsl:stylesheet version="3.0" |
| 3 | + xmlns:mcrclassification="http://www.mycore.de/xslt/classification" |
4 | 4 | xmlns:mets="http://www.loc.gov/METS/" |
5 | 5 | xmlns:mods="http://www.loc.gov/mods/v3" |
6 | 6 | xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
7 | | - xmlns:xalan="http://xml.apache.org/xalan" |
| 7 | + xmlns:xlink="http://www.w3.org/1999/xlink" |
8 | 8 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
9 | | - exclude-result-prefixes="mcrxml xalan"> |
| 9 | + exclude-result-prefixes="#all"> |
10 | 10 |
|
11 | | - <xsl:param name="WebApplicationBaseURL" /> |
12 | | - <xsl:param name="objectID" /> |
13 | 11 | <xsl:param name="license" select="'CC-BY-NC-SA'" /> |
14 | 12 | <xsl:param name="MIR.DFGViewer.DV.Owner" select="''" /> |
15 | 13 | <xsl:param name="MIR.DFGViewer.DV.OwnerLogo" select="''" /> |
|
33 | 31 |
|
34 | 32 | <xsl:variable name="derivateOwnerId"> |
35 | 33 | <xsl:choose> |
36 | | - <!-- it is derivate --> |
37 | 34 | <xsl:when test="$derobject"> |
38 | | - <xsl:value-of select="mcrxml:getMCRObjectID($derobject)" /> |
| 35 | + <xsl:value-of |
| 36 | + select="(document(concat('mcrobject:', $derobject))/mycorederivate/derivate/linkmetas/linkmeta/@xlink:href, $objectID)[1]" /> |
39 | 37 | </xsl:when> |
40 | 38 | <xsl:otherwise> |
41 | | - <!--it is a regular mcrobj --> |
42 | 39 | <xsl:value-of select="$mcrobject" /> |
43 | 40 | </xsl:otherwise> |
44 | 41 | </xsl:choose> |
|
53 | 50 | <mets:mdWrap MIMETYPE="text/xml" MDTYPE="OTHER" OTHERMDTYPE="DVRIGHTS"> |
54 | 51 | <mets:xmlData> |
55 | 52 | <dv:rights xmlns:dv="http://dfg-viewer.de/"> |
56 | | - <!-- owner name --> |
57 | 53 | <dv:owner><xsl:value-of select="$MIR.DFGViewer.DV.Owner" /></dv:owner> |
58 | 54 | <dv:ownerLogo><xsl:value-of select="$MIR.DFGViewer.DV.OwnerLogo" /></dv:ownerLogo> |
59 | 55 | <dv:ownerSiteURL><xsl:value-of select="$MIR.DFGViewer.DV.OwnerSiteURL" /></dv:ownerSiteURL> |
60 | | - <dv:ownerContact/> |
| 56 | + <dv:ownerContact /> |
61 | 57 | <dv:license> |
62 | 58 | <xsl:choose> |
63 | 59 | <xsl:when test="$entity/mycoreobject/metadata/def.modsContainer/modsContainer/mods:mods/mods:accessCondition[@type='use and reproduction']"> |
64 | | - <xsl:variable name="licenseClass" select="'mir_licenses'" /> |
65 | | - <xsl:variable name="licenseId" select="substring-after($entity/mycoreobject/metadata/def.modsContainer/modsContainer/mods:mods/mods:accessCondition[@type='use and reproduction']/@xlink-href, '#')" /> |
66 | | - <xsl:value-of select="mcrxml:getDisplayName($licenseClass, $licenseId)" /> |
| 60 | + <xsl:variable name="licenseId" |
| 61 | + select="substring-after($entity/mycoreobject/metadata/def.modsContainer/modsContainer/mods:mods/mods:accessCondition[@type='use and reproduction']/@xlink:href, '#')" /> |
| 62 | + <xsl:value-of |
| 63 | + select="( |
| 64 | + mcrclassification:label-text($CurrentLang, mcrclassification:category('mir_licenses', $licenseId)), |
| 65 | + mcrclassification:label-text($DefaultLang, mcrclassification:category('mir_licenses', $licenseId)) |
| 66 | + )[1]" /> |
67 | 67 | </xsl:when> |
68 | 68 | <xsl:otherwise> |
69 | 69 | <xsl:value-of select="$license" /> |
|
74 | 74 | </mets:xmlData> |
75 | 75 | </mets:mdWrap> |
76 | 76 | </mets:rightsMD> |
77 | | - <mets:digiprovMD> |
78 | | - <xsl:attribute name="ID"> |
79 | | - <xsl:value-of select="concat('digiprovMD',$sectionID)" /> |
80 | | - </xsl:attribute> |
| 77 | + <mets:digiprovMD ID="{concat('digiprovMD', $sectionID)}"> |
81 | 78 | <mets:mdWrap MIMETYPE="text/xml" MDTYPE="OTHER" OTHERMDTYPE="DVLINKS"> |
82 | 79 | <mets:xmlData> |
83 | 80 | <dv:links xmlns:dv="http://dfg-viewer.de/"> |
84 | 81 | <xsl:variable name="ppn" |
85 | | - select="substring-after($entity/mycoreobject/metadata/def.modsContainer/modsContainer/mods:mods/mods:identifier[@type='uri'], ':ppn:')" /> |
| 82 | + select="substring-after($entity/mycoreobject/metadata/def.modsContainer/modsContainer/mods:mods/mods:identifier[@type='uri'], ':ppn:')" /> |
86 | 83 | <xsl:if test="$ppn"> |
87 | 84 | <dv:reference> |
88 | 85 | <xsl:variable name="catalogURL" |
89 | | - select="concat(substring-before($MIR.DFGViewer.DV.OPAC.CATALOG.URL, '{PPN}'), $ppn , substring-after($MIR.DFGViewer.DV.OPAC.CATALOG.URL, '{PPN}'))" /> |
| 86 | + select="concat(substring-before($MIR.DFGViewer.DV.OPAC.CATALOG.URL, '{PPN}'), $ppn, substring-after($MIR.DFGViewer.DV.OPAC.CATALOG.URL, '{PPN}'))" /> |
90 | 87 | <xsl:variable name="uriResolved" |
91 | | - select="document(concat($catalogURL,'?format=xml'))//rdf:Description[@rdf:about=normalize-space($catalogURL)]/*[local-name() = 'page']/@rdf:resource" /> |
| 88 | + select="document(concat($catalogURL, '?format=xml'))//rdf:Description[@rdf:about=normalize-space($catalogURL)]/*[local-name()='page']/@rdf:resource" /> |
92 | 89 | <xsl:value-of select="$uriResolved" /> |
93 | 90 | </dv:reference> |
94 | 91 | </xsl:if> |
95 | 92 | <dv:presentation> |
96 | 93 | <xsl:choose> |
97 | 94 | <xsl:when test="$mcrobject"> |
98 | | - <xsl:value-of select="concat($WebApplicationBaseURL,'receive/',$mcrobject)" /> |
| 95 | + <xsl:value-of select="concat($WebApplicationBaseURL, 'receive/', $mcrobject)" /> |
99 | 96 | </xsl:when> |
100 | 97 | <xsl:when test="$derobject"> |
101 | | - <xsl:value-of select="concat($WebApplicationBaseURL,'receive/',mcrxml:getMCRObjectID($derobject))" /> |
| 98 | + <xsl:value-of select="concat($WebApplicationBaseURL, 'receive/', $derivateOwnerId)" /> |
102 | 99 | </xsl:when> |
103 | 100 | </xsl:choose> |
104 | 101 | </dv:presentation> |
|
0 commit comments