- use latest prettier 3.0 with eslint-plugin-prettier: 5.0.0-alpha.2

- npm normal updates
- add all xslt and style asstes in extra folder public/assets2
- linting corrections
- delete local .env.test from git tracking: git rm --cached .env.test
- add .env.test into .gitignore file
- add edit functionality for editing by submitter
- npm updates
-added xslt3 packeage for builfing sef files
- added Language.ts class vor language table
- added version to datasetxml2oai-pmh.xslt
This commit is contained in:
Kaimbacher 2023-07-17 19:13:30 +02:00
parent f403c3109f
commit 4714dfdd94
70 changed files with 22920 additions and 17407 deletions

View file

@ -0,0 +1,760 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="3.0"
xmlns="http://www.openarchives.org/OAI/2.0/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">
<!-- add include here for each new metadata format -->
<xsl:include href="oai_datacite.xslt" />
<xsl:include href="oai_2_iso19139.xslt" />
<xsl:output method="xml" indent="yes" encoding="utf-8" />
<xsl:param name="responseDate" />
<xsl:param name="unixTimestamp" />
<xsl:param name="email" />
<xsl:param name="earliestDatestamp" />
<xsl:param name="repositoryName" />
<xsl:param name="repIdentifier" />
<xsl:param name="doiPrefix" />
<xsl:param name="sampleIdentifier" />
<xsl:param name="dateDelete" />
<xsl:param name="totalIds" />
<xsl:param name="res" />
<xsl:param name="cursor" />
<xsl:param name="oai_verb" />
<xsl:param name="oai_metadataPrefix" />
<xsl:param name="oai_error_code" />
<xsl:param name="oai_error_message" />
<xsl:param name="baseURL" />
<!-- <xsl:param name="setPubType" />
<xsl:param name="downloadLink" />
<xsl:param name="doiLink" />
<xsl:param name="docId" />
<xsl:param name="repURL" />
<xsl:param name="oai_resumptionToken" />
<xsl:param name="oai_identifier" />
<xsl:param name="oai_from" />
<xsl:param name="oai_until" />
<xsl:param name="oai_set" /> -->
<xsl:variable name="langCodes" select="document('langCodeMap.xml')/langCodeMap/langCode"/>
<!-- Characters we'll support.
We could add control chars 0-31 and 127-159, but we won't. -->
<xsl:variable name="ascii"> !"#$%&amp;'()*+,-./0123456789:;&lt;=&gt;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~</xsl:variable>
<xsl:variable name="latin1">&#160;&#161;&#162;&#163;&#164;&#165;&#166;&#167;&#168;&#169;&#170;&#171;&#172;&#173;&#174;&#175;&#176;&#177;&#178;&#179;&#180;&#181;&#182;&#183;&#184;&#185;&#186;&#187;&#188;&#189;&#190;&#191;&#192;&#193;&#194;&#195;&#196;&#197;&#198;&#199;&#200;&#201;&#202;&#203;&#204;&#205;&#206;&#207;&#208;&#209;&#210;&#211;&#212;&#213;&#214;&#215;&#216;&#217;&#218;&#219;&#220;&#221;&#222;&#223;&#224;&#225;&#226;&#227;&#228;&#229;&#230;&#231;&#232;&#233;&#234;&#235;&#236;&#237;&#238;&#239;&#240;&#241;&#242;&#243;&#244;&#245;&#246;&#247;&#248;&#249;&#250;&#251;&#252;&#253;&#254;&#255;</xsl:variable>
<!-- Characters that usually don't need to be escaped -->
<xsl:variable name="safe">!'()*-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~</xsl:variable>
<xsl:variable name="hex" >0123456789ABCDEF</xsl:variable>
<xsl:template name="url-encode">
<xsl:param name="str"/>
<xsl:if test="$str">
<xsl:variable name="first-char" select="substring($str,1,1)"/>
<xsl:choose>
<xsl:when test="contains($safe,$first-char)">
<xsl:value-of select="$first-char"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="codepoint">
<xsl:choose>
<xsl:when test="contains($ascii,$first-char)">
<xsl:value-of select="string-length(substring-before($ascii,$first-char)) + 32"/>
</xsl:when>
<xsl:when test="contains($latin1,$first-char)">
<xsl:value-of select="string-length(substring-before($latin1,$first-char)) + 160"/>
</xsl:when>
<xsl:otherwise>
<xsl:message terminate="no">Warning: string contains a character that is out of range! Substituting "?".</xsl:message>
<xsl:text>63</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="hex-digit1" select="substring($hex,floor($codepoint div 16) + 1,1)"/>
<xsl:variable name="hex-digit2" select="substring($hex,$codepoint mod 16 + 1,1)"/>
<xsl:value-of select="concat('%',$hex-digit1,$hex-digit2)"/>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="string-length($str) &gt; 1">
<xsl:call-template name="url-encode">
<xsl:with-param name="str" select="substring($str,2)"/>
</xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:template>
<!--create the head of oai response -->
<xsl:template match="/root">
<!-- stylesheet for browser -->
<xsl:processing-instruction name="xml-stylesheet">
<xsl:text>type="text/xsl" href="assets2/oai2_style.xslt"</xsl:text>
</xsl:processing-instruction>
<OAI-PMH xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">
<responseDate>
<xsl:value-of select="$responseDate" />
</responseDate>
<request>
<xsl:if test="$oai_verb != ''">
<xsl:attribute name="verb">
<xsl:value-of select="$oai_verb" />
</xsl:attribute>
</xsl:if>
<xsl:if test="$oai_metadataPrefix != ''">
<xsl:attribute name="metadataPrefix">
<xsl:value-of select="$oai_metadataPrefix" />
</xsl:attribute>
</xsl:if>
<xsl:value-of select="$baseURL" />
</request>
<xsl:if test="string($oai_error_code) != ''">
<error>
<xsl:attribute name="code">
<xsl:value-of select="string($oai_error_code)" />
</xsl:attribute>
<xsl:value-of select="$oai_error_message" />
</error>
</xsl:if>
<!--create the rest of oai response depending on oai_verb -->
<xsl:choose>
<xsl:when test="$oai_verb='GetRecord'">
<xsl:apply-templates select="Datasets" mode="GetRecord" />
</xsl:when>
<xsl:when test="$oai_verb='Identify'">
<xsl:apply-templates select="Datasets" mode="Identify" />
</xsl:when>
<xsl:when test="$oai_verb='ListIdentifiers'">
<xsl:apply-templates select="Datasets" mode="ListIdentifiers" />
</xsl:when>
<xsl:when test="$oai_verb='ListMetadataFormats'">
<xsl:apply-templates select="Datasets" mode="ListMetadataFormats" />
</xsl:when>
<xsl:when test="$oai_verb='ListRecords'">
<xsl:apply-templates select="Datasets" mode="ListRecords" />
</xsl:when>
<xsl:when test="$oai_verb='ListSets'">
<xsl:apply-templates select="Datasets" mode="ListSets" />
</xsl:when>
</xsl:choose>
</OAI-PMH>
</xsl:template>
<!-- template for Identiy -->
<xsl:template match="Datasets" mode="Identify">
<Identify>
<repositoryName>
<xsl:value-of select="$repositoryName" />
</repositoryName>
<baseURL>
<xsl:value-of select="$baseURL" />
</baseURL>
<protocolVersion>
<xsl:text>2.0</xsl:text>
</protocolVersion>
<adminEmail>
<xsl:value-of select="$email" />
</adminEmail>
<earliestDatestamp>
<xsl:value-of select="$earliestDatestamp" />
</earliestDatestamp>
<deletedRecord>
<xsl:text>persistent</xsl:text>
</deletedRecord>
<granularity>
<xsl:text>YYYY-MM-DDThh:mm:ssZ</xsl:text>
</granularity>
<description>
<oai-identifier xmlns="http://www.openarchives.org/OAI/2.0/oai-identifier" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai-identifier http://www.openarchives.org/OAI/2.0/oai-identifier.xsd">
<scheme>
<xsl:text>oai</xsl:text>
</scheme>
<repositoryIdentifier>
<xsl:value-of select="$repIdentifier" />
</repositoryIdentifier>
<delimiter>
<xsl:text>:</xsl:text>
</delimiter>
<sampleIdentifier>
<xsl:value-of select="$sampleIdentifier" />
</sampleIdentifier>
</oai-identifier>
</description>
<!-- <description>
<eprints xmlns="http://www.openarchives.org/OAI/1.1/eprints" xsi:schemaLocation="http://www.openarchives.org/OAI/1.1/eprints http://www.openarchives.org/OAI/1.1/eprints.xsd">
<content>
<text>
Tethys RDR ist ein Datenverlag der Geologischen Bundesanstalt (GBA), der ausschließlich an der GBA generierte geowissenschaftliche Forschungsdaten publiziert.
Die Datenpublikationen können sowohl in deutscher, als auch in englischer Sprache publiziert werden.
Durch die Bereitstellung der Datenpublikation zusammen mit Metadaten nach standardisierten Schemata werden die Publikationen auffindbar und zitierbar.
</text>
<URL>https://tethys.at/help</URL>
</content>
<metadataPolicy>
<text>
All bibliographic metadata provided via this interface, except abstracts, is hereby made available under CC0 license, free to share and re-use.
</text>
<URL>http://creativecommons.org/publicdomain/zero/1.0/deed.de</URL>
</metadataPolicy>
<comment>
This institutional repository is powered by the Tethys repository software,
which is an enhancement of OPSUS4 (https://www.kobv.de/entwicklung/software/opus-4/).
See https://gitea.geologie.ac.at/geolba/tethys/ for more information.
</comment>
</eprints>
</description> -->
</Identify>
</xsl:template>
<!-- template for ListMetadataFormats -->
<xsl:template match="Datasets" mode="ListMetadataFormats">
<ListMetadataFormats>
<metadataFormat>
<metadataPrefix>
<xsl:text>oai_dc</xsl:text>
</metadataPrefix>
<schema>
<xsl:text>http://www.openarchives.org/OAI/2.0/oai_dc.xsd</xsl:text>
</schema>
<metadataNamespace>
<xsl:text>http://www.openarchives.org/OAI/2.0/oai_dc/</xsl:text>
</metadataNamespace>
</metadataFormat>
<metadataFormat>
<metadataPrefix>
<xsl:text>oai_datacite</xsl:text>
</metadataPrefix>
<schema>
<xsl:text>http://schema.datacite.org/meta/kernel-4.3/metadata.xsd</xsl:text>
</schema>
<metadataNamespace>
<xsl:text>http://datacite.org/schema/kernel-4</xsl:text>
</metadataNamespace>
</metadataFormat>
<metadataFormat>
<metadataPrefix>iso19139</metadataPrefix>
<schema>http://www.isotc211.org/2005/gmd/gmd.xsd</schema>
<metadataNamespace>http://www.isotc211.org/2005/gmd</metadataNamespace>
</metadataFormat>
</ListMetadataFormats>
</xsl:template>
<xsl:template match="Datasets" mode="ListSets">
<ListSets>
<xsl:apply-templates select="Rdr_Sets" />
</ListSets>
</xsl:template>
<xsl:template match="Rdr_Sets">
<set>
<setSpec>
<xsl:value-of select="@Type" />
</setSpec>
<setName>
<xsl:value-of select="@TypeName" />
</setName>
</set>
</xsl:template>
<xsl:template match="Datasets" mode="ListIdentifiers">
<xsl:if test="count(Rdr_Dataset) > 0">
<ListIdentifiers>
<xsl:apply-templates select="Rdr_Dataset" />
<xsl:if test="number($totalIds) > 0">
<resumptionToken>
<xsl:attribute name="expirationDate">
<xsl:value-of select="$dateDelete" />
</xsl:attribute>
<xsl:attribute name="completeListSize">
<xsl:value-of select="$totalIds" />
</xsl:attribute>
<xsl:attribute name="cursor">
<xsl:value-of select="$cursor" />
</xsl:attribute>
<xsl:value-of select="$res" />
</resumptionToken>
</xsl:if>
</ListIdentifiers>
</xsl:if>
</xsl:template>
<xsl:template match="Datasets" mode="ListRecords">
<xsl:if test="count(Rdr_Dataset) > 0">
<ListRecords>
<xsl:apply-templates select="Rdr_Dataset" />
<xsl:if test="number($totalIds) > 0">
<resumptionToken>
<xsl:attribute name="expirationDate">
<xsl:value-of select="$dateDelete" />
</xsl:attribute>
<xsl:attribute name="completeListSize">
<xsl:value-of select="$totalIds" />
</xsl:attribute>
<xsl:attribute name="cursor">
<xsl:value-of select="$cursor" />
</xsl:attribute>
<xsl:value-of select="$res" />
</resumptionToken>
</xsl:if>
</ListRecords>
</xsl:if>
</xsl:template>
<xsl:template match="Datasets" mode="GetRecord">
<GetRecord>
<xsl:apply-templates select="Rdr_Dataset" />
</GetRecord>
</xsl:template>
<xsl:template match="Rdr_Dataset">
<xsl:choose>
<xsl:when test="$oai_verb='ListIdentifiers'">
<xsl:call-template name="Rdr_Dataset_Data" />
</xsl:when>
<xsl:otherwise>
<record>
<xsl:call-template name="Rdr_Dataset_Data" />
</record>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="Rdr_Dataset_Data">
<header>
<xsl:if test="@ServerState='deleted'">
<xsl:attribute name="status">
<xsl:text>deleted</xsl:text>
</xsl:attribute>
</xsl:if>
<identifier>
<xsl:text>oai:</xsl:text>
<xsl:value-of select="$repIdentifier" />
<xsl:text>:</xsl:text>
<xsl:value-of select="@PublishId" />
</identifier>
<datestamp>
<xsl:choose>
<xsl:when test="ServerDateModified">
<xsl:variable name="dateModified" select="concat(
ServerDateModified/@Year, '-',
format-number(number(ServerDateModified/@Month),'00'), '-',
format-number(number(ServerDateModified/@Day),'00'), 'T',
format-number(number(ServerDateModified/@Hour),'00'), ':',
format-number(number(ServerDateModified/@Minute),'00'), ':',
format-number(number(ServerDateModified/@Second),'00'), 'Z'
)" />
<xsl:value-of select="$dateModified" />
</xsl:when>
<xsl:otherwise>
<xsl:variable name="datePublished" select="concat(
ServerDatePublished/@Year, '-',
format-number(number(ServerDatePublished/@Month),'00'), '-',
format-number(number(ServerDatePublished/@Day),'00'), 'T',
format-number(number(ServerDatePublished/@Hour),'00'), ':',
format-number(number(ServerDatePublished/@Minute),'00'), ':',
format-number(number(ServerDatePublished/@Second),'00'), 'Z'
)" />
<xsl:value-of select="$datePublished" />
</xsl:otherwise>
</xsl:choose>
</datestamp>
<!--<setSpec>
<xsl:value-of select="SetSpec/@Value"/>
</setSpec>-->
<!--loop-->
<xsl:apply-templates select="SetSpec" />
<setSpec>
<xsl:text>open_access</xsl:text>
</setSpec>
<setSpec>
<xsl:text>doc-type:ResearchData</xsl:text>
</setSpec>
</header>
<xsl:choose>
<!-- nicht bei ListIdentifiers und auch nicht bei gelöschten Datensätzen-->
<xsl:when test="$oai_verb!='ListIdentifiers' and @ServerState!='deleted'">
<metadata>
<!-- <xsl:value-of select="$oai_metadataPrefix" /> -->
<xsl:choose>
<xsl:when test="$oai_metadataPrefix='oai_dc'">
<xsl:apply-templates select="." mode="oai_dc" />
</xsl:when>
<xsl:when test="$oai_metadataPrefix='oai_datacite'">
<xsl:apply-templates select="." mode="oai_datacite" />
</xsl:when>
<xsl:when test="$oai_metadataPrefix='iso19139'">
<xsl:apply-templates select="." mode="iso19139" />
</xsl:when>
</xsl:choose>
</metadata>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="SetSpec">
<setSpec>
<xsl:value-of select="@Value" />
</setSpec>
</xsl:template>
<xsl:template match="Rdr_Dataset" mode="oai_dc">
<oai_dc:dc xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
<!-- dc:title -->
<xsl:apply-templates select="TitleMain" mode="oai_dc" />
<!-- dc:title -->
<xsl:apply-templates select="TitleAdditional" mode="oai_dc" />
<!--<dc:creator>-->
<!-- Creator: Autor (falls vorhanden), sonst Herausgeber (falls vorhanden), sonst Urhebende Koerperschaft -->
<xsl:choose>
<xsl:when test="PersonAuthor">
<xsl:apply-templates select="PersonAuthor" mode="oai_dc">
<xsl:sort select="@SortOrder"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="@CreatingCorporation">
<dc:creator>
<xsl:value-of select="@CreatingCorporation" />
</dc:creator>
</xsl:when>
</xsl:choose>
<!-- dc:subject -->
<xsl:apply-templates select="Subject" mode="oai_dc" />
<xsl:apply-templates select="Collection" mode="oai_dc" />
<!-- dc:description -->
<xsl:apply-templates select="TitleAbstract" mode="oai_dc" />
<!-- dc:description -->
<xsl:apply-templates select="TitleAbstractAdditional" mode="oai_dc" />
<!-- dc:publisher -->
<dc:publisher>
<!-- <xsl:value-of select="@PublisherName" /> -->
<xsl:value-of select="@CreatingCorporation" />
</dc:publisher>
<!-- dc:contributor -->
<xsl:apply-templates select="PersonContributor" mode="oai_dc">
<xsl:sort select="@SortOrder"/>
</xsl:apply-templates>
<!-- dc:date (call-template, weil die 'Funktion' nur einmal aufgerufen werden soll, nicht einmal für jedes Date-->
<xsl:call-template name="RdrDate" />
<!-- dc:date: embargo date -->
<xsl:apply-templates select="EmbargoDate" mode="oai_dc" />
<!-- dc:type -->
<dc:type> <xsl:text>Dataset</xsl:text></dc:type>
<dc:type>
<xsl:text>doc-type:ResearchData</xsl:text>
</dc:type>
<!-- dc:format -->
<xsl:apply-templates select="File/@MimeType" mode="oai_dc" />
<!-- <dc:format> -->
<xsl:apply-templates select="File" mode="oai_dc" />
<!-- dc:identifier -->
<!-- <xsl:if test="Identifier">
<xsl:apply-templates select="Identifier" mode="oai_dc" />
</xsl:if> -->
<dc:identifier>
<xsl:value-of select="string(@landingpage)" />
<!-- <xsl:call-template name="url-encode">
<xsl:with-param name="str" select="@landingpage"/>
</xsl:call-template> -->
</dc:identifier>
<!-- dc:language -->
<xsl:apply-templates select="@Language" mode="oai_dc" />
<!-- dc:relation -->
<xsl:if test="Identifier">
<xsl:apply-templates select="Identifier" mode="oai_dc" />
</xsl:if>
<xsl:apply-templates select="Reference" mode="oai_dc" />
<!-- dc:coverage -->
<xsl:apply-templates select="Coverage" mode="oai_dc" />
<!-- dc:rights -->
<xsl:apply-templates select="Licence" mode="oai_dc" />
<xsl:if test="EmbargoDate and ($unixTimestamp &lt; EmbargoDate/@UnixTimestamp)">
<dc:rights>embargo</dc:rights>
</xsl:if>
<!-- dc:source -->
<xsl:call-template name="citation"/>
</oai_dc:dc>
</xsl:template>
<xsl:template name="citation">
<dc:source>
<xsl:variable name="creatorName">
<xsl:for-each select="*[name() = 'PersonAuthor']">
<xsl:variable name="person" select="."/>
<xsl:variable name="uppercase" select="'ABC..XYZ'"/>
<xsl:variable name="lowercase" select="'abc..zyz'"/>
<xsl:variable name="authorName">
<xsl:choose>
<xsl:when test="string($person/@FirstName)">
<xsl:variable name="name" select="concat(
$person/@LastName, ', ', concat(translate(substring($person/@FirstName, 1, 1), $lowercase, $uppercase), '.')
)" />
<xsl:value-of select="$name"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$person/@LastName"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="normalize-space($authorName)"/>
<xsl:choose>
<xsl:when test="position() != last()">,</xsl:when>
</xsl:choose>
</xsl:for-each>
</xsl:variable>
<xsl:variable name="year" select="concat( ' (', string(ServerDatePublished/@Year), '): ' )" />
<xsl:variable name="mainTitle" select="string(TitleMain/@Value)" />
<xsl:variable name="creatingCorporation" select="concat('.', string(@CreatingCorporation), ', ')" />
<xsl:variable name="publisherName" select="string(@PublisherName)" />
<xsl:value-of select="concat($creatorName, $year, $mainTitle, $creatingCorporation, $publisherName, ', Wien')"/>
</dc:source>
</xsl:template>
<xsl:template match="Coverage" mode="oai_dc">
<dc:coverage>
<xsl:variable name="geolocation" select="concat(
'SOUTH-BOUND LATITUDE: ', @YMin,
' * WEST-BOUND LONGITUDE: ', @XMin,
' * NORTH-BOUND LATITUDE: ', @YMax,
' * EAST-BOUND LONGITUDE: ', @XMax
)" />
<xsl:value-of select="$geolocation" />
<!-- <xsl:text>&#xA;</xsl:text> -->
<xsl:if test="@ElevationMin != '' and @ElevationMax != ''">
<xsl:value-of select="concat(' * ELEVATION MIN: ', @ElevationMin, ' * ELEVATION MAX: ', @ElevationMax)" />
</xsl:if>
<xsl:if test="@ElevationAbsolut != ''">
<xsl:value-of select="concat(' * ELEVATION ABSOLUT: ', @ElevationAbsolut)" />
</xsl:if>
<!-- <xsl:text>&#xA;</xsl:text> -->
<xsl:if test="@DepthMin != '' and @DepthMax != ''">
<xsl:value-of select="concat(' * DEPTH MIN: ', @DepthMin, ' * DEPTH MAX: ', @DepthMax)" />
</xsl:if>
<xsl:if test="@DepthAbsolut != ''">
<xsl:value-of select="concat(' * DEPTH ABSOLUT: ', @DepthAbsolut)" />
</xsl:if>
<!-- <xsl:text>&#xA;</xsl:text> -->
<xsl:if test="@TimeMin != '' and @TimeMax != ''">
<xsl:value-of select="concat(' * TIME MIN: ', @TimeMin, ' * TIME MAX: ', @TimeMax)" />
</xsl:if>
<xsl:if test="@TimeAbsolut != ''">
<xsl:value-of select="concat(' * TIME ABSOLUT: ', @TimeAbsolut)" />
</xsl:if>
</dc:coverage>
</xsl:template>
<xsl:template match="TitleMain" mode="oai_dc">
<dc:title>
<xsl:attribute name="xml:lang">
<xsl:value-of select="@Language" />
</xsl:attribute>
<xsl:value-of select="@Value" />
</dc:title>
</xsl:template>
<xsl:template match="TitleAdditional" mode="oai_dc">
<dc:title>
<xsl:attribute name="xml:lang">
<xsl:value-of select="@Language" />
</xsl:attribute>
<xsl:value-of select="@Value" />
</dc:title>
</xsl:template>
<xsl:template match="TitleAbstract" mode="oai_dc">
<dc:description>
<xsl:attribute name="xml:lang">
<xsl:value-of select="@Language" />
</xsl:attribute>
<xsl:value-of select="@Value" />
</dc:description>
</xsl:template>
<xsl:template match="TitleAbstractAdditional" mode="oai_dc">
<dc:description>
<xsl:attribute name="xml:lang">
<xsl:value-of select="@Language" />
</xsl:attribute>
<xsl:value-of select="@Value" />
</dc:description>
</xsl:template>
<xsl:template match="Subject" mode="oai_dc">
<dc:subject>
<xsl:if test="@Language != ''">
<xsl:attribute name="xml:lang">
<xsl:value-of select="@Language" />
</xsl:attribute>
</xsl:if>
<xsl:value-of select="@Value" />
</dc:subject>
</xsl:template>
<xsl:template match="Collection" mode="oai_dc">
<dc:subject>
<!-- <xsl:if test="@Language != ''">
<xsl:attribute name="xml:lang">
<xsl:value-of select="@Language" />
</xsl:attribute>
</xsl:if> -->
<xsl:value-of select="concat(string(@Collectionrole.Name), ':', string(@Number))" />
</dc:subject>
</xsl:template>
<xsl:template match="Reference" mode="oai_dc">
<dc:relation>
<xsl:value-of select="string(@Value)" />
<!-- <xsl:call-template name="url-encode">
<xsl:with-param name="str" select="@Value"/>
</xsl:call-template> -->
</dc:relation>
</xsl:template>
<xsl:template match="PersonAuthor|PersonEditor" mode="oai_dc">
<dc:creator>
<xsl:value-of select="@LastName" />
<xsl:if test="@FirstName != ''">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:value-of select="@FirstName" />
<xsl:if test="@AcademicTitle != ''">
<xsl:text> (</xsl:text>
<xsl:value-of select="@AcademicTitle" />
<xsl:text>)</xsl:text>
</xsl:if>
</dc:creator>
</xsl:template>
<xsl:template match="PersonContributor" mode="oai_dc">
<dc:contributor>
<xsl:value-of select="@LastName" />
<xsl:if test="@FirstName != ''">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:value-of select="@FirstName" />
<xsl:if test="@AcademicTitle != ''">
<xsl:text> (</xsl:text>
<xsl:value-of select="@AcademicTitle" />
<xsl:text>)</xsl:text>
</xsl:if>
</dc:contributor>
</xsl:template>
<xsl:template name="RdrDate">
<dc:date>
<xsl:choose>
<xsl:when test="PublishedDate">
<xsl:variable name="publishedDate" select="concat(
PublishedDate/@Year, '-',
format-number(number(PublishedDate/@Month),'00'), '-',
format-number(number(PublishedDate/@Day),'00')
)" />
<xsl:value-of select="$publishedDate" />
</xsl:when>
<xsl:otherwise>
<xsl:variable name="serverDatePublished" select="concat(
ServerDatePublished/@Year, '-',
format-number(number(ServerDatePublished/@Month),'00'), '-',
format-number(number(ServerDatePublished/@Day),'00')
)" />
<xsl:value-of select="$serverDatePublished" />
</xsl:otherwise>
</xsl:choose>
</dc:date>
</xsl:template>
<xsl:template match="EmbargoDate" mode="oai_dc">
<xsl:if test="$unixTimestamp &lt; ./@UnixTimestamp">
<dc:date>
<xsl:text>info:eu-repo/date/embargoEnd/</xsl:text>
<xsl:value-of select="./@Year" />
-
<xsl:value-of select="format-number(number(./@Month),'00')" />
-
<xsl:value-of select="format-number(number(./@Day),'00')" />
</dc:date>
</xsl:if>
</xsl:template>
<!-- für ListRecords -->
<!-- <xsl:template match="@Type" mode="oai_dc">
<dc:type>
<xsl:value-of select="." />
</dc:type>
<dc:type>
<xsl:text>data-type:</xsl:text>
<xsl:value-of select="." />
</dc:type>
</xsl:template> -->
<xsl:template match="File/@MimeType" mode="oai_dc">
<dc:format>
<xsl:choose>
<xsl:when test=". = 'application/x-sqlite3'">
<xsl:text>application/geopackage+sqlite3</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="." />
</xsl:otherwise>
</xsl:choose>
</dc:format>
</xsl:template>
<!-- <xsl:template match="File" mode="oai_dc">
<dc:identifier>
<xsl:value-of select="@PathName" />
<xsl:value-of select="concat($downloadLink, @Id)" />
</dc:identifier>
</xsl:template> -->
<xsl:template match="Identifier" mode="oai_dc">
<dc:relation>
<!-- <xsl:value-of select="concat($doiLink, @Value)" /> -->
<xsl:value-of select="concat($doiPrefix, string(@Value))" />
<!-- <xsl:call-template name="url-encode">
<xsl:with-param name="str" select="concat($doiPrefix, @Value)"/>
</xsl:call-template> -->
</dc:relation>
</xsl:template>
<xsl:template match="@CreatingCorporation" mode="oai_dc">
<dc:language>
<xsl:value-of select="." />
</dc:language>
</xsl:template>
<xsl:template match="@Language" mode="oai_dc">
<xsl:variable name="language" select="string(.)"/>
<dc:language>
<!-- <xsl:value-of select="." /> -->
<xsl:value-of select="$langCodes[@iso639-1 = $language]/@iso639-2" />
</dc:language>
</xsl:template>
<xsl:template match="Licence" mode="oai_dc">
<dc:rights>
<xsl:value-of select="@NameLong" />
</dc:rights>
<xsl:if test="@Name = 'CC-BY-4.0' or @Name = 'CC-BY-SA-4.0'">
<dc:rights>
<xsl:text>info:eu-repo/semantics/openAccess</xsl:text>
</dc:rights>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

File diff suppressed because one or more lines are too long

BIN
public/assets2/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -0,0 +1,915 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://example.com/functions"
xmlns:gml="http://www.opgeris.net/gml/3.2"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:gmx="http://www.isotc211.org/2005/gmx"
xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:gco="http://www.isotc211.org/2005/gco"
exclude-result-prefixes="#all"
expand-text="yes"
version="3.0">
<xsl:variable name="resourcetype">
<!-- <xsl:value-of select="//*[local-name() = 'resourceType']/@resourceTypeGeneral"/> -->
<xsl:text>Dataset</xsl:text>
</xsl:variable>
<xsl:variable name="MDScopecode">
<xsl:choose>
<xsl:when test="$resourcetype = 'Dataset'">dataset</xsl:when>
<xsl:when test="$resourcetype = 'Software'">software</xsl:when>
<xsl:when test="$resourcetype = 'Service'">service</xsl:when>
<xsl:when test="$resourcetype = 'Model'">model</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$resourcetype"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="MDScopelist">
<xsl:choose>
<xsl:when test="$resourcetype = 'Dataset' or $resourcetype = 'Software' or $resourcetype = 'Service' or $resourcetype = 'Model'">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_ScopeCode</xsl:when>
<xsl:otherwise>http://datacite.org/schema/kernel-4</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="datacentre">
<xsl:choose>
<xsl:when test="string-length(normalize-space(@CreatingCorporation)) > 0">
<xsl:value-of select="normalize-space(@CreatingCorporation)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="string('Tethys RDR')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- <xsl:function name="fn:FormatDate" as="xs:string">
<xsl:param name="DateTime" as="xs:string" />
<xsl:variable name="date">
<xsl:value-of select="substring-before($DateTime,'T')" />
</xsl:variable>
<xsl:if test="string-length($date) = 10">
<xsl:value-of select="$date"/>
</xsl:if>
</xsl:function> -->
<!--gmd:hierarchyLevel template-->
<xsl:template name="hierarchylevel">
<gmd:hierarchyLevel>
<gmd:MD_ScopeCode>
<xsl:attribute name="codeList">
<xsl:value-of select="$MDScopelist"/>
</xsl:attribute>
<xsl:attribute name="codeListValue">
<xsl:value-of select="$MDScopecode"/>
</xsl:attribute>
<xsl:value-of select="$MDScopecode"/>
</gmd:MD_ScopeCode>
</gmd:hierarchyLevel>
</xsl:template>
<!-- gmd:contact template-->
<xsl:template name="metadatacontact">
<gmd:contact>
<gmd:CI_ResponsibleParty>
<gmd:individualName>
<gco:CharacterString>Tethys RDR</gco:CharacterString>
</gmd:individualName>
<gmd:organisationName>
<gco:CharacterString>Tethys RDR</gco:CharacterString>
</gmd:organisationName>
<gmd:positionName>
<gco:CharacterString>Research Data Repository</gco:CharacterString>
</gmd:positionName>
<gmd:contactInfo>
<gmd:CI_Contact>
<gmd:address>
<gmd:CI_Address>
<gmd:deliveryPoint>
<gco:CharacterString>Neulinggasse 38</gco:CharacterString>
</gmd:deliveryPoint>
<gmd:city>
<gco:CharacterString>Vienna</gco:CharacterString>
</gmd:city>
<gmd:administrativeArea>
<gco:CharacterString>Vienna</gco:CharacterString>
</gmd:administrativeArea>
<gmd:postalCode>
<gco:CharacterString>1030</gco:CharacterString>
</gmd:postalCode>
<gmd:country>
<gco:CharacterString>AT</gco:CharacterString>
</gmd:country>
<gmd:electronicMailAddress>
<gco:CharacterString>repository@geologie.ac.at</gco:CharacterString>
</gmd:electronicMailAddress>
</gmd:CI_Address>
</gmd:address>
<!-- only allow one online resource; choose the logo...-->
<gmd:onlineResource>
<gmd:CI_OnlineResource>
<gmd:linkage>
<gmd:URL>https://tethys.at</gmd:URL>
</gmd:linkage>
<gmd:function>
<gmd:CI_OnLineFunctionCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_OnLineFunctionCode" codeListValue="information">information</gmd:CI_OnLineFunctionCode>
</gmd:function>
</gmd:CI_OnlineResource>
</gmd:onlineResource>
</gmd:CI_Contact>
</gmd:contactInfo>
<gmd:role>
<gmd:CI_RoleCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#CI_RoleCode" codeListValue="pointOfContact">pointOfContact</gmd:CI_RoleCode>
</gmd:role>
</gmd:CI_ResponsibleParty>
</gmd:contact>
</xsl:template>
<!-- retrieves basic reference dates of the resource
Handles created date, publication (Available) date, and revision date-->
<!-- stower 2022, Created auf created geändert -->
<xsl:template name="resourcedates">
<xsl:if test="*[name() = 'CreatedAt']">
<gmd:date>
<gmd:CI_Date>
<gmd:date>
<!-- <xsl:variable name="theDate" select="normalize-space(*[name() = 'CreatedAt'])"/> -->
<xsl:variable name="theDate">
<xsl:value-of select="normalize-space(concat(
CreatedAt/@Year, '-',
format-number(number(CreatedAt/@Month),'00'), '-',
format-number(number(CreatedAt/@Day),'00'), 'T',
format-number(number(CreatedAt/@Hour),'00'), ':',
format-number(number(CreatedAt/@Minute),'00'), ':',
format-number(number(CreatedAt/@Second),'00'), 'Z'
))"/>
</xsl:variable>
<!-- ieda dataCite labels metadata update date in the date string to avoid ambiguity -->
<xsl:choose>
<xsl:when test="$theDate != ''">
<xsl:choose>
<xsl:when test="contains($theDate, 'T')">
<gco:DateTime>
<xsl:value-of select="$theDate"/>
</gco:DateTime>
</xsl:when>
<xsl:when test="contains($theDate, ' ')">
<gco:DateTime>
<xsl:value-of select="translate($theDate, ' ', 'T')"/>
</gco:DateTime>
</xsl:when>
<xsl:otherwise>
<gco:Date>
<xsl:value-of select="$theDate"/>
</gco:Date>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<!-- other write the output of missing -->
<xsl:otherwise>
<xsl:attribute name="gco:nilReason">
<xsl:value-of select="string('created date missing')"/>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</gmd:date>
<gmd:dateType>
<gmd:CI_DateTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode" codeListValue="creation">creation</gmd:CI_DateTypeCode>
</gmd:dateType>
</gmd:CI_Date>
</gmd:date>
</xsl:if>
<xsl:choose>
<!-- Take 'Available' (embargo) date first because that is YYYY-MM-DD -->
<xsl:when test="*[local-name() = 'EmbargoDate']">
<gmd:date>
<gmd:CI_Date>
<gmd:date>
<xsl:variable name="embargoDate" select="concat(
EmbargoDate/@Year, '-',
format-number(number(EmbargoDate/@Month),'00'), '-',
format-number(number(EmbargoDate/@Day),'00')
)" />
<gco:Date>
<xsl:value-of select="$embargoDate"/>
</gco:Date>
</gmd:date>
<gmd:dateType>
<gmd:CI_DateTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode" codeListValue="publication">publication</gmd:CI_DateTypeCode>
</gmd:dateType>
</gmd:CI_Date>
</gmd:date>
</xsl:when>
<xsl:when test="*[local-name() = 'ServerDatePublished']">
<gmd:date>
<gmd:CI_Date>
<gmd:date>
<xsl:variable name="publicationDate" select="concat(
ServerDatePublished/@Year, '-',
format-number(number(ServerDatePublished/@Month),'00'), '-',
format-number(number(ServerDatePublished/@Day),'00'), 'T',
format-number(number(ServerDatePublished/@Hour),'00'), ':',
format-number(number(ServerDatePublished/@Minute),'00'), ':',
format-number(number(ServerDatePublished/@Second),'00'), 'Z'
)" />
<gco:DateTime>
<xsl:value-of select="$publicationDate"/>
</gco:DateTime>
</gmd:date>
<gmd:dateType>
<gmd:CI_DateTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode" codeListValue="publication">publication</gmd:CI_DateTypeCode>
</gmd:dateType>
</gmd:CI_Date>
</gmd:date>
</xsl:when>
<xsl:otherwise>
<gmd:date gco:nilReason="missing"/>
</xsl:otherwise>
</xsl:choose>
<!-- the following test is designed to filter out update-metadata dates if these follow the convention
that metadata update date strings are prefixed with 'metadata'-->
<xsl:if test="@ServerDateModified">
<gmd:date>
<gmd:CI_Date>
<gmd:date>
<xsl:variable name="updateDate" select="normalize-space(@ServerDateModified)"/>
<!-- ieda dataCite labels metadata update date in the date string to avoid ambiguity -->
<xsl:choose>
<xsl:when test="$updateDate != ''">
<xsl:choose>
<xsl:when test="contains($updateDate, 'T')">
<gco:DateTime>
<xsl:value-of select="$updateDate"/>
</gco:DateTime>
</xsl:when>
<xsl:when test="contains($updateDate, ' ')">
<gco:DateTime>
<xsl:value-of select="translate($updateDate, ' ', 'T')"/>
</gco:DateTime>
</xsl:when>
<xsl:otherwise>
<gco:Date>
<xsl:value-of select="$updateDate"/>
</gco:Date>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="gco:nilReason">
<xsl:value-of select="string('missing')"/>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</gmd:date>
<gmd:dateType>
<gmd:CI_DateTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode" codeListValue="revision">revision</gmd:CI_DateTypeCode>
</gmd:dateType>
</gmd:CI_Date>
</gmd:date>
</xsl:if>
</xsl:template>
<xsl:template name="ci_responsibleparty">
<xsl:param name="individual"/>
<xsl:param name="httpuri"/>
<xsl:param name="personidtype"/>
<xsl:param name="organisation"/>
<xsl:param name="position"/>
<xsl:param name="role"/>
<xsl:param name="email"/>
<xsl:param name="datacite-creatorname"/>
<!-- <xsl:variable name="datacite-creatorname" select="//*[name() = 'creatorName'][@nameType = 'Organizational']"/> -->
<gmd:CI_ResponsibleParty>
<!-- stower 2022, wenn Autor oder Creator nur Organisation und Individual = missing -->
<xsl:if test="$individual != ''">
<xsl:choose>
<xsl:when test="$individual = 'missing'">
<gmd:individualName gco:nilReason="missing"/>
</xsl:when>
<xsl:otherwise>
<gmd:individualName>
<gco:CharacterString>
<xsl:value-of select="$individual"/>
</gco:CharacterString>
</gmd:individualName>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<!-- stower 2022, wenn Autor oder Creator nur Organisation -->
<xsl:if test="$individual = 'missing' or ''">
<gmd:organisationName>
<gco:CharacterString>
<xsl:value-of select="$datacite-creatorname"/>
</gco:CharacterString>
</gmd:organisationName>
</xsl:if>
<xsl:if test="$organisation != ''">
<gmd:organisationName>
<gco:CharacterString>
<xsl:value-of select="$organisation"/>
</gco:CharacterString>
</gmd:organisationName>
</xsl:if>
<xsl:if test="$position != ''">
<gmd:positionName>
<gco:CharacterString>
<xsl:value-of select="$position"/>
</gco:CharacterString>
</gmd:positionName>
</xsl:if>
<gmd:contactInfo>
<gmd:CI_Contact>
<!-- gmd:address -->
<gmd:address>
<gmd:CI_Address>
<gmd:electronicMailAddress>
<xsl:choose>
<xsl:when test="$email != ''">
<gco:CharacterString>
<xsl:value-of select="$email"/>
</gco:CharacterString>
</xsl:when>
<xsl:otherwise>
<!-- stower 2022 -->
<gco:CharacterString>
<xsl:value-of select="string('repository@geologie.ac.at')"/>
</gco:CharacterString>
</xsl:otherwise>
</xsl:choose>
</gmd:electronicMailAddress>
</gmd:CI_Address>
</gmd:address>
<xsl:if test="$httpuri != ''">
<gmd:onlineResource>
<gmd:CI_OnlineResource>
<gmd:linkage>
<gmd:URL>
<xsl:value-of select="$httpuri"/>
</gmd:URL>
</gmd:linkage>
<gmd:protocol>
<gco:CharacterString>
<xsl:value-of select="$personidtype"/>
</gco:CharacterString>
</gmd:protocol>
</gmd:CI_OnlineResource>
</gmd:onlineResource>
</xsl:if>
</gmd:CI_Contact>
</gmd:contactInfo>
<!-- <gmd:role> -->
<gmd:role>
<gmd:CI_RoleCode>
<xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode</xsl:attribute>
<xsl:attribute name="codeListValue">
<xsl:value-of select="$role"/>
</xsl:attribute>
<xsl:value-of select="$role"/>
</gmd:CI_RoleCode>
</gmd:role>
</gmd:CI_ResponsibleParty>
</xsl:template>
<!-- <gmd:pointOfContact> -->
<xsl:template name="pointofcontact_custodian">
<gmd:pointOfContact>
<gmd:CI_ResponsibleParty>
<gmd:individualName>
<gco:CharacterString>Tethys RDR</gco:CharacterString>
</gmd:individualName>
<gmd:organisationName>
<gco:CharacterString>Tethys RDR</gco:CharacterString>
</gmd:organisationName>
<gmd:contactInfo>
<gmd:CI_Contact>
<gmd:address>
<gmd:CI_Address>
<gmd:electronicMailAddress>
<gco:CharacterString>repository@geologie.ac.at</gco:CharacterString>
</gmd:electronicMailAddress>
</gmd:CI_Address>
</gmd:address>
<gmd:onlineResource>
<gmd:CI_OnlineResource>
<gmd:linkage>
<gmd:URL>https://www.tethys.at/</gmd:URL>
</gmd:linkage>
</gmd:CI_OnlineResource>
</gmd:onlineResource>
</gmd:CI_Contact>
</gmd:contactInfo>
<!-- <gmd:role>
<gmd:CI_RoleCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="pointOfContact">pointOfContact</gmd:CI_RoleCode>
</gmd:role> -->
<gmd:role>
<gmd:CI_RoleCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="custodian">custodian</gmd:CI_RoleCode>
</gmd:role>
</gmd:CI_ResponsibleParty>
</gmd:pointOfContact>
</xsl:template>
<!-- <gmd:pointOfContact> -->
<xsl:template name="pointofcontact_originator">
<gmd:pointOfContact>
<gmd:CI_ResponsibleParty>
<gmd:individualName>
<gco:CharacterString>Tethys RDR</gco:CharacterString>
</gmd:individualName>
<gmd:organisationName>
<gco:CharacterString>Tethys RDR</gco:CharacterString>
</gmd:organisationName>
<gmd:contactInfo>
<gmd:CI_Contact>
<gmd:address>
<gmd:CI_Address>
<gmd:electronicMailAddress>
<gco:CharacterString>repository@geologie.ac.at</gco:CharacterString>
</gmd:electronicMailAddress>
</gmd:CI_Address>
</gmd:address>
<gmd:onlineResource>
<gmd:CI_OnlineResource>
<gmd:linkage>
<gmd:URL>https://www.tethys.at/</gmd:URL>
</gmd:linkage>
</gmd:CI_OnlineResource>
</gmd:onlineResource>
</gmd:CI_Contact>
</gmd:contactInfo>
<!-- <gmd:role>
<gmd:CI_RoleCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="pointOfContact">pointOfContact</gmd:CI_RoleCode>
</gmd:role> -->
<gmd:role>
<gmd:CI_RoleCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="originator">originator</gmd:CI_RoleCode>
</gmd:role>
</gmd:CI_ResponsibleParty>
</gmd:pointOfContact>
</xsl:template>
<!-- gmd:graphicOverview - retrieves tethys logo as browse graphic, stower 2022 -->
<xsl:template name="browseGraphictethys">
<gmd:graphicOverview>
<gmd:MD_BrowseGraphic>
<gmd:fileName>
<gco:CharacterString>https://tethys.at/assets/TETHYS-Logo.svg</gco:CharacterString>
</gmd:fileName>
<gmd:fileDescription>
<gco:CharacterString>TETHYS RDR</gco:CharacterString>
</gmd:fileDescription>
</gmd:MD_BrowseGraphic>
</gmd:graphicOverview>
</xsl:template>
<!-- gmd:descriptiveKeywords - retrieves non-thesaurus keywords -->
<xsl:template name="freekeywords">
<xsl:if test="//*[name() = 'Subject' and normalize-space(@Type) = 'Uncontrolled']">
<gmd:descriptiveKeywords>
<gmd:MD_Keywords>
<xsl:for-each select="*[name() = 'Subject' and normalize-space(@Type) = 'Uncontrolled']">
<gmd:keyword>
<gco:CharacterString>
<xsl:value-of select="normalize-space(@Value)"/>
</gco:CharacterString>
</gmd:keyword>
</xsl:for-each>
<gmd:type>
<gmd:MD_KeywordTypeCode xmlns="http://www.isotc211.org/2005/gmd" codeList="https://standards.iso.org/iso/19139/resources/gmxCodelists.xml#MD_KeywordTypeCode" codeListValue="theme">theme</gmd:MD_KeywordTypeCode>
</gmd:type>
</gmd:MD_Keywords>
</gmd:descriptiveKeywords>
</xsl:if>
</xsl:template>
<!-- gmd:descriptiveKeywords - for datacenter -->
<xsl:template name="datacenter_keyword">
<gmd:descriptiveKeywords>
<gmd:MD_Keywords>
<gmd:keyword>
<gco:CharacterString>
<xsl:value-of select="$datacentre"/>
</gco:CharacterString>
</gmd:keyword>
<gmd:type>
<gmd:MD_KeywordTypeCode codeList="http://www.ngdc.noaa.gov/metadata/published/xsd/schema/resources/Codelist/gmxCodelists.xml#MD_KeywordTypeCode" codeListValue="dataCentre">Tethys RDR</gmd:MD_KeywordTypeCode>
</gmd:type>
</gmd:MD_Keywords>
</gmd:descriptiveKeywords>
</xsl:template>
<!-- <gmd:extent> -->
<xsl:template name="spatialcoverage">
<gmd:extent>
<gmd:EX_Extent>
<xsl:if test="//*[name() = 'Coverage']">
<!-- <xsl:variable name="thebox" select="//*[name() = 'Coverage']"/> -->
<xsl:variable name="sLat">
<xsl:choose>
<xsl:when test="string(Coverage/@YMin) != ''">
<xsl:value-of select="number(Coverage/@YMin)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="''"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="wLong">
<xsl:choose>
<xsl:when test="string(Coverage/@XMin) != ''">
<xsl:value-of select="number(Coverage/@XMin)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="''"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="nLat">
<xsl:choose>
<xsl:when test="string(Coverage/@YMax) != ''">
<xsl:value-of select="number(Coverage/@YMax)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="''"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="eLong">
<xsl:choose>
<xsl:when test="string(Coverage/@XMax) != ''">
<xsl:value-of select="number(Coverage/@XMax)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="''"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="
string($nLat) != 'NaN' and string($wLong) != 'NaN' and
string($sLat) != 'NaN' and string($eLong) != 'NaN'">
<!-- <xsl:value-of select="$nLat"/> -->
<xsl:choose>
<!-- check for degenerate bbox -->
<xsl:when test="$nLat = $sLat and $eLong = $wLong">
<gmd:geographicElement>
<gmd:EX_BoundingPolygon>
<gmd:polygon>
<gml:Point>
<!-- generate a unique id of the source xml node -->
<xsl:attribute name="gml:id">
<xsl:value-of select="generate-id(.)"/>
</xsl:attribute>
<gml:pos>
<xsl:value-of select="$sLat"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$wLong"/>
</gml:pos>
</gml:Point>
</gmd:polygon>
</gmd:EX_BoundingPolygon>
</gmd:geographicElement>
</xsl:when>
<!-- check to see if box crosses 180 with west side either in east long (positive) or <-180, or east side
>180. If so, create two bounding box geographicElements-->
<xsl:when test="($wLong &gt;0 and $eLong &lt;0)">
<!-- use east longitude coordinates -->
<gmd:geographicElement>
<gmd:EX_GeographicBoundingBox>
<gmd:westBoundLongitude>
<gco:Decimal>
<xsl:value-of select="$wLong"/>
</gco:Decimal>
</gmd:westBoundLongitude>
<gmd:eastBoundLongitude>
<gco:Decimal>
<xsl:value-of select="180"/>
</gco:Decimal>
</gmd:eastBoundLongitude>
<gmd:southBoundLatitude>
<gco:Decimal>
<xsl:choose>
<xsl:when test="number($sLat) &lt; number($nLat)">
<xsl:value-of select="$sLat"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$nLat"/>
</xsl:otherwise>
</xsl:choose>
</gco:Decimal>
</gmd:southBoundLatitude>
<gmd:northBoundLatitude>
<gco:Decimal>
<xsl:choose>
<xsl:when test="number($sLat) &lt; number($nLat)">
<xsl:value-of select="$nLat"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$sLat"/>
</xsl:otherwise>
</xsl:choose>
</gco:Decimal>
</gmd:northBoundLatitude>
</gmd:EX_GeographicBoundingBox>
</gmd:geographicElement>
<gmd:geographicElement>
<gmd:EX_GeographicBoundingBox>
<gmd:westBoundLongitude>
<gco:Decimal>
<xsl:value-of select="-180"/>
</gco:Decimal>
</gmd:westBoundLongitude>
<gmd:eastBoundLongitude>
<gco:Decimal>
<xsl:value-of select="$eLong"/>
</gco:Decimal>
</gmd:eastBoundLongitude>
<gmd:southBoundLatitude>
<gco:Decimal>
<xsl:choose>
<xsl:when test="number($sLat) &lt; number($nLat)">
<xsl:value-of select="$sLat"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$nLat"/>
</xsl:otherwise>
</xsl:choose>
</gco:Decimal>
</gmd:southBoundLatitude>
<gmd:northBoundLatitude>
<gco:Decimal>
<xsl:choose>
<xsl:when test="number($sLat) &lt; number($nLat)">
<xsl:value-of select="$nLat"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$sLat"/>
</xsl:otherwise>
</xsl:choose>
</gco:Decimal>
</gmd:northBoundLatitude>
</gmd:EX_GeographicBoundingBox>
</gmd:geographicElement>
</xsl:when>
<xsl:otherwise>
<gmd:geographicElement>
<gmd:EX_GeographicBoundingBox>
<gmd:extentTypeCode>
<gco:Boolean>true</gco:Boolean>
</gmd:extentTypeCode>
<gmd:westBoundLongitude>
<gco:Decimal>
<xsl:value-of select="$wLong"/>
</gco:Decimal>
</gmd:westBoundLongitude>
<gmd:eastBoundLongitude>
<gco:Decimal>
<xsl:value-of select="$eLong"/>
</gco:Decimal>
</gmd:eastBoundLongitude>
<gmd:southBoundLatitude>
<gco:Decimal>
<xsl:choose>
<xsl:when test="number($sLat) &lt; number($nLat)">
<xsl:value-of select="$sLat"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$nLat"/>
</xsl:otherwise>
</xsl:choose>
</gco:Decimal>
</gmd:southBoundLatitude>
<gmd:northBoundLatitude>
<gco:Decimal>
<xsl:choose>
<xsl:when test="number($sLat) &lt; number($nLat)">
<xsl:value-of select="$nLat"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$sLat"/>
</xsl:otherwise>
</xsl:choose>
</gco:Decimal>
</gmd:northBoundLatitude>
</gmd:EX_GeographicBoundingBox>
</gmd:geographicElement>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:if>
</gmd:EX_Extent>
</gmd:extent>
</xsl:template>
<!-- <gmd:onLine> -->
<xsl:template name="datacite_identifier">
<xsl:for-each select="*[name() = 'Identifier']">
<xsl:variable name="identifier" select="."/>
<xsl:if test="starts-with($identifier/@Value, 'doi:') or $identifier/@Type = 'Doi' or starts-with($identifier/@Value, 'http://')">
<gmd:onLine>
<gmd:CI_OnlineResource>
<gmd:linkage>
<gmd:URL>
<xsl:choose>
<xsl:when test="starts-with($identifier/@Value, 'doi:')">
<!-- stower http auf https gesetzt -->
<xsl:value-of select="concat('http://dx.doi.org/', substring-after($identifier/@Value, 'doi:'))"/>
</xsl:when>
<xsl:when test="$identifier/@Type = 'Doi'">
<xsl:value-of select="concat('http://dx.doi.org/', normalize-space($identifier/@Value))"/>
</xsl:when>
<xsl:when test="starts-with($identifier/@Value, 'http://')">
<xsl:value-of select="normalize-space($identifier/@Value)"/>
</xsl:when>
</xsl:choose>
</gmd:URL>
</gmd:linkage>
<gmd:protocol>
<gco:CharacterString>WWW:LINK-1.0-http--link</gco:CharacterString>
</gmd:protocol>
<gmd:name>
<gco:CharacterString>Landing Page</gco:CharacterString>
</gmd:name>
<gmd:description>
<gco:CharacterString>
<xsl:value-of select="normalize-space(string(
'Link to DOI landing page or data facility landing page if no DOI is assigned.'))"/>
</gco:CharacterString>
</gmd:description>
<gmd:function>
<gmd:CI_OnLineFunctionCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_OnLineFunctionCode" codeListValue="information">information</gmd:CI_OnLineFunctionCode>
</gmd:function>
</gmd:CI_OnlineResource>
</gmd:onLine>
</xsl:if>
</xsl:for-each>
</xsl:template>
<!-- <gmd:onLine> -->
<xsl:template name="alternate_identifier">
<xsl:if test="@landingpage != '' and starts-with(normalize-space(string(@landingpage)), 'http')">
<gmd:onLine>
<gmd:CI_OnlineResource>
<gmd:linkage>
<gmd:URL>
<xsl:value-of select="string(@landingpage)"/>
</gmd:URL>
</gmd:linkage>
<gmd:protocol>
<gco:CharacterString>WWW:LINK-1.0-http--link</gco:CharacterString>
</gmd:protocol>
<gmd:name>
<gco:CharacterString>
<xsl:value-of select="string('url')"/>
</gco:CharacterString>
</gmd:name>
<gmd:description>
<gco:CharacterString>Link to a web page related to the resource.</gco:CharacterString>
</gmd:description>
<gmd:function>
<gmd:CI_OnLineFunctionCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_OnLineFunctionCode" codeListValue="information">information</gmd:CI_OnLineFunctionCode>
</gmd:function>
</gmd:CI_OnlineResource>
</gmd:onLine>
</xsl:if>
</xsl:template>
<!-- <gmd:dataQualityInfo> -->
<xsl:template name="data_quality">
<gmd:dataQualityInfo>
<gmd:DQ_DataQuality>
<gmd:scope>
<gmd:DQ_Scope>
<gmd:level>
<gmd:MD_ScopeCode xmlns="http://www.isotc211.org/2005/gmd" codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#MD_ScopeCode" codeListValue="dataset" />
</gmd:level>
<gmd:levelDescription xmlns:gco="http://www.isotc211.org/2005/gco" gco:nilReason="inapplicable" />
</gmd:DQ_Scope>
</gmd:scope>
<gmd:report>
<gmd:DQ_DomainConsistency>
<gmd:result>
<gmd:DQ_ConformanceResult>
<gmd:specification>
<gmd:CI_Citation>
<gmd:title>
<gco:CharacterString xmlns:gco="http://www.isotc211.org/2005/gco">VERORDNUNG (EG) Nr. 1089/2010 DER KOMMISSION vom 23. November 2010 zur Durchführung der Richtlinie 2007/2/EG des Europäischen Parlaments und des Rates hinsichtlich der Interoperabilität von Geodatensätzen und -diensten</gco:CharacterString>
</gmd:title>
<gmd:date>
<gmd:CI_Date>
<gmd:date>
<gco:Date xmlns:gco="http://www.isotc211.org/2005/gco">2010-12-08</gco:Date>
</gmd:date>
<gmd:dateType>
<gmd:CI_DateTypeCode xmlns="http://www.isotc211.org/2005/gmd" codeList="https://standards.iso.org/iso/19139/resources/gmxCodelists.xml#CI_DateTypeCode" codeListValue="publication" />
</gmd:dateType>
</gmd:CI_Date>
</gmd:date>
</gmd:CI_Citation>
</gmd:specification>
<gmd:explanation>
<gco:CharacterString xmlns:gco="http://www.isotc211.org/2005/gco">Datenstruktur entspricht INSPIRE</gco:CharacterString>
</gmd:explanation>
<gmd:pass>
<gco:Boolean xmlns:gco="http://www.isotc211.org/2005/gco">true</gco:Boolean>
</gmd:pass>
</gmd:DQ_ConformanceResult>
</gmd:result>
</gmd:DQ_DomainConsistency>
</gmd:report>
<gmd:lineage>
<gmd:LI_Lineage>
<gmd:statement>
<gco:CharacterString xmlns:gco="http://www.isotc211.org/2005/gco">Digitalisierung</gco:CharacterString>
</gmd:statement>
</gmd:LI_Lineage>
</gmd:lineage>
</gmd:DQ_DataQuality>
</gmd:dataQualityInfo>
</xsl:template>
<!-- <gmd:distributor> -->
<xsl:variable name="distributorOrganisation" select="string('Geological Survey of Austria')"/>
<xsl:variable name="distributorContactEmail" select="string('repository@geologie.ac.at')"/>
<xsl:template name="distributor">
<gmd:distributor>
<gmd:MD_Distributor>
<gmd:distributorContact>
<gmd:CI_ResponsibleParty>
<gmd:organisationName>
<gco:CharacterString>
<xsl:value-of select="$distributorOrganisation"/>
</gco:CharacterString>
</gmd:organisationName>
<gmd:contactInfo>
<gmd:CI_Contact>
<gmd:address>
<gmd:CI_Address>
<gmd:electronicMailAddress>
<gco:CharacterString>
<xsl:value-of select="$distributorContactEmail"/>
</gco:CharacterString>
</gmd:electronicMailAddress>
</gmd:CI_Address>
</gmd:address>
</gmd:CI_Contact>
</gmd:contactInfo>
<gmd:role>
<gmd:CI_RoleCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="distributor" codeSpace="ISOTC211/19115">distributor</gmd:CI_RoleCode>
</gmd:role>
</gmd:CI_ResponsibleParty>
</gmd:distributorContact>
</gmd:MD_Distributor>
</gmd:distributor>
</xsl:template>
<xsl:variable name="maintenanceContactID" select="string('https://www.re3data.org/repository/r3d100013400')"/>
<xsl:variable name="maintenanceContactName" select="string('Tethys RDR')"/>
<xsl:variable name="maintenanceContactEmail" select="string('repository@geologie.ac.at')"/>
<xsl:template name="metadata_maintenance">
<gmd:metadataMaintenance>
<gmd:MD_MaintenanceInformation>
<gmd:maintenanceAndUpdateFrequency>
<gmd:MD_MaintenanceFrequencyCode codeList="http://schemas.opengis.net/iso/19139/20070417/resources/codelist/gmxCodelists.xml#MD_MaintenanceFrequencyCode" codeListValue="asNeeded">asNeeded</gmd:MD_MaintenanceFrequencyCode>
</gmd:maintenanceAndUpdateFrequency>
<gmd:contact>
<xsl:if test="$maintenanceContactID != ''">
<xsl:attribute name="xlink:href">
<xsl:value-of select="$maintenanceContactID"/>
</xsl:attribute>
</xsl:if>
<gmd:CI_ResponsibleParty>
<gmd:individualName>
<gco:CharacterString>
<xsl:value-of select="$maintenanceContactName"/>
</gco:CharacterString>
</gmd:individualName>
<gmd:contactInfo>
<gmd:CI_Contact>
<gmd:address>
<gmd:CI_Address>
<gmd:electronicMailAddress>
<gco:CharacterString>
<xsl:value-of select="$maintenanceContactEmail"/>
</gco:CharacterString>
</gmd:electronicMailAddress>
</gmd:CI_Address>
</gmd:address>
</gmd:CI_Contact>
</gmd:contactInfo>
<gmd:role>
<gmd:CI_RoleCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="processor">processor</gmd:CI_RoleCode>
</gmd:role>
</gmd:CI_ResponsibleParty>
</gmd:contact>
</gmd:MD_MaintenanceInformation>
</gmd:metadataMaintenance>
</xsl:template>
</xsl:stylesheet>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- langCodeMap.xml -->
<langCodeMap>
<langCode iso639-1="de" iso639-2="ger"/>
<langCode iso639-1="en" iso639-2="eng"/>
<langCode iso639-1="es" iso639-2="spa"/>
<langCode iso639-1="it" iso639-2="ita"/>
</langCodeMap>

645
public/assets2/marc21.xslt Normal file
View file

@ -0,0 +1,645 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/**
* This file is part of OPUS. The software OPUS has been originally developed
* at the University of Stuttgart with funding from the German Research Net,
* the Federal Department of Higher Education and Research and the Ministry
* of Science, Research and the Arts of the State of Baden-Wuerttemberg.
*
* OPUS 4 is a complete rewrite of the original OPUS software and was developed
* by the Stuttgart University Library, the Library Service Center
* Baden-Wuerttemberg, the North Rhine-Westphalian Library Service Center,
* the Cooperative Library Network Berlin-Brandenburg, the Saarland University
* and State Library, the Saxon State Library - Dresden State and University
* Library, the Bielefeld University Library and the University Library of
* Hamburg University of Technology with funding from the German Research
* Foundation and the European Regional Development Fund.
*
* LICENCE
* OPUS is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the Licence, or any later version.
* OPUS is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details. You should have received a copy of the GNU General Public License
* along with OPUS; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @category Application
* @package Module_Export
* @author Alexander Weimar <alexander.weimar@bsz-bw.de>
* @author Sascha Szott <opus-development@saschaszott.de>
* @copyright Copyright (c) 2008-2019, OPUS 4 development team
* @license http://www.gnu.org/licenses/gpl.html General Public License
*/
-->
<xsl:stylesheet version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:marc="http://www.loc.gov/MARC21/slim"
xmlns:php="http://php.net/xsl"
>
<xsl:output method="xml" indent="yes"/>
<xsl:template match="Rdr_Dataset" mode="marc21">
<marc:collection xmlns:marc="http://www.loc.gov/MARC21/slim"
xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd">
<marc:record>
<xsl:variable name="aufnahmeart">
<xsl:choose>
<xsl:when test="./@Type='article'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='bachelorthesis'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='book'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='bookpart'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='conferenceobject'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='contributiontoperiodical'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='coursematerial'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='diplom'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='doctoralthesis'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='examen'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='habilitation'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='image'"> <xsl:value-of select="'k'"/></xsl:when>
<xsl:when test="./@Type='lecture'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='magister'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='masterthesis'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='movingimage'"> <xsl:value-of select="'g'"/></xsl:when>
<xsl:when test="./@Type='other'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='periodical'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='periodicalpart'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='preprint'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='report'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='review'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='sound'"> <xsl:value-of select="'i'"/></xsl:when>
<xsl:when test="./@Type='studythesis'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='workingpaper'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:otherwise>
<xsl:text>a</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="bibliographischesLevel">
<xsl:choose>
<xsl:when test="./@Type='article'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='bachelorthesis'"> <xsl:value-of select="'m'"/></xsl:when>
<xsl:when test="./@Type='book'"> <xsl:value-of select="'m'"/></xsl:when>
<xsl:when test="./@Type='bookpart'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='conferenceobject'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='contributiontoperiodical'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='coursematerial'"> <xsl:value-of select="'m'"/></xsl:when>
<xsl:when test="./@Type='diplom'"> <xsl:value-of select="'m'"/></xsl:when>
<xsl:when test="./@Type='doctoralthesis'"> <xsl:value-of select="'m'"/></xsl:when>
<xsl:when test="./@Type='examen'"> <xsl:value-of select="'m'"/></xsl:when>
<xsl:when test="./@Type='habilitation'"> <xsl:value-of select="'m'"/></xsl:when>
<xsl:when test="./@Type='image'"> <xsl:value-of select="'m'"/></xsl:when>
<xsl:when test="./@Type='lecture'"> <xsl:value-of select="'m'"/></xsl:when>
<xsl:when test="./@Type='magister'"> <xsl:value-of select="'m'"/></xsl:when>
<xsl:when test="./@Type='masterthesis'"> <xsl:value-of select="'m'"/></xsl:when>
<xsl:when test="./@Type='movingimage'"> <xsl:value-of select="'m'"/></xsl:when>
<xsl:when test="./@Type='other'"> <xsl:value-of select="'m'"/></xsl:when>
<xsl:when test="./@Type='periodical'"> <xsl:value-of select="'s'"/></xsl:when>
<xsl:when test="./@Type='periodicalpart'"> <xsl:value-of select="'a'"/></xsl:when>
<xsl:when test="./@Type='preprint'"> <xsl:value-of select="'m'"/></xsl:when>
<xsl:when test="./@Type='report'"> <xsl:value-of select="'m'"/></xsl:when>
<xsl:when test="./@Type='review'"> <xsl:value-of select="'m'"/></xsl:when>
<xsl:when test="./@Type='sound'"> <xsl:value-of select="'m'"/></xsl:when>
<xsl:when test="./@Type='studythesis'"> <xsl:value-of select="'m'"/></xsl:when>
<xsl:when test="./@Type='workingpaper'"> <xsl:value-of select="'m'"/></xsl:when>
<xsl:otherwise>
<xsl:text>m</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Reihenfolge Verwendung Jahr:
1. CompletedYear
2. CompletedDate
3. PublishedYear
4. PublishedDate
5. ServerDatePublished (Fallback; ist immer vorhanden, wenn das Dokument freigeschaltet wurde)
-->
<xsl:variable name="year">
<xsl:choose>
<xsl:when test="./@CompletedYear">
<xsl:value-of select="./@CompletedYear"/>
</xsl:when>
<xsl:when test="./CompletedDate/@Year">
<xsl:value-of select="./CompletedDate/@Year"/>
</xsl:when>
<xsl:when test="./@PublishedYear">
<xsl:value-of select="./@PublishedYear"/>
</xsl:when>
<xsl:when test="./PublishedDate/@Year">
<xsl:value-of select="./PublishedDate/@Year"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="./ServerDatePublished/@Year"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<marc:leader>
<xsl:text>00000n</xsl:text>
<xsl:value-of select="$aufnahmeart"/>
<xsl:value-of select="$bibliographischesLevel"/>
<xsl:text> a22000005 4500</xsl:text>
</marc:leader>
<marc:controlfield tag="001">
<xsl:text>docId-</xsl:text>
<xsl:value-of select="@Id"/>
</marc:controlfield>
<!-- ISIL der Bibliothek-->
<xsl:variable name="isil">
<xsl:value-of select="php:functionString('Application_Xslt::optionValue', 'isil', 'marc21')"/>
</xsl:variable>
<xsl:if test="$isil != ''">
<marc:controlfield tag="003">
<xsl:value-of select="$isil"/>
</marc:controlfield>
</xsl:if>
<marc:controlfield tag="007">
<xsl:text>cr uuu---uunan</xsl:text>
</marc:controlfield>
<xsl:if test="not(./TitleParent) and ./Identifier[@Type = 'isbn']">
<xsl:for-each select="./Identifier[@Type = 'isbn']">
<marc:datafield ind1=" " ind2=" " tag="020">
<marc:subfield code="a">
<xsl:value-of select="./@Value"/>
</marc:subfield>
</marc:datafield>
</xsl:for-each>
</xsl:if>
<xsl:if test="not(./TitleParent) and ./Identifier[@Type = 'issn']">
<xsl:for-each select="./Identifier[@Type = 'issn']">
<marc:datafield ind1=" " ind2=" " tag="022">
<marc:subfield code="a">
<xsl:value-of select="./@Value"/>
</marc:subfield>
</marc:datafield>
</xsl:for-each>
</xsl:if>
<xsl:if test="./Identifier[@Type = 'urn']">
<marc:datafield ind1="7" ind2=" " tag="024">
<marc:subfield code="a">
<xsl:value-of select="./Identifier[@Type = 'urn']/@Value"/>
</marc:subfield>
<marc:subfield code="2">
<xsl:text>urn</xsl:text>
</marc:subfield>
</marc:datafield>
</xsl:if>
<marc:datafield ind1=" " ind2=" " tag="041">
<marc:subfield code="a">
<xsl:choose>
<xsl:when test="./@Language='fra'">
<xsl:text>fre</xsl:text>
</xsl:when>
<xsl:when test="./@Language='deu'">
<xsl:text>ger</xsl:text>
</xsl:when>
<xsl:when test="./@Language='ces'">
<xsl:text>cze</xsl:text>
</xsl:when>
<xsl:when test="./@Language='slk'">
<xsl:text>slo</xsl:text>
</xsl:when>
<xsl:when test="./@Language='zho'">
<xsl:text>chi</xsl:text>
</xsl:when>
<xsl:when test="./@Language='nld'">
<xsl:text>dut</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@Language"/>
</xsl:otherwise>
</xsl:choose>
</marc:subfield>
</marc:datafield>
<!-- DDC -->
<xsl:for-each select="./Collection[@RoleName='ddc' and @Visible = 1]">
<marc:datafield ind1="0" ind2="4" tag="082">
<!-- alternativ bei DDC-Sachgruppen der DNB: <marc:datafield ind1="7" ind2="4" tag="082"> -->
<marc:subfield code="a">
<xsl:value-of select="@Number"/>
</marc:subfield>
</marc:datafield>
</xsl:for-each>
<!-- PersonAutor, nur der erste Autor -->
<xsl:apply-templates select="./PersonAuthor[position() = 1]" mode="marc21">
<xsl:with-param name="tag">100</xsl:with-param>
<xsl:with-param name="role">aut</xsl:with-param>
</xsl:apply-templates>
<!-- CreatingCorporation -->
<xsl:if test="./@CreatingCorporation">
<marc:datafield ind1="2" ind2=" " tag="110">
<marc:subfield code="a">
<xsl:value-of select="./@CreatingCorporation"/>
</marc:subfield>
</marc:datafield>
</xsl:if>
<!-- TitleMain in Dokumentsprache-->
<xsl:if test="./TitleMain[@Language = ../@Language]">
<marc:datafield ind1="0" ind2="0" tag="245">
<marc:subfield code="a">
<xsl:value-of select="./TitleMain[@Language = ../@Language]/@Value"/>
</marc:subfield>
<xsl:if test="./TitleSub[@Language = ../@Language]">
<marc:subfield code="b">
<xsl:value-of select="./TitleSub[@Language = ../@Language]/@Value"/>
</marc:subfield>
</xsl:if>
</marc:datafield>
</xsl:if>
<!-- Berücksichtigung aller TitleMain, die nicht in Dokumentsprache vorliegen -->
<xsl:if test="count(./TitleMain) &gt; 1">
<xsl:for-each select="./TitleMain[@Language != ../@Language]">
<xsl:variable name="lang">
<xsl:value-of select="@Language"/>
</xsl:variable>
<marc:datafield ind1="1" ind2="1" tag="246">
<marc:subfield code="a">
<xsl:value-of select="@Value"/>
</marc:subfield>
<xsl:if test="../TitleSub[@Language = $lang]">
<marc:subfield code="b">
<xsl:value-of select="../TitleSub[@Language = $lang]/@Value"/>
</marc:subfield>
</xsl:if>
</marc:datafield>
</xsl:for-each>
</xsl:if>
<xsl:variable name="publisherName">
<xsl:value-of select="php:functionString('Application_Xslt::optionValue', 'publisherName', 'marc21')"/>
</xsl:variable>
<xsl:variable name="publisherCity">
<xsl:value-of select="php:functionString('Application_Xslt::optionValue', 'publisherCity', 'marc21')"/>
</xsl:variable>
<!-- Jahr nur beim ersten ThesisPublisher ausgeben -->
<xsl:if test="./ThesisPublisher or ./@PublisherName or ./@PublisherPlace or $publisherName != '' or $publisherCity != '' or $year != ''">
<marc:datafield ind1=" " ind2="1" tag="264"> <!-- Das Feld 260 wird mit der Einführung von RDA nicht mehr gebildet -->
<xsl:choose>
<xsl:when test="./ThesisPublisher"><!-- City und Name sind Pflichtfelder, daher kein zusätzlicher Test -->
<marc:subfield code="a">
<xsl:value-of select="./ThesisPublisher[1]/@City"/>
</marc:subfield>
<marc:subfield code="b">
<xsl:value-of select="./ThesisPublisher[1]/@Name"/>
</marc:subfield>
</xsl:when>
<xsl:when test="./@PublisherName or ./@PublisherPlace">
<xsl:if test="./@PublisherPlace">
<marc:subfield code="a">
<xsl:value-of select="./@PublisherPlace"/>
</marc:subfield>
</xsl:if>
<xsl:if test="./@PublisherName">
<marc:subfield code="b">
<xsl:value-of select="./@PublisherName"/>
</marc:subfield>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<!-- Fallback nur dann verwenden, wenn bislang kein Wert für Subfield a oder b erzeugt werden konnte -->
<xsl:if test="$publisherCity != ''">
<marc:subfield code="a">
<xsl:value-of select="$publisherCity"/>
</marc:subfield>
</xsl:if>
<xsl:if test="$publisherName != ''">
<marc:subfield code="b">
<xsl:value-of select="$publisherName"/>
</marc:subfield>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="$year != ''">
<marc:subfield code="c">
<xsl:value-of select="$year"/>
</marc:subfield>
</xsl:if>
</marc:datafield>
</xsl:if>
<!-- ab dem 2. ThesisPublisher keine Jahresangabe in 264c ausgeben -->
<xsl:if test="count(./ThesisPublisher) &gt; 1">
<xsl:for-each select="./ThesisPublisher">
<xsl:if test="position() != 1">
<marc:datafield ind1=" " ind2="1" tag="264">
<!-- City und Name sind Pflichtfelder, daher kein zusätzlicher Test -->
<marc:subfield code="a">
<xsl:value-of select="@City"/>
</marc:subfield>
<marc:subfield code="b">
<xsl:value-of select="@Name"/>
</marc:subfield>
</marc:datafield>
</xsl:if>
</xsl:for-each>
</xsl:if>
<!-- Seitenanzahl -->
<xsl:if test="./@PageNumber">
<marc:datafield ind1=" " ind2=" " tag="300">
<marc:subfield code="a">
<xsl:value-of select="./@PageNumber"/>
</marc:subfield>
</marc:datafield>
</xsl:if>
<!-- Schriftenreihen -->
<xsl:for-each select="./Series">
<xsl:if test="./@Visible = 1">
<marc:datafield ind1="1" ind2=" " tag="490">
<marc:subfield code="a">
<xsl:value-of select="./@Title"/>
</marc:subfield>
<marc:subfield code="v">
<xsl:value-of select="./@Number"/>
</marc:subfield>
</marc:datafield>
</xsl:if>
</xsl:for-each>
<!-- TitleAbstract in Dokumentsprache zuerst ausgeben -->
<xsl:if test="./TitleAbstract[@Language = ../@Language]">
<marc:datafield ind1=" " ind2=" " tag="520">
<marc:subfield code="a">
<xsl:value-of select="./TitleAbstract[@Language = ../@Language]/@Value"/>
</marc:subfield>
</marc:datafield>
</xsl:if>
<!-- Behandlung von allen weiteren TitleAbstracs -->
<xsl:for-each select="./TitleAbstract[@Language != ../@Language]">
<marc:datafield ind1=" " ind2=" " tag="520">
<marc:subfield code="a">
<xsl:value-of select="./@Value"/>
</marc:subfield>
</marc:datafield>
</xsl:for-each>
<!-- Schlagworte -->
<xsl:for-each select="Subject[@Type='uncontrolled' or @Type='swd']">
<marc:datafield ind1=" " ind2=" " tag="653">
<marc:subfield code="a">
<xsl:value-of select="./@Value"/>
</marc:subfield>
</marc:datafield>
</xsl:for-each>
<marc:datafield ind1=" " ind2="4" tag="655">
<marc:subfield code="a">
<xsl:choose>
<xsl:when test="./@Type='article'"> <xsl:text>article</xsl:text></xsl:when>
<xsl:when test="./@Type='bachelorthesis'"> <xsl:text>bachelorThesis</xsl:text></xsl:when>
<xsl:when test="./@Type='book'"> <xsl:text>book</xsl:text></xsl:when>
<xsl:when test="./@Type='bookpart'"> <xsl:text>bookPart</xsl:text></xsl:when>
<xsl:when test="./@Type='conferenceobject'"> <xsl:text>conferenceObject</xsl:text></xsl:when>
<xsl:when test="./@Type='contributiontoperiodical'"> <xsl:text>contributionToPeriodical</xsl:text></xsl:when>
<xsl:when test="./@Type='coursematerial'"> <xsl:text>CourseMaterial</xsl:text></xsl:when>
<xsl:when test="./@Type='diplom'"> <xsl:text>masterThesis</xsl:text></xsl:when>
<xsl:when test="./@Type='doctoralthesis'"> <xsl:text>doctoralThesis</xsl:text></xsl:when>
<xsl:when test="./@Type='examen'"> <xsl:text>masterThesis</xsl:text></xsl:when>
<xsl:when test="./@Type='habilitation'"> <xsl:text>doctoralThesis</xsl:text></xsl:when>
<xsl:when test="./@Type='image'"> <xsl:text>Image</xsl:text></xsl:when>
<xsl:when test="./@Type='lecture'"> <xsl:text>lecture</xsl:text></xsl:when>
<xsl:when test="./@Type='magister'"> <xsl:text>masterThesis</xsl:text></xsl:when>
<xsl:when test="./@Type='masterthesis'"> <xsl:text>masterThesis</xsl:text></xsl:when>
<xsl:when test="./@Type='movingimage'"> <xsl:text>MovingImage</xsl:text></xsl:when>
<xsl:when test="./@Type='other'"> <xsl:text>Other</xsl:text></xsl:when>
<xsl:when test="./@Type='periodical'"> <xsl:text>Periodical</xsl:text></xsl:when>
<xsl:when test="./@Type='periodicalpart'"> <xsl:text>PeriodicalPart</xsl:text></xsl:when>
<xsl:when test="./@Type='preprint'"> <xsl:text>preprint</xsl:text></xsl:when>
<xsl:when test="./@Type='report'"> <xsl:text>report</xsl:text></xsl:when>
<xsl:when test="./@Type='review'"> <xsl:text>review</xsl:text></xsl:when>
<xsl:when test="./@Type='sound'"> <xsl:text>Sound</xsl:text></xsl:when>
<xsl:when test="./@Type='studythesis'"> <xsl:text>StudyThesis</xsl:text></xsl:when>
<xsl:when test="./@Type='workingpaper'"> <xsl:text>workingPaper</xsl:text></xsl:when>
<xsl:otherwise>
<xsl:text>Other</xsl:text>
</xsl:otherwise>
</xsl:choose>
</marc:subfield>
</marc:datafield>
<!-- Sonstige Autoren -->
<xsl:apply-templates select="./PersonAuthor[position() &gt; 1]" mode="marc21">
<xsl:with-param name="tag">700</xsl:with-param>
<xsl:with-param name="role">aut</xsl:with-param>
</xsl:apply-templates>
<!-- PersonEditor -->
<xsl:apply-templates select="./PersonEditor" mode="marc21">
<xsl:with-param name="tag">700</xsl:with-param>
<xsl:with-param name="role">edt</xsl:with-param>
</xsl:apply-templates>
<!-- PersonAdvisor -->
<xsl:apply-templates select="./PersonAdvisor" mode="marc21">
<xsl:with-param name="tag">700</xsl:with-param>
<xsl:with-param name="role">dgs</xsl:with-param>
</xsl:apply-templates>
<!-- PersonContributor -->
<xsl:apply-templates select="./PersonContributor" mode="marc21">
<xsl:with-param name="tag">700</xsl:with-param>
<xsl:with-param name="role">ctb</xsl:with-param>
</xsl:apply-templates>
<xsl:if test="((not(./TitleParent) or count(TitleParent) &gt; 1)) and (./@Volume or ./@Issue or (./@PageFirst or ./@PageLast))">
<marc:datafield ind1="0" ind2=" " tag="773">
<xsl:call-template name="subfieldG">
<xsl:with-param name="volume" select="./@Volume"/>
<xsl:with-param name="issue" select="./@Issue"/>
<xsl:with-param name="pageFirst" select="./@PageFirst"/>
<xsl:with-param name="pageLast" select="./@PageLast"/>
</xsl:call-template>
</marc:datafield>
</xsl:if>
<!-- Behandlung von TitleParent (genau ein TitleParent): TitleParent und Volume, Issue, Pages in gemeinsames 773-Feld -->
<xsl:if test="count(./TitleParent) = 1">
<marc:datafield ind1="0" ind2=" " tag="773">
<marc:subfield code="t">
<xsl:value-of select="./TitleParent/@Value"/>
</marc:subfield>
<xsl:call-template name="subfieldG">
<xsl:with-param name="volume" select="./@Volume"/>
<xsl:with-param name="issue" select="./@Issue"/>
<xsl:with-param name="pageFirst" select="./@PageFirst"/>
<xsl:with-param name="pageLast" select="./@PageLast"/>
</xsl:call-template>
<xsl:if test="(count(./Identifier[@Type = 'issn']) = 1) and not(./Identifier[@Type = 'isbn'])">
<marc:subfield code="x">
<xsl:value-of select="./Identifier[@Type = 'issn']/@Value"/>
</marc:subfield>
</xsl:if>
<xsl:if test="(count(./Identifier[@Type = 'isbn']) = 1) and not (./Identifier[@Type = 'issn'])">
<marc:subfield code="z">
<xsl:value-of select="./Identifier[@Type = 'isbn']/@Value"/>
</marc:subfield>
</xsl:if>
</marc:datafield>
</xsl:if>
<!-- Behandlung von TitleParent (mehr als ein TitleParent): jeder TitleParent in ein eigenes 773-Feld -->
<xsl:if test="count(./TitleParent) &gt; 1">
<xsl:for-each select="./TitleParent">
<marc:datafield ind1="0" ind2=" " tag="773">
<marc:subfield code="t">
<xsl:value-of select="./@Value"/>
</marc:subfield>
</marc:datafield>
</xsl:for-each>
</xsl:if>
<!-- beim Vorhandensein mindestens eines TitleParent: ISSNs werden einzeln ausgegeben,
wenn es mehr als eine gibt oder mehr als einen TitleParent oder gleichzeitig eine ISBN existiert -->
<xsl:if test="./TitleParent and not((count(./TitleParent) = 1) and (count(./Identifier[@Type = 'issn']) = 1) and not(./Identifier[@Type = 'isbn']))">
<xsl:for-each select="./Identifier[@Type = 'issn']">
<marc:datafield ind1="0" ind2=" " tag="773">
<marc:subfield code="x">
<xsl:value-of select="./@Value"/>
</marc:subfield>
</marc:datafield>
</xsl:for-each>
</xsl:if>
<!-- beim Vorhandensein mindestens eines TitleParent: ISBNs werden einzeln ausgegeben,
wenn es mehr als eine gibt oder mehr als einen TitleParent oder gleichzeitig eine ISSN existiert -->
<xsl:if test="./TitleParent and not((count(./TitleParent) = 1) and (count(./Identifier[@Type = 'isbn']) = 1) and not(./Identifier[@Type = 'issn']))">
<xsl:for-each select="./Identifier[@Type = 'isbn']">
<marc:datafield ind1="0" ind2=" " tag="773">
<marc:subfield code="z">
<xsl:value-of select="./@Value"/>
</marc:subfield>
</marc:datafield>
</xsl:for-each>
</xsl:if>
<xsl:if test="./Identifier[@Type = 'urn']">
<marc:datafield ind1="4" ind2="0" tag="856">
<marc:subfield code="u">
<xsl:value-of select="php:functionString('Application_Xslt::optionValue', 'resolverUrl', 'urn')"/>
<xsl:value-of select="./Identifier[@Type = 'urn']/@Value"/>
</marc:subfield>
<marc:subfield code="x">Resolving-URL</marc:subfield>
</marc:datafield>
</xsl:if>
<marc:datafield ind1="4" ind2="0" tag="856">
<marc:subfield code="u">
<xsl:value-of select="php:functionString('Application_Xslt::frontdoorUrl', @Id)"/>
</marc:subfield>
<marc:subfield code="q">
<xsl:text>text/html</xsl:text>
</marc:subfield>
<marc:subfield code="x">
<xsl:text>Frontdoor-URL</xsl:text>
</marc:subfield>
</marc:datafield>
<!-- wenn mindestens eine Datei (mit visibleInOai = 1) vorhanden ist, erzeuge Transfer-URL für den OAI-Container -->
<xsl:if test="./File[@VisibleInOai = 1]">
<marc:datafield ind1="4" ind2="0" tag="856">
<marc:subfield code="u">
<xsl:value-of select="php:functionString('Application_Xslt::transferUrl', ./@Id)"/>
</marc:subfield>
<marc:subfield code="x">
<xsl:text>Transfer-URL</xsl:text>
</marc:subfield>
<xsl:if test="./Licence">
<marc:subfield code="z">
<xsl:value-of select="./Licence[1]/@NameLong"/>
</marc:subfield>
</xsl:if>
</marc:datafield>
</xsl:if>
<xsl:for-each select="./File[@VisibleInOai = 1]">
<marc:datafield ind1="4" ind2="0" tag="856">
<marc:subfield code="u">
<xsl:value-of select="php:functionString('Application_Xslt::fileUrl', ../@Id, ./@PathName)"/>
</marc:subfield>
<xsl:if test="./@MimeType">
<marc:subfield code="q">
<xsl:value-of select="./@MimeType"/>
</marc:subfield>
</xsl:if>
<xsl:if test="../Licence">
<marc:subfield code="z">
<xsl:value-of select="../Licence[1]/@NameLong"/>
</marc:subfield>
</xsl:if>
</marc:datafield>
</xsl:for-each>
</marc:record>
</marc:collection>
</xsl:template>
<xsl:template match="PersonAuthor|PersonEditor|PersonAdvisor|PersonContributor" mode="marc21">
<xsl:param name="tag"/>
<xsl:param name="role"/>
<marc:datafield ind1="1" ind2=" " tag='{$tag}'>
<marc:subfield code="a">
<xsl:value-of select="@LastName"/>
<xsl:if test="@FirstName">
<xsl:text>, </xsl:text>
<xsl:value-of select="@FirstName"/>
</xsl:if>
</marc:subfield>
<marc:subfield code="4">
<xsl:value-of select="$role"/>
</marc:subfield>
</marc:datafield>
</xsl:template>
<xsl:template name="subfieldG">
<xsl:param name="volume"/>
<xsl:param name="issue"/>
<xsl:param name="pageFirst"/>
<xsl:param name="pageLast"/>
<xsl:if test="$volume or $issue or ($pageFirst and $pageLast)">
<marc:subfield code="g">
<xsl:if test="$volume">
<xsl:text>Jahrgang </xsl:text>
<xsl:value-of select="$volume"/>
<xsl:if test="($issue) or (not($issue) and ($pageFirst and $pageLast))">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:if>
<xsl:if test="$issue">
<xsl:text>Heft </xsl:text>
<xsl:value-of select="$issue"/>
<xsl:if test="$pageFirst and $pageLast">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:if>
<xsl:if test="$pageFirst and $pageLast">
<xsl:text>Seiten </xsl:text>
<xsl:value-of select="$pageFirst"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="$pageLast"/>
</xsl:if>
</marc:subfield>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View file

@ -0,0 +1,576 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
http://ws.pangaea.de/oai/oai2.xsl
XSL Transform to convert OAI 2.0 responses into XHTML
By Christopher Gutteridge, University of Southampton
-->
<!--
Copyright (c) 2000-2004 University of Southampton, UK. SO17 1BJ.
EPrints 2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
EPrints 2 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with EPrints 2; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<!--
All the elements really needed for EPrints are done but if
you want to use this XSL for other OAI archive you may want
to make some minor changes or additions.
Not Done
The 'about' section of 'record'
The 'compession' part of 'identify'
The optional attributes of 'resumptionToken'
The optional 'setDescription' container of 'set'
All the links just link to oai_dc versions of records.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:oai="http://www.openarchives.org/OAI/2.0/"
xmlns:id="http://www.openarchives.org/OAI/2.0/oai-identifier"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
xmlns:ep="http://www.openarchives.org/OAI/1.1/eprints"
xmlns:fr="http://www.openarchives.org/OAI/2.0/friends/"
xmlns:br="http://www.openarchives.org/OAI/2.0/branding/"
xmlns:gw="http://www.openarchives.org/OAI/2.0/gateway/x"
expand-text="yes"
version="3.0">
<xsl:output method="html" encoding="UTF-8" omit-xml-declaration="yes" doctype-system="about:legacy-compat"/>
<!-- define variables -->
<xsl:variable name='identifier' select="substring-before(concat(substring-after(/oai:OAI-PMH/oai:request,'identifier='),'&amp;'),'&amp;')" />
<!-- root template -->
<xsl:template match="/">
<html>
<head>
<title>TETHYS OAI 2.0 Request Results</title>
<!-- <style><xsl:call-template name="style"/></style> -->
<link rel="stylesheet" type="text/css" href="assets2/style.css" />
<!-- Favicon
-->
<!-- <link rel="apple-touch-icon" sizes="180x180" href="/images/favicon/apple-touch-icon.png"/>
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon/favicon-32x32.png"/>
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon/favicon-16x16.png"/>
<link rel="manifest" href="/images/favicon/site.webmanifest"/>
<link rel="mask-icon" href="/images/favicon/safari-pinned-tab.svg" color="#5bbad5"/> -->
<link rel="shortcut icon" href="/assets2/favicon.ico"/>
<!-- <style>h2{font-size:22pt;text-decoration:underline}para{color:green}</style> -->
</head>
<body>
<h1>TETHYS OAI 2.0 Request Results</h1>
<xsl:call-template name="quicklinks"/>
<p class="intro">
You are viewing an HTML version of the XML OAI response. To see the underlying XML use your web browsers view source option. More information about this XSLT is at the <a href="#moreinfo">bottom of the page</a>.
</p>
<xsl:apply-templates select="/oai:OAI-PMH" />
<xsl:call-template name="quicklinks"/>
<h2><a name="moreinfo">About the XSLT</a></h2>
<p>An XSLT file has converted the <a href="http://www.openarchives.org">OAI-PMH 2.0</a> responses into XHTML which looks nice in a browser which supports XSLT such as Mozilla, Firebird and Internet Explorer. The XSLT file was created by <a href="http://www.ecs.soton.ac.uk/people/cjg">Christopher Gutteridge</a> at the University of Southampton as part of the <a href="http://software.eprints.org">GNU EPrints system</a>, and is freely redistributable under the <a href="http://www.gnu.org">GPL</a>.</p><p>If you want to use the XSL file on your own OAI interface you may but due to the way XSLT works you must install the XSL file on the same server as the OAI script, you can't just link to this copy.</p><p>For more information or to download the XSL file please see the <a href="http://software.eprints.org/xslt.php">OAI to XHTML XSLT homepage</a>.</p>
</body>
</html>
</xsl:template>
<xsl:template name="quicklinks">
<ul class="quicklinks">
<li><a href="?verb=Identify">Identify</a> | </li>
<li><a href="?verb=ListRecords&amp;metadataPrefix=oai_dc">ListRecords</a> | </li>
<li><a href="?verb=ListSets">ListSets</a> | </li>
<li><a href="?verb=ListMetadataFormats">ListMetadataFormats</a> | </li>
<li><a href="?verb=ListIdentifiers&amp;metadataPrefix=oai_dc">ListIdentifiers</a></li>
</ul>
</xsl:template>
<xsl:template match="/oai:OAI-PMH">
<table class="values">
<tr><td class="key">Datestamp of response</td>
<td class="value"><xsl:value-of select="oai:responseDate"/></td></tr>
<tr><td class="key">Request URL</td>
<td class="value"><xsl:value-of select="oai:request"/></td></tr>
</table>
<!-- verb: [<xsl:value-of select="oai:request/@verb" />]<br /> -->
<xsl:choose>
<xsl:when test="oai:error">
<h2>OAI Error(s)</h2>
<p>The request could not be completed due to the following error or errors.</p>
<div class="results">
<xsl:apply-templates select="oai:error"/>
</div>
</xsl:when>
<xsl:otherwise>
<p>Request was of type <xsl:value-of select="oai:request/@verb"/>.</p>
<div class="results">
<xsl:apply-templates select="oai:Identify" />
<xsl:apply-templates select="oai:GetRecord"/>
<xsl:apply-templates select="oai:ListRecords"/>
<xsl:apply-templates select="oai:ListSets"/>
<xsl:apply-templates select="oai:ListMetadataFormats"/>
<xsl:apply-templates select="oai:ListIdentifiers"/>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ERROR -->
<xsl:template match="/oai:OAI-PMH/oai:error">
<table class="values">
<tr><td class="key">Error Code</td>
<td class="value"><xsl:value-of select="@code"/></td></tr>
</table>
<p class="error"><xsl:value-of select="." /></p>
</xsl:template>
<!-- IDENTIFY -->
<xsl:template match="/oai:OAI-PMH/oai:Identify">
<table class="values">
<tr><td class="key">Repository Name</td>
<td class="value"><xsl:value-of select="oai:repositoryName"/></td></tr>
<tr><td class="key">Base URL</td>
<td class="value"><xsl:value-of select="oai:baseURL"/></td></tr>
<tr><td class="key">Protocol Version</td>
<td class="value"><xsl:value-of select="oai:protocolVersion"/></td></tr>
<tr><td class="key">Earliest Datestamp</td>
<td class="value"><xsl:value-of select="oai:earliestDatestamp"/></td></tr>
<tr><td class="key">Deleted Record Policy</td>
<td class="value"><xsl:value-of select="oai:deletedRecord"/></td></tr>
<tr><td class="key">Granularity</td>
<td class="value"><xsl:value-of select="oai:granularity"/></td></tr>
<xsl:apply-templates select="oai:adminEmail"/>
</table>
<xsl:apply-templates select="oai:description"/>
<!--no warning about unsupported descriptions -->
</xsl:template>
<xsl:template match="/oai:OAI-PMH/oai:Identify/oai:adminEmail">
<tr>
<td class="key">Admin Email</td>
<td class="value"><xsl:value-of select="."/></td>
</tr>
</xsl:template>
<!--
Identify / Unsupported Description
-->
<xsl:template match="oai:description/*" priority="-100">
<h2>Unsupported Description Type</h2>
<p>The XSL currently does not support this type of description.</p>
<div class="xmlSource">
<xsl:apply-templates select="." mode='xmlMarkup' />
</div>
</xsl:template>
<!--
Identify / OAI-Identifier
-->
<xsl:template match="id:oai-identifier" xmlns:id="http://www.openarchives.org/OAI/2.0/oai-identifier">
<h2>OAI-Identifier</h2>
<table class="values">
<tr><td class="key">Scheme</td>
<td class="value"><xsl:value-of select="id:scheme"/></td></tr>
<tr><td class="key">Repository Identifier</td>
<td class="value"><xsl:value-of select="id:repositoryIdentifier"/></td></tr>
<tr><td class="key">Delimiter</td>
<td class="value"><xsl:value-of select="id:delimiter"/></td></tr>
<tr><td class="key">Sample OAI Identifier</td>
<td class="value"><xsl:value-of select="id:sampleIdentifier"/></td></tr>
</table>
</xsl:template>
<!--
Identify / EPrints
-->
<xsl:template match="ep:eprints" xmlns:ep="http://www.openarchives.org/OAI/1.1/eprints">
<h2>EPrints Description</h2>
<h3>Content</h3>
<xsl:apply-templates select="ep:content"/>
<xsl:if test="ep:submissionPolicy">
<h3>Submission Policy</h3>
<xsl:apply-templates select="ep:submissionPolicy"/>
</xsl:if>
<h3>Metadata Policy</h3>
<xsl:apply-templates select="ep:metadataPolicy"/>
<h3>Data Policy</h3>
<xsl:apply-templates select="ep:dataPolicy"/>
<xsl:if test="ep:content">
<h3>Content</h3>
<xsl:apply-templates select="ep:content"/>
</xsl:if>
<xsl:apply-templates select="ep:comment"/>
</xsl:template>
<xsl:template match="ep:content|ep:dataPolicy|ep:metadataPolicy|ep:submissionPolicy" xmlns:ep="http://www.openarchives.org/OAI/1.1/eprints">
<xsl:if test="ep:text">
<p><xsl:value-of select="ep:text" /></p>
</xsl:if>
<xsl:if test="ep:URL">
<div><a href="{ep:URL}"><xsl:value-of select="ep:URL" /></a></div>
</xsl:if>
</xsl:template>
<xsl:template match="ep:comment" xmlns:ep="http://www.openarchives.org/OAI/1.1/eprints">
<h3>Comment</h3>
<div><xsl:value-of select="."/></div>
</xsl:template>
<!--
Identify / Friends
-->
<xsl:template match="fr:friends" xmlns:fr="http://www.openarchives.org/OAI/2.0/friends/">
<h2>Friends</h2>
<ul>
<xsl:apply-templates select="fr:baseURL"/>
</ul>
</xsl:template>
<xsl:template match="fr:baseURL" xmlns:fr="http://www.openarchives.org/OAI/2.0/friends/">
<li><xsl:value-of select="."/>
<xsl:text> </xsl:text>
<a class="link" href="{.}?verb=Identify">Identify</a></li>
</xsl:template>
<!--
Identify / Branding
-->
<xsl:template match="br:branding" xmlns:br="http://www.openarchives.org/OAI/2.0/branding/">
<h2>Branding</h2>
<xsl:apply-templates select="br:collectionIcon"/>
<xsl:apply-templates select="br:metadataRendering"/>
</xsl:template>
<xsl:template match="br:collectionIcon" xmlns:br="http://www.openarchives.org/OAI/2.0/branding/">
<h3>Icon</h3>
<xsl:choose>
<xsl:when test="link!=''">
<a href="{br:link}"><img src="{br:url}" alt="{br:title}" width="{br:width}" height="{br:height}" border="0" /></a>
</xsl:when>
<xsl:otherwise>
<img src="{br:url}" alt="{br:title}" width="{br:width}" height="{br:height}" border="0" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="br:metadataRendering" xmlns:br="http://www.openarchives.org/OAI/2.0/branding/">
<h3>Metadata Rendering Rule</h3>
<table class="values">
<tr><td class="key">URL</td>
<td class="value"><xsl:value-of select="."/></td></tr>
<tr><td class="key">Namespace</td>
<td class="value"><xsl:value-of select="@metadataNamespace"/></td></tr>
<tr><td class="key">Mime Type</td>
<td class="value"><xsl:value-of select="@mimetype"/></td></tr>
</table>
</xsl:template>
<!--
Identify / Gateway
-->
<xsl:template match="gw:gateway" xmlns:gw="http://www.openarchives.org/OAI/2.0/gateway/x">
<h2>Gateway Information</h2>
<table class="values">
<tr><td class="key">Source</td>
<td class="value"><xsl:value-of select="gw:source"/></td></tr>
<tr><td class="key">Description</td>
<td class="value"><xsl:value-of select="gw:gatewayDescription"/></td></tr>
<xsl:apply-templates select="gw:gatewayAdmin"/>
<xsl:if test="gw:gatewayURL">
<tr><td class="key">URL</td>
<td class="value"><xsl:value-of select="gw:gatewayURL"/></td></tr>
</xsl:if>
<xsl:if test="gw:gatewayNotes">
<tr><td class="key">Notes</td>
<td class="value"><xsl:value-of select="gw:gatewayNotes"/></td></tr>
</xsl:if>
</table>
</xsl:template>
<xsl:template match="gw:gatewayAdmin" xmlns:gw="http://www.openarchives.org/OAI/2.0/gateway/">
<tr><td class="key">Admin</td>
<td class="value"><xsl:value-of select="."/></td></tr>
</xsl:template>
<!-- GetRecord -->
<xsl:template match="oai:GetRecord">
<xsl:apply-templates select="oai:record" />
</xsl:template>
<!-- ListRecords -->
<xsl:template match="oai:ListRecords">
<xsl:apply-templates select="oai:record" />
<xsl:apply-templates select="oai:resumptionToken" />
</xsl:template>
<!-- ListIdentifiers -->
<xsl:template match="oai:ListIdentifiers">
<xsl:apply-templates select="oai:header" />
<xsl:apply-templates select="oai:resumptionToken" />
</xsl:template>
<!-- ListSets -->
<xsl:template match="oai:ListSets">
<xsl:apply-templates select="oai:set" />
<xsl:apply-templates select="oai:resumptionToken" />
</xsl:template>
<xsl:template match="oai:set">
<h2>Set</h2>
<table class="values">
<tr><td class="key">setName</td>
<td class="value"><xsl:value-of select="oai:setName"/></td></tr>
<xsl:apply-templates select="oai:setSpec" />
</table>
</xsl:template>
<!-- ListMetadataFormats -->
<xsl:template match="oai:ListMetadataFormats">
<xsl:choose>
<xsl:when test="$identifier">
<p>This is a list of metadata formats available for the record "<xsl:value-of select='$identifier' />". Use these links to view the metadata: <xsl:apply-templates select="oai:metadataFormat/oai:metadataPrefix" /></p>
</xsl:when>
<xsl:otherwise>
<p>This is a list of metadata formats available from this archive.</p>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="oai:metadataFormat" />
</xsl:template>
<xsl:template match="oai:metadataFormat">
<h2>Metadata Format</h2>
<table class="values">
<tr>
<td class="key">metadataPrefix</td>
<!-- <td class="value"><xsl:value-of select="oai:metadataPrefix"/></td> -->
<td class="value">
<a class="link" href="?verb=ListRecords&amp;metadataPrefix={oai:metadataPrefix}"><xsl:value-of select="oai:metadataPrefix"/></a>
</td>
</tr>
<tr>
<td class="key">metadataNamespace</td>
<td class="value"><xsl:value-of select="oai:metadataNamespace"/></td>
</tr>
<tr>
<td class="key">schema</td>
<td class="value"><a href="{oai:schema}"><xsl:value-of select="oai:schema"/></a></td>
</tr>
</table>
</xsl:template>
<xsl:template match="oai:metadataPrefix">
<xsl:text> </xsl:text><a class="link" href="?verb=GetRecord&amp;metadataPrefix={.}&amp;identifier={$identifier}"><xsl:value-of select='.' /></a>
</xsl:template>
<!-- record object -->
<xsl:template match="oai:record">
<h2 class="oaiRecordTitle">OAI Record: <xsl:value-of select="oai:header/oai:identifier"/></h2>
<div class="oaiRecord">
<xsl:apply-templates select="oai:header" />
<xsl:apply-templates select="oai:metadata" />
<xsl:apply-templates select="oai:about" />
</div>
</xsl:template>
<xsl:template match="oai:header">
<h3>OAI Record Header</h3>
<table class="values">
<tr><td class="key">OAI Identifier</td>
<td class="value">
<xsl:value-of select="oai:identifier"/>
<xsl:text> </xsl:text><a class="link" href="?verb=GetRecord&amp;metadataPrefix=oai_dc&amp;identifier={oai:identifier}">oai_dc</a>
<xsl:text> </xsl:text><a class="link" href="?verb=ListMetadataFormats&amp;identifier={oai:identifier}">formats</a>
</td></tr>
<tr><td class="key">Datestamp</td>
<td class="value"><xsl:value-of select="oai:datestamp"/></td></tr>
<xsl:apply-templates select="oai:setSpec" />
</table>
<xsl:if test="@status='deleted'">
<p>This record has been deleted.</p>
</xsl:if>
</xsl:template>
<xsl:template match="oai:about">
<p>"about" part of record container not supported by the XSL</p>
</xsl:template>
<xsl:template match="oai:metadata">
&#160;
<div class="metadata">
<xsl:apply-templates select="*" />
</div>
</xsl:template>
<!-- oai setSpec object -->
<xsl:template match="oai:setSpec">
<tr><td class="key">setSpec</td>
<td class="value"><xsl:value-of select="."/>
<xsl:text> </xsl:text><a class="link" href="?verb=ListIdentifiers&amp;metadataPrefix=oai_dc&amp;set={.}">Identifiers</a>
<xsl:text> </xsl:text><a class="link" href="?verb=ListRecords&amp;metadataPrefix=oai_dc&amp;set={.}">Records</a>
</td></tr>
</xsl:template>
<!-- oai resumptionToken -->
<xsl:template match="oai:resumptionToken">
<p>There are more results.</p>
<table class="values">
<tr><td class="key">resumptionToken:</td>
<td class="value"><xsl:value-of select="."/>
<xsl:text> </xsl:text>
<a class="link" href="?verb={/oai:OAI-PMH/oai:request/@verb}&amp;resumptionToken={.}">Resume</a></td></tr>
</table>
</xsl:template>
<!-- unknown metadata format -->
<xsl:template match="oai:metadata/*" priority='-100'>
<h3>Unknown Metadata Format</h3>
<div class="xmlSource">
<xsl:apply-templates select="." mode='xmlMarkup' />
</div>
</xsl:template>
<!-- oai_dc record -->
<xsl:template match="oai_dc:dc" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" >
<div class="dcdata">
<h3>Dublin Core Metadata (oai_dc)</h3>
<table class="dcdata">
<xsl:apply-templates select="*" />
</table>
</div>
</xsl:template>
<xsl:template match="dc:title" xmlns:dc="http://purl.org/dc/elements/1.1/">
<tr>
<td class="key">Title</td>
<td class="value">
<xsl:value-of select="."/>
</td>
</tr>
</xsl:template>
<xsl:template match="dc:creator" xmlns:dc="http://purl.org/dc/elements/1.1/">
<tr><td class="key">Author or Creator</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
<xsl:template match="dc:subject" xmlns:dc="http://purl.org/dc/elements/1.1/">
<tr><td class="key">Subject and Keywords</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
<xsl:template match="dc:description" xmlns:dc="http://purl.org/dc/elements/1.1/">
<tr><td class="key">Description</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
<xsl:template match="dc:publisher" xmlns:dc="http://purl.org/dc/elements/1.1/">
<tr><td class="key">Publisher</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
<xsl:template match="dc:contributor" xmlns:dc="http://purl.org/dc/elements/1.1/">
<tr><td class="key">Other Contributor</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
<xsl:template match="dc:date" xmlns:dc="http://purl.org/dc/elements/1.1/">
<tr><td class="key">Date</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
<xsl:template match="dc:type" xmlns:dc="http://purl.org/dc/elements/1.1/">
<tr><td class="key">Resource Type</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
<xsl:template match="dc:format" xmlns:dc="http://purl.org/dc/elements/1.1/">
<tr><td class="key">Format</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
<xsl:template match="dc:identifier" xmlns:dc="http://purl.org/dc/elements/1.1/">
<tr><td class="key">Resource Identifier</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
<xsl:template match="dc:source" xmlns:dc="http://purl.org/dc/elements/1.1/">
<tr><td class="key">Source</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
<xsl:template match="dc:language" xmlns:dc="http://purl.org/dc/elements/1.1/">
<tr><td class="key">Language</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
<xsl:template match="dc:relation" xmlns:dc="http://purl.org/dc/elements/1.1/">
<tr><td class="key">Relation</td><td class="value">
<xsl:choose>
<xsl:when test='starts-with(.,"http" )'>
<xsl:choose>
<xsl:when test='string-length(.) &gt; 50'>
<a class="link" href="{.}">URL</a>
<i> URL not shown as it is very long.</i>
</xsl:when>
<xsl:otherwise>
<a href="{.}"><xsl:value-of select="."/></a>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</td></tr></xsl:template>
<xsl:template match="dc:coverage" xmlns:dc="http://purl.org/dc/elements/1.1/">
<tr><td class="key">Coverage</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
<xsl:template match="dc:rights" xmlns:dc="http://purl.org/dc/elements/1.1/">
<tr><td class="key">Rights Management</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
<!-- XML Pretty Maker -->
<xsl:template match="node()" mode='xmlMarkup'>
<div class="xmlBlock">
&lt;<span class="xmlTagName"><xsl:value-of select='name(.)' /></span><xsl:apply-templates select="@*" mode='xmlMarkup'/>&gt;<xsl:apply-templates select="node()" mode='xmlMarkup' />&lt;/<span class="xmlTagName"><xsl:value-of select='name(.)' /></span>&gt;
</div>
</xsl:template>
<xsl:template match="text()" mode='xmlMarkup'><span class="xmlText"><xsl:value-of select='.' /></span></xsl:template>
<xsl:template match="@*" mode='xmlMarkup'>
<xsl:text> </xsl:text>
<span class="xmlAttrName">
<xsl:value-of select='name()' /></span>="<span class="xmlAttrValue"><xsl:value-of select='.' />
</span>"
</xsl:template>
<!-- <xsl:template name="xmlstyle">
.xmlSource {
font-size: 70%;
border: solid #c0c0a0 1px;
background-color: #ffffe0;
padding: 2em 2em 2em 0em;
}
.xmlBlock {
padding-left: 2em;
}
.xmlTagName {
color: #800000;
font-weight: bold;
}
.xmlAttrName {
font-weight: bold;
}
.xmlAttrValue {
color: #0000c0;
}
</xsl:template> -->
</xsl:stylesheet>

View file

@ -0,0 +1,753 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/**
* This file is part of TETHYS.
*
* LICENCE
* TETHYS is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the Licence, or any later version.
* OPUS is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details. You should have received a copy of the GNU General Public License
* along with OPUS; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @category Application
* @package Module Oai
* @author Arno Kaimbacher <arno.kaimbacher@geologie.ac.at>
* @copyright Copyright (c) 2022, GBA TETHYS development team
* @license http://www.gnu.org/licenses/gpl.html General Public License
*/
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://example.com/functions"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:gco="http://www.isotc211.org/2005/gco"
expand-text="yes"
version="3.0">
<xsl:output method="xml" encoding="utf-8" indent="yes"/>
<xsl:mode on-no-match="shallow-copy"/>
<xsl:import href="functions.xslt"/>
<!-- variables -->
<!-- <xsl:variable name="datacite-identifier_org" select="//*[name() = 'Identifier']"/> -->
<!-- <xsl:variable name="datacite-identifier" select="//*[name() = 'Identifier'][@Type = 'Doi']"/> -->
<xsl:variable name="fileIdentifierPrefix" select="string('at.tethys.dataset')"/>
<xsl:variable name="datacentre">
<xsl:choose>
<xsl:when test="string-length(normalize-space(@CreatingCorporation)) > 0">
<xsl:value-of select="normalize-space(@CreatingCorporation)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="string('Tethys RDR')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- main template for is 19139 -->
<xsl:template match="Rdr_Dataset" mode="iso19139">
<!-- <gmd:MD_Metadata xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:gml="http://www.opgeris.net/gml/3.2" xmlns:gmx="http://www.isotc211.org/2005/gmx"
xsi:schemaLocation="http://www.isotc211.org/2005/gmd https://www.isotc211.org/2005/gmd/metadataApplication.xsd http://www.isotc211.org/2005/gmd http://schemas.opengis.net/iso/19139/20060504/gmd/gmd.xsd http://www.isotc211.org/2005/gmx http://schemas.opengis.net/iso/19139/20060504/gmx/gmx.xsd"> -->
<gmd:MD_Metadata xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:srv="http://www.isotc211.org/2005/srv" xmlns:gmx="http://www.isotc211.org/2005/gmx"
xmlns:gts="http://www.isotc211.org/2005/gts" xmlns:gsr="http://www.isotc211.org/2005/gsr" xmlns:gmi="http://www.isotc211.org/2005/gmi" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xlink="http://www.w3.org/1999/xlink"
xsi:schemaLocation="http://www.isotc211.org/2005/gmd http://schemas.opengis.net/iso/19139/20060504/gmd/gmd.xsd http://www.isotc211.org/2005/gmx http://schemas.opengis.net/iso/19139/20060504/gmx/gmx.xsd http://www.isotc211.org/2005/srv http://schemas.opengis.net/iso/19139/20060504/srv/srv.xsd">
<!-- gmd:fileIdentifier -->
<xsl:if test="Identifier">
<xsl:apply-templates select="Identifier" mode="iso19139" />
</xsl:if>
<!-- Ressourensprache in der Eingabemaske von Tethys nicht erfasst-->
<gmd:language>
<gmd:LanguageCode codeList="http://www.loc.gov/standards/iso639-2/" codeListValue="ger"/>
</gmd:language>
<gmd:characterSet>
<gmd:MD_CharacterSetCode codeList="http://www.isotc211.org/2005/resources/codeList.xml#MD_CharacterSetCode" codeListValue="utf8"/>
</gmd:characterSet>
<!--gmd:hierarchyLevel template-->
<xsl:call-template name="hierarchylevel"/>
<gmd:hierarchyLevelName>
<gco:CharacterString>
<xsl:text>Dataset</xsl:text>
</gco:CharacterString>
</gmd:hierarchyLevelName>
<!-- gmd:contact - The contact for the metadata - static value assigned in template at the top of this file; -->
<xsl:call-template name="metadatacontact"/>
<!-- gmd:dateStamp -->
<xsl:call-template name="datestamp"/>
<gmd:metadataStandardName>
<gco:CharacterString>ISO 19139 Geographic Information - Metadata - Implementation Specification</gco:CharacterString>
</gmd:metadataStandardName>
<gmd:metadataStandardVersion>
<gco:CharacterString>2007</gco:CharacterString>
</gmd:metadataStandardVersion>
<gmd:referenceSystemInfo>
<gmd:MD_ReferenceSystem>
<gmd:referenceSystemIdentifier>
<gmd:RS_Identifier>
<gmd:code>
<!-- <gmx:Anchor xlink:href="https://www.opengis.net/def/crs/EPSG/0/25832">EPSG:25832</gmx:Anchor> -->
<gco:CharacterString>https://www.opengis.net/def/crs/EPSG/0/31287</gco:CharacterString>
</gmd:code>
<gmd:version>
<gco:CharacterString>6.11.2</gco:CharacterString>
</gmd:version>
</gmd:RS_Identifier>
</gmd:referenceSystemIdentifier>
</gmd:MD_ReferenceSystem>
</gmd:referenceSystemInfo>
<gmd:identificationInfo>
<gmd:MD_DataIdentification>
<!-- gmd:citation> -->
<gmd:citation>
<gmd:CI_Citation>
<!-- gmd:title -->
<xsl:call-template name="title"/>
<!-- <gmd:alternateTitle -->
<xsl:apply-templates select="TitleAdditional" mode="iso19139" />
<!-- gmd:date -->
<xsl:call-template name="resourcedates"/>
<!-- gmd:identifier -->
<!-- stower 2022, identifer gba https://doi.org/10.24341/tethys.53 -->
<gmd:identifier>
<xsl:for-each select="*[name() = 'Identifier']">
<!-- <xsl:variable name="datacite-identifier" select="Identifier[@Type = 'Doi']"/> -->
<xsl:variable name="datacite-identifier" select=".[@Type = 'Doi']"/>
<xsl:if test="string-length(.[@Type = 'Doi']/@Value) &gt; 0 and count([.[@Type = 'Doi']/@Type = 'Doi']) &gt; 0">
<gmd:MD_Identifier>
<gmd:code>
<gco:CharacterString>
<xsl:choose>
<xsl:when test="starts-with(.[@Type = 'Doi']/@Value, 'doi:') or contains(.[@Type = 'Doi']/@Value, 'doi.org')">
<xsl:value-of select=".[@Type = 'Doi']/@Value"/>
</xsl:when>
<xsl:when test="count(.[@Type = 'Doi']) &gt; 0 and $datacentre='Tethys RDR'">
<xsl:value-of select="concat(
'https://doi.org/',
string(.[@Type = 'Doi']/@Value)
)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select=".[@Type = 'Doi']/@Value"/>
</xsl:otherwise>
</xsl:choose>
</gco:CharacterString>
</gmd:code>
</gmd:MD_Identifier>
</xsl:if>
</xsl:for-each>
</gmd:identifier>
<!-- gmd:citedResponsibleParty - creator -->
<xsl:apply-templates select="PersonAuthor" mode="iso19139">
<xsl:sort select="@SortOrder"/>
</xsl:apply-templates>
<!-- gmd:citedResponsibleParty - contributor -->
<xsl:apply-templates select="PersonContributor" mode="iso19139">
<xsl:sort select="@SortOrder"/>
</xsl:apply-templates>
<!-- publisher -->
<gmd:citedResponsibleParty>
<xsl:call-template name="ci_responsibleparty">
<xsl:with-param name="organisation">
<xsl:value-of select="@CreatingCorporation"/>
</xsl:with-param>
<xsl:with-param name="role">publisher</xsl:with-param>
</xsl:call-template>
</gmd:citedResponsibleParty>
</gmd:CI_Citation>
</gmd:citation>
<!-- gmd:abstract -->
<xsl:call-template name="abstract"/>
<gmd:status>
<gmd:MD_ProgressCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_ProgressCode" codeListValue="Complete" codeSpace="ISOTC211/19115"/>
</gmd:status>
<!-- gmd:pointOfContact custodian -->
<xsl:call-template name="pointofcontact_custodian"/>
<!-- gmd:pointOfContact originator -->
<xsl:call-template name="pointofcontact_originator"/>
<!-- gmd:resourceMaintenance -->
<gmd:resourceMaintenance>
<gmd:MD_MaintenanceInformation>
<gmd:maintenanceAndUpdateFrequency>
<gmd:MD_MaintenanceFrequencyCode codeList="http://schemas.opengis.net/iso/19139/20070417/resources/codelist/gmxCodelists.xml#MD_MaintenanceFrequencyCode" codeListValue="asNeeded">asNeeded</gmd:MD_MaintenanceFrequencyCode>
</gmd:maintenanceAndUpdateFrequency>
</gmd:MD_MaintenanceInformation>
</gmd:resourceMaintenance>
<!-- gmd:credit -->
<!-- <xsl:if test="count(//*[name() = 'fundingReferences']) &gt; 0">
<xsl:for-each select="//*[local-name() = 'fundingReferences']/*[name() = 'fundingReference']">
<gmd:credit>
<gco:CharacterString>
<xsl:value-of select="normalize-space(concat(string('funderName:'), string(*[name() = 'funderName'])))"/>
<xsl:if test="count(*[local-name() = 'funderIdentifier']) &gt; 0">
<xsl:text>
</xsl:text>
<xsl:value-of select="normalize-space(concat(string('funderIdentifier:'), string(*[name() = 'funderIdentifier'])))"/>
<xsl:value-of select="normalize-space(concat(string('; IDType:'), string(*[name() = 'funderIdentifier']/@funderIdentifierType)))"/>
</xsl:if>
<xsl:if test="count(*[name() = 'awardNumber']) &gt; 0">
<xsl:text>
</xsl:text>
<xsl:value-of select="normalize-space(concat(string('awardNumber:'), string(*[name() = 'awardNumber'])))"/>
</xsl:if>
<xsl:if test="count(*[name() = 'awardTitle']) &gt; 0">
<xsl:text>
</xsl:text>
<xsl:value-of select="normalize-space(concat(string('awardTitle:'), string(*[name() = 'awardTitle'])))"/>
</xsl:if>
</gco:CharacterString>
</gmd:credit>
</xsl:for-each>
</xsl:if> -->
<!-- <gmd:graphicOverview> -->
<xsl:call-template name="browseGraphictethys"/>
<!-- gmd:descriptiveKeywords without thesaurus-->
<xsl:call-template name="freekeywords"/>
<xsl:call-template name="datacenter_keyword"/>
<!-- gmd:resourceConstraints -->
<xsl:apply-templates select="Licence" mode="iso19139" />
<gmd:resourceConstraints>
<gmd:MD_SecurityConstraints>
<gmd:classification>
<gmd:MD_ClassificationCode codeList="http://www.isotc211.org/2005/resources/codeList.xml#MD_ClassificationCode" codeListValue="unclassified"/>
</gmd:classification>
</gmd:MD_SecurityConstraints>
</gmd:resourceConstraints>
<!-- relatedresources mapped to gmd:aggregationInfo, -->
<!-- <xsl:call-template name="relatedResources">
<xsl:with-param name="relres" select="//*[local-name() = 'relatedIdentifiers']"/>
</xsl:call-template> -->
<!-- <gmd:aggregationInfo> -->
<xsl:apply-templates select="Reference" mode="iso19139" />
<gmd:spatialResolution>
<xsl:variable name="mainTitle">
<!-- <xsl:for-each select="$datacite-titles/*[name() = 'title']"> -->
<xsl:for-each select="*[name() = 'TitleMain']">
<xsl:if test="normalize-space(@Type) = 'Main'">
<xsl:value-of select="@Value"/>
</xsl:if>
</xsl:for-each>
</xsl:variable>
<gmd:MD_Resolution>
<xsl:choose>
<xsl:when test="contains($mainTitle, '50.000')">
<gmd:equivalentScale>
<gmd:MD_RepresentativeFraction>
<gmd:denominator>
<!-- <gco:Integer>{$mainTitle}</gco:Integer> -->
<gco:Integer>50000</gco:Integer>
</gmd:denominator>
</gmd:MD_RepresentativeFraction>
</gmd:equivalentScale>
</xsl:when>
<xsl:otherwise>
<gmd:distance>
<gco:Distance uom="m">-1</gco:Distance>
</gmd:distance>
</xsl:otherwise>
</xsl:choose>
</gmd:MD_Resolution>
</gmd:spatialResolution>
<!-- assume ger for now, stower 2022 -->
<gmd:language>
<gmd:LanguageCode codeList="http://www.loc.gov/standards/iso639-2/" codeListValue="ger"/>
</gmd:language>
<!-- ISOTopic19115, stower 2022 -->
<gmd:topicCategory>
<gmd:MD_TopicCategoryCode>geoscientificInformation</gmd:MD_TopicCategoryCode>
</gmd:topicCategory>
<!-- gmd:geographicElement> -->
<xsl:call-template name="spatialcoverage"/>
<!-- <xsl:call-template name="temporalcoverage"/> -->
</gmd:MD_DataIdentification>
</gmd:identificationInfo>
<!-- gmd:distributionInfo -->
<gmd:distributionInfo>
<gmd:MD_Distribution>
<!-- kaiarn 2022 gmd:distributionFormat -->
<xsl:apply-templates select="File" mode="iso19139" />
<!-- gmd:distributor -->
<xsl:call-template name="distributor" />
<!-- gmd:transferOptions -->
<gmd:transferOptions>
<gmd:MD_DigitalTransferOptions>
<!-- <xsl:call-template name="size"/> -->
<!-- <gmd:onLine> -->
<xsl:call-template name="datacite_identifier" />
<!-- <gmd:onLine> -->
<xsl:call-template name="alternate_identifier" />
</gmd:MD_DigitalTransferOptions>
</gmd:transferOptions>
</gmd:MD_Distribution>
</gmd:distributionInfo>
<!-- gmd:dataQualityInfo -->
<xsl:call-template name="data_quality"/>
<!-- <gmd:metadataMaintenance> -->
<xsl:call-template name="metadata_maintenance" />
</gmd:MD_Metadata>
</xsl:template>
<!-- further helper templates -->
<!-- gmd:resourceConstraints -->
<xsl:template match="Licence" mode="iso19139">
<gmd:resourceConstraints xlink:href="https://creativecommons.org/licenses/by/4.0/deed.en">
<gmd:MD_Constraints>
<gmd:useLimitation>
<gco:CharacterString>
<xsl:value-of select="string(@NameLong)"/>
</gco:CharacterString>
</gmd:useLimitation>
</gmd:MD_Constraints>
</gmd:resourceConstraints>
<gmd:resourceConstraints>
<gmd:MD_LegalConstraints>
<gmd:accessConstraints>
<gmd:MD_RestrictionCode codeList="http://www.isotc211.org/2005/resources/codeList.xml#MD_RestrictionCode" codeListValue="otherRestrictions"/>
</gmd:accessConstraints>
<gmd:otherConstraints>
<gco:CharacterString>
<xsl:value-of select="string(@NameLong)"/>
</gco:CharacterString>
</gmd:otherConstraints>
</gmd:MD_LegalConstraints>
</gmd:resourceConstraints>
</xsl:template>
<!-- gmd:fileIdentifier -->
<xsl:template match="Identifier" mode="iso19139">
<gmd:fileIdentifier>
<gco:CharacterString>
<!-- <xsl:value-of select="@Value" /> -->
<xsl:choose>
<xsl:when test="string-length(@Value) &gt; 0 and count([@Type = 'Doi']) &gt; 0">
<xsl:value-of select="concat($fileIdentifierPrefix, normalize-space(substring-after(@Value, '/tethys.')))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="string(@Value)"/>
</xsl:otherwise>
</xsl:choose>
</gco:CharacterString>
</gmd:fileIdentifier>
</xsl:template>
<!-- gmd:dateStamp template-->
<xsl:template name="datestamp">
<gmd:dateStamp>
<!-- define vriable theDate -->
<xsl:variable name="theDate">
<xsl:choose>
<xsl:when test="ServerDateModified">
<xsl:value-of select="concat(
ServerDateModified/@Year, '-',
format-number(number(ServerDateModified/@Month),'00'), '-',
format-number(number(ServerDateModified/@Day),'00')
)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(
ServerDatePublished/@Year, '-',
format-number(number(ServerDatePublished/@Month),'00'), '-',
format-number(number(ServerDatePublished/@Day),'00')
)" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<gco:Date>
<xsl:value-of select="string($theDate)"/>
</gco:Date>
</gmd:dateStamp>
</xsl:template>
<!-- gmd:title -->
<xsl:template name="title">
<gmd:title>
<gco:CharacterString>
<xsl:for-each select="*[name() = 'TitleMain' or name() = 'TitleAdditional']">
<xsl:choose>
<xsl:when test="string(@Type) = 'Main'">
<xsl:value-of select="@Value"/>
</xsl:when>
<xsl:when test="string(@Type) = 'Sub' and @Value != ''">
<xsl:value-of select="concat('; Subtitle: ', @Value)"/>
</xsl:when>
<xsl:when test="string(@Type) = 'Translated' and @Value != ''">
<xsl:value-of select="concat('; Translated title: ', @Value)"/>
</xsl:when>
<xsl:when test="string(@Type) = 'Other' and @Value != ''">
<xsl:value-of select="concat('; Other title: ', @Value)"/>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</gco:CharacterString>
</gmd:title>
</xsl:template>
<!-- <gmd:alternateTitle> -->
<xsl:template match="TitleAdditional" mode="iso19139">
<xsl:if test="string(@Type) = 'Alternative' and @Value != ''">
<gmd:alternateTitle>
<gco:CharacterString>
<xsl:value-of select="string(@Value)"/>
</gco:CharacterString>
</gmd:alternateTitle>
</xsl:if>
</xsl:template>
<!-- <gmd:citedResponsibleParty> -->
<xsl:template match="PersonAuthor" mode="iso19139">
<gmd:citedResponsibleParty>
<xsl:variable name="http-uri">
<xsl:choose>
<xsl:when test="string-length(@IdentifierOrcid) > 0">
<xsl:value-of select="concat(
'http://orcid.org/',
string(@IdentifierOrcid)
)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="string('')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- set attribute xlink:href -->
<xsl:if test="$http-uri != ''">
<xsl:attribute name="xlink:href">
<xsl:value-of select="$http-uri"/>
</xsl:attribute>
</xsl:if>
<xsl:variable name="nameidscheme">
<xsl:choose>
<xsl:when test="starts-with($http-uri, 'http://orcid.org/')">
<xsl:value-of select="string('ORCID')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="string('')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="email">
<xsl:choose>
<xsl:when test="@Email != ''">
<xsl:value-of select="@Email"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="string('')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="affiliation">
<xsl:choose>
<xsl:when test="@NameType = 'Personal'">
<xsl:value-of select="string('GBA')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="string('')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="creatorname">
<xsl:value-of select="@LastName" />
<xsl:if test="@FirstName != ''">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:value-of select="@FirstName" />
<xsl:if test="@AcademicTitle != ''">
<xsl:text> (</xsl:text>
<xsl:value-of select="@AcademicTitle" />
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:variable>
<xsl:variable name="namestring">
<xsl:choose>
<xsl:when test="normalize-space(@LastName) != ''">
<xsl:value-of select="
concat(
normalize-space(@LastName),
', ',
normalize-space(@FirstName))"/>
</xsl:when>
<!-- <xsl:when test="normalize-space(*[local-name() = 'creatorName']) != ''">
<xsl:value-of select="normalize-space(*[local-name() = 'creatorName'])"/>
</xsl:when> -->
<xsl:otherwise>
<xsl:value-of select="string('missing')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="ci_responsibleparty">
<xsl:with-param name="individual">
<xsl:value-of select="$namestring"/>
</xsl:with-param>
<xsl:with-param name="personidtype">
<xsl:value-of select="$nameidscheme"/>
</xsl:with-param>
<xsl:with-param name="organisation">
<xsl:value-of select="$affiliation"/>
</xsl:with-param>
<xsl:with-param name="role">author</xsl:with-param>
<xsl:with-param name="email">
<xsl:value-of select="$email"/>
</xsl:with-param>
<xsl:with-param name="datacite-creatorname">
<xsl:value-of select="$creatorname"/>
</xsl:with-param>
</xsl:call-template>
<!-- <xsl:value-of select="$namestring"/> -->
</gmd:citedResponsibleParty>
</xsl:template>
<xsl:template match="PersonContributor" mode="iso19139">
<xsl:variable name="dcrole" select="normalize-space(./@ContributorType)"/>
<xsl:variable name="role">
<xsl:choose>
<xsl:when test="$dcrole = 'ContactPerson'">pointOfContact</xsl:when>
<xsl:when test="$dcrole = 'DataCollector'">collaborator</xsl:when>
<xsl:when test="$dcrole = 'DataCurator'">custodian</xsl:when>
<xsl:when test="$dcrole = 'DataManager'">custodian</xsl:when>
<xsl:when test="$dcrole = 'Distributor'">originator</xsl:when>
<xsl:when test="$dcrole = 'Editor'">editor</xsl:when>
<xsl:when test="$dcrole = 'Funder'">funder</xsl:when>
<xsl:when test="$dcrole = 'HostingInstitution'">distributor</xsl:when>
<xsl:when test="$dcrole = 'ProjectLeader'">collaborator</xsl:when>
<xsl:when test="$dcrole = 'ProjectManager'">collaborator</xsl:when>
<xsl:when test="$dcrole = 'ProjectMember'">collaborator</xsl:when>
<xsl:when test="$dcrole = 'ResearchGroup'">collaborator</xsl:when>
<xsl:when test="$dcrole = 'Researcher'">collaborator</xsl:when>
<xsl:when test="$dcrole = 'RightsHolder'">rightsHolder</xsl:when>
<xsl:when test="$dcrole = 'Sponsor'">funder</xsl:when>
<xsl:when test="$dcrole = 'WorkPackageLeader'">collaborator</xsl:when>
<xsl:otherwise>contributor</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<gmd:citedResponsibleParty>
<xsl:variable name="http-uri">
<xsl:choose>
<xsl:when test="string-length(@IdentifierOrcid) > 0">
<xsl:value-of select="concat(
'http://orcid.org/',
string(@IdentifierOrcid)
)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="string('')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- set attribute xlink:href -->
<xsl:if test="$http-uri != ''">
<xsl:attribute name="xlink:href">
<xsl:value-of select="$http-uri"/>
</xsl:attribute>
</xsl:if>
<xsl:variable name="nameidscheme">
<xsl:choose>
<xsl:when test="starts-with($http-uri, 'http://orcid.org/')">
<xsl:value-of select="string('ORCID')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="string('')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="email">
<xsl:choose>
<xsl:when test="@Email != ''">
<xsl:value-of select="@Email"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="string('')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="affiliation">
<xsl:choose>
<xsl:when test="@NameType = 'Personal'">
<xsl:value-of select="string('GBA')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="string('')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="contrnamestring">
<xsl:choose>
<xsl:when test="normalize-space(@LastName) != ''">
<xsl:value-of select="
concat(
normalize-space(@LastName),
', ',
normalize-space(@FirstName))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="string('missing')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="ci_responsibleparty">
<xsl:with-param name="individual">
<xsl:value-of select="$contrnamestring"/>
</xsl:with-param>
<xsl:with-param name="httpuri">
<xsl:value-of select="$http-uri"/>
</xsl:with-param>
<xsl:with-param name="personidtype">
<xsl:value-of select="$nameidscheme"/>
</xsl:with-param>
<xsl:with-param name="organisation">
<xsl:value-of select="$affiliation"/>
</xsl:with-param>
<xsl:with-param name="position">
<xsl:value-of select="$dcrole"/>
</xsl:with-param>
<xsl:with-param name="email">
<xsl:value-of select="$email"/>
</xsl:with-param>
<xsl:with-param name="role" select="$role"/>
</xsl:call-template>
</gmd:citedResponsibleParty>
</xsl:template>
<xsl:variable name="nl" select="string('&#10;')"/>
<!-- gmd:abstract -->
<xsl:template name="abstract">
<gmd:abstract>
<gco:CharacterString>
<xsl:for-each select="*[name() = 'TitleAbstract' or name() = 'TitleAbstractAdditional']">
<!-- <xsl:text>&#10;</xsl:text> -->
<xsl:choose>
<xsl:when test="string(@Type) = 'Abstract'">
<!-- <xsl:value-of select="@Value"/> -->
<xsl:value-of select="concat('&#10;Abstract: ', string(@Value))"/>
</xsl:when>
<xsl:when test="string(@Type) = 'Translated'">
<xsl:value-of select="concat('&#10;Translated Description: ', string(@Value))"/>
</xsl:when>
<xsl:when test="string(@Type) = 'SeriesInformation' and @Value != ''">
<xsl:value-of select="concat('&#10;Series Information: ', string(@Value))"/>
</xsl:when>
<xsl:when test="string(@Type) = 'TableOfContents' and @Value != ''">
<xsl:value-of select="concat('&#10;Table of Contents: ', string(@Value))"/>
</xsl:when>
<xsl:when test="string(@Type) = 'TechnicalInfo' and @Value != ''">
<xsl:value-of select="concat('&#10;Technical Info: ', string(@Value))"/>
</xsl:when>
<xsl:when test="string(@Type) = 'Methods' and @Value != ''">
<xsl:value-of select="concat('&#10;Methods: ', string(@Value))"/>
</xsl:when>
<xsl:when test="string(@Type) = 'Other' and @Value != ''">
<xsl:if test="not(contains(string(@Value), 'Related publications:'))">
<xsl:value-of select="concat('&#10;Other Description: ', string(@Value))"/>
</xsl:if>
</xsl:when>
</xsl:choose>
</xsl:for-each>
<!-- <xsl:value-of select="$nl" disable-output-escaping="no"/> -->
</gco:CharacterString>
</gmd:abstract>
</xsl:template>
<!-- <gmd:aggregationInfo> -->
<xsl:template match="Reference" mode="iso19139">
<xsl:if test="
not(contains(normalize-space(string(@Value)), 'missing')) and
not(contains(normalize-space(string(@Value)), 'unknown'))">
<gmd:aggregationInfo>
<gmd:MD_AggregateInformation>
<gmd:aggregateDataSetIdentifier>
<gmd:RS_Identifier>
<gmd:code>
<gco:CharacterString>
<xsl:value-of select="normalize-space(string(@Value))"/>
</gco:CharacterString>
</gmd:code>
<gmd:codeSpace>
<gco:CharacterString>
<xsl:value-of select="normalize-space(string(@Type))"/>
</gco:CharacterString>
</gmd:codeSpace>
</gmd:RS_Identifier>
</gmd:aggregateDataSetIdentifier>
<gmd:associationType>
<xsl:element name="gmd:DS_AssociationTypeCode">
<xsl:attribute name="codeList">
<xsl:value-of select="string('http://datacite.org/schema/kernel-4')"/>
</xsl:attribute>
<xsl:attribute name="codeListValue">
<xsl:value-of select="normalize-space(string(@Type))"/>
</xsl:attribute>
<xsl:value-of select="normalize-space(string(@Type))"/>
</xsl:element>
</gmd:associationType>
</gmd:MD_AggregateInformation>
</gmd:aggregationInfo>
</xsl:if>
</xsl:template>
<xsl:template match="File" mode="iso19139">
<xsl:if test="string-length(normalize-space(string(@MimeType))) > 0">
<gmd:distributionFormat>
<gmd:MD_Format>
<gmd:name>
<gco:CharacterString>
<xsl:value-of select="normalize-space(string(@MimeType))"/>
</gco:CharacterString>
</gmd:name>
<gmd:version gco:nilReason="missing"/>
</gmd:MD_Format>
</gmd:distributionFormat>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View file

@ -0,0 +1,440 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/**
* This file is part of TETHYS.
*
* LICENCE
* TETHYS is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the Licence, or any later version.
* OPUS is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details. You should have received a copy of the GNU General Public License
* along with OPUS; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @category Application
* @package Module_Oai
* @author Arno Kaimbacher <arno.kaimbacher@geologie.ac.at>
* @copyright Copyright (c) 2018-2019, GBA TETHYS development team
* @license http://www.gnu.org/licenses/gpl.html General Public License
*/
-->
<!--
/**
* Transforms the xml representation of an TETHYS model dataset to datacite
* xml as required by the OAI-PMH protocol.
*/
-->
<xsl:stylesheet version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsl:output method="xml" encoding="utf-8" indent="yes" />
<xsl:template match="Rdr_Dataset" mode="oai_datacite">
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://datacite.org/schema/kernel-4" xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4.3/metadata.xsd">
<!-- <isReferenceQuality>true</isReferenceQuality>
<schemaVersion>4.3</schemaVersion>
<datacentreSymbol>RDR.GBA</datacentreSymbol> -->
<xsl:choose>
<xsl:when test="Identifier">
<xsl:apply-templates select="Identifier" mode="oai_datacite" />
</xsl:when>
<xsl:otherwise>
<identifier>
<xsl:text>oai:</xsl:text>
<xsl:value-of select="$repIdentifier" />
<xsl:text>:</xsl:text>
<xsl:value-of select="@PublishId" />
</identifier>
</xsl:otherwise>
</xsl:choose>
<!--<datacite:creator>-->
<creators>
<xsl:apply-templates select="PersonAuthor" mode="oai_datacite">
<xsl:sort select="@SortOrder"/>
</xsl:apply-templates>
</creators>
<titles>
<xsl:apply-templates select="TitleMain" mode="oai_datacite" />
<xsl:apply-templates select="TitleAdditional" mode="oai_datacite" />
</titles>
<publisher>
<!-- <xsl:value-of select="@PublisherName" /> -->
<xsl:value-of select="@CreatingCorporation" />
</publisher>
<publicationYear>
<xsl:value-of select="ServerDatePublished/@Year" />
</publicationYear>
<subjects>
<xsl:apply-templates select="Subject" mode="oai_datacite" />
</subjects>
<language>
<xsl:value-of select="@Language" />
</language>
<xsl:if test="PersonContributor">
<contributors>
<xsl:apply-templates select="PersonContributor" mode="oai_datacite">
<xsl:sort select="@SortOrder"/>
</xsl:apply-templates>
</contributors>
</xsl:if>
<dates>
<xsl:call-template name="RdrDate2" />
</dates>
<version>
<xsl:choose>
<xsl:when test="@Version">
<xsl:value-of select="@Version" />
</xsl:when>
<xsl:otherwise>
<xsl:text>1</xsl:text>
</xsl:otherwise>
</xsl:choose>
</version>
<resourceType resourceTypeGeneral="Dataset">
<xsl:text>Dataset</xsl:text>
<!-- <xsl:value-of select="@Type" /> -->
</resourceType>
<alternateIdentifiers>
<xsl:call-template name="AlternateIdentifier" />
</alternateIdentifiers>
<xsl:if test="Reference">
<relatedIdentifiers>
<xsl:apply-templates select="Reference" mode="oai_datacite" />
</relatedIdentifiers>
</xsl:if>
<rightsList>
<xsl:apply-templates select="Licence" mode="oai_datacite" />
</rightsList>
<sizes>
<size>
<xsl:value-of select="count(File)" />
<xsl:text> datasets</xsl:text>
</size>
</sizes>
<formats>
<xsl:apply-templates select="File/@MimeType" mode="oai_datacite" />
</formats>
<descriptions>
<xsl:apply-templates select="TitleAbstract" mode="oai_datacite" />
<xsl:apply-templates select="TitleAbstractAdditional" mode="oai_datacite" />
</descriptions>
<geoLocations>
<xsl:apply-templates select="Coverage" mode="oai_datacite" />
<!-- <geoLocation>
<geoLocationBox>
<westBoundLongitude>6.58987</westBoundLongitude>
<eastBoundLongitude>6.83639</eastBoundLongitude>
<southBoundLatitude>50.16</southBoundLatitude>
<northBoundLatitude>50.18691</northBoundLatitude>
</geoLocationBox>
</geoLocation> -->
</geoLocations>
</resource>
</xsl:template>
<xsl:template name="RdrDate2"
xmlns="http://datacite.org/schema/kernel-4">
<xsl:if test="EmbargoDate and ($unixTimestamp &lt; EmbargoDate/@UnixTimestamp)">
<date>
<xsl:attribute name="dateType">Available</xsl:attribute>
<xsl:variable name="embargoDate" select="concat(
EmbargoDate/@Year, '-',
format-number(number(EmbargoDate/@Month),'00'), '-',
format-number(number(EmbargoDate/@Day),'00')
)" />
<xsl:value-of select="$embargoDate" />
</date>
</xsl:if>
<xsl:if test="CreatedAt">
<date>
<xsl:attribute name="dateType">created</xsl:attribute>
<xsl:variable name="createdAt" select="concat(
CreatedAt/@Year, '-',
format-number(number(CreatedAt/@Month),'00'), '-',
format-number(number(CreatedAt/@Day),'00')
)" />
<xsl:value-of select="$createdAt" />
</date>
</xsl:if>
</xsl:template>
<xsl:template match="Coverage" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
<geoLocation>
<geoLocationBox>
<westBoundLongitude>
<xsl:value-of select="@XMin" />
</westBoundLongitude>
<eastBoundLongitude>
<xsl:value-of select="@XMax" />
</eastBoundLongitude>
<southBoundLatitude>
<xsl:value-of select="@YMin" />
</southBoundLatitude>
<northBoundLatitude>
<xsl:value-of select="@YMax" />
</northBoundLatitude>
</geoLocationBox>
</geoLocation>
</xsl:template>
<xsl:template match="TitleAbstract" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
<description>
<xsl:attribute name="xml:lang">
<xsl:value-of select="@Language" />
</xsl:attribute>
<xsl:if test="@Type != ''">
<xsl:attribute name="descriptionType">
<!-- <xsl:value-of select="@Type" /> -->
<xsl:text>Abstract</xsl:text>
</xsl:attribute>
</xsl:if>
<xsl:value-of select="@Value" />
</description>
</xsl:template>
<xsl:template match="TitleAbstractAdditional" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
<description>
<xsl:attribute name="xml:lang">
<xsl:value-of select="@Language" />
</xsl:attribute>
<xsl:if test="@Type != ''">
<xsl:attribute name="descriptionType">
<xsl:call-template name="CamelCaseWord">
<xsl:with-param name="text" select="@Type" />
</xsl:call-template>
</xsl:attribute>
</xsl:if>
<xsl:value-of select="@Value" />
</description>
</xsl:template>
<xsl:template name="CamelCaseWord">
<xsl:param name="text" />
<xsl:param name="firstLower" select="true()" />
<xsl:variable name="Upper">ABCDEFGHIJKLMNOPQRSTUVQXYZ</xsl:variable>
<xsl:variable name="Lower">abcdefghijklmnopqrstuvwxyz</xsl:variable>
<xsl:for-each select="tokenize($text,'_')">
<xsl:choose>
<xsl:when test="position()=1 and $firstLower = true()">
<xsl:value-of select="substring(.,1,1)" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="translate(substring(.,1,1),$Lower,$Upper)" />
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="substring(.,2,string-length(.))" />
</xsl:for-each>
</xsl:template>
<xsl:template match="Identifier" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
<identifier>
<xsl:attribute name="identifierType">
<xsl:text>DOI</xsl:text>
</xsl:attribute>
<xsl:value-of select="@Value" />
</identifier>
</xsl:template>
<xsl:template match="TitleMain" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
<title>
<xsl:if test="@Language != ''">
<xsl:attribute name="xml:lang">
<xsl:value-of select="@Language" />
</xsl:attribute>
</xsl:if>
<xsl:if test="@Type != '' and @Type != 'Main'">
<xsl:attribute name="titleType">
<xsl:value-of select="@Type" />
</xsl:attribute>
</xsl:if>
<xsl:value-of select="@Value" />
</title>
</xsl:template>
<xsl:template match="TitleAdditional" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
<title>
<xsl:if test="@Language != ''">
<xsl:attribute name="xml:lang">
<xsl:value-of select="@Language" />
</xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="@Type != '' and @Type != 'Sub' and @Type != 'Main'">
<xsl:attribute name="titleType">
<xsl:value-of select="@Type" />
<xsl:text>Title</xsl:text>
</xsl:attribute>
</xsl:when>
<xsl:when test="@Type = 'Sub'">
<xsl:attribute name="titleType">
<xsl:value-of select="@Type" />
<xsl:text>title</xsl:text>
</xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:value-of select="@Value" />
</title>
</xsl:template>
<xsl:template match="Subject" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
<subject>
<xsl:if test="@Language != ''">
<xsl:attribute name="xml:lang">
<xsl:value-of select="@Language" />
</xsl:attribute>
</xsl:if>
<xsl:value-of select="@Value" />
</subject>
</xsl:template>
<xsl:template name="AlternateIdentifier" match="AlternateIdentifier" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
<alternateIdentifier>
<xsl:attribute name="alternateIdentifierType">
<xsl:text>url</xsl:text>
</xsl:attribute>
<!-- <xsl:variable name="identifier" select="concat($repURL, '/dataset/', @Id)" /> -->
<xsl:value-of select="@landingpage" />
</alternateIdentifier>
</xsl:template>
<xsl:template match="Reference" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
<relatedIdentifier>
<xsl:attribute name="relatedIdentifierType">
<xsl:value-of select="@Type" />
</xsl:attribute>
<xsl:attribute name="relationType">
<xsl:value-of select="@Relation" />
</xsl:attribute>
<xsl:value-of select="@Value" />
</relatedIdentifier>
</xsl:template>
<xsl:template match="PersonContributor" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
<contributor>
<xsl:if test="@ContributorType != ''">
<xsl:attribute name="contributorType">
<xsl:value-of select="@ContributorType" />
</xsl:attribute>
</xsl:if>
<contributorName>
<!-- <xsl:if test="@NameType != ''">
<xsl:attribute name="nameType">
<xsl:value-of select="@NameType" />
</xsl:attribute>
</xsl:if> -->
<xsl:value-of select="concat(@FirstName, ' ',@LastName)" />
</contributorName>
</contributor>
</xsl:template>
<xsl:template match="PersonAuthor" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
<creator>
<creatorName>
<xsl:if test="@NameType != ''">
<xsl:attribute name="nameType">
<xsl:value-of select="@NameType" />
</xsl:attribute>
</xsl:if>
<xsl:value-of select="@LastName" />
<xsl:if test="@FirstName != ''">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:value-of select="@FirstName" />
<xsl:if test="@AcademicTitle != ''">
<xsl:text> (</xsl:text>
<xsl:value-of select="@AcademicTitle" />
<xsl:text>)</xsl:text>
</xsl:if>
</creatorName>
<xsl:if test="@NameType = 'Personal'">
<givenName>
<xsl:value-of select="@FirstName" />
</givenName>
<familyName>
<xsl:value-of select="@LastName" />
</familyName>
<affiliation>GBA</affiliation>
</xsl:if>
<xsl:if test="@IdentifierOrcid != ''">
<nameIdentifier schemeURI="http://orcid.org/" nameIdentifierScheme="ORCID">
<xsl:value-of select="@IdentifierOrcid" />
</nameIdentifier>
</xsl:if>
<!--
<nameType><xsl:value-of select="@NameType" /></nameType>
</xsl:if> -->
</creator>
</xsl:template>
<xsl:template match="File/@MimeType" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
<format>
<xsl:choose>
<xsl:when test=". = 'application/x-sqlite3'">
<xsl:text>application/geopackage+sqlite3</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="." />
</xsl:otherwise>
</xsl:choose>
</format>
</xsl:template>
<xsl:template match="Licence" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
<rights>
<xsl:attribute name="xml:lang">
<xsl:value-of select="@Language" />
</xsl:attribute>
<xsl:if test="@LinkLicence != ''">
<xsl:attribute name="rightsURI">
<xsl:value-of select="@LinkLicence" />
</xsl:attribute>
</xsl:if>
<xsl:attribute name="schemeURI">
<xsl:text>https://spdx.org/licenses/</xsl:text>
</xsl:attribute>
<xsl:attribute name="rightsIdentifierScheme">
<xsl:text>SPDX</xsl:text>
</xsl:attribute>
<xsl:attribute name="rightsIdentifier">
<xsl:value-of select="@Name" />
</xsl:attribute>
<xsl:value-of select="@NameLong" />
</rights>
<xsl:if test="@Name = 'CC-BY-4.0' or @Name = 'CC-BY-SA-4.0'">
<rights>
<xsl:attribute name="rightsURI">
<xsl:text>info:eu-repo/semantics/openAccess</xsl:text>
</xsl:attribute>
<xsl:text>Open Access</xsl:text>
</rights>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

145
public/assets2/style.css Normal file
View file

@ -0,0 +1,145 @@
html,
button,
input,
select,
textarea,
.pure-g [class*="pure-u"] {
font-family: "Open Sans", sans-serif;
}
td.value {
vertical-align: top;
padding-left: 1em;
padding: 3px;
}
td.key {
background-color: #3abac4;
padding: 3px;
text-align: right;
border: 1px solid #c0c0c0;
white-space: nowrap;
/* font-weight: bold; */
vertical-align: top;
}
.dcdata td.key {
background-color: #f4f8f4;
}
body {
margin: 1em 2em 1em 2em;
}
h1,
h2,
h3 {
font-family: sans-serif;
clear: left;
}
h1 {
padding-bottom: 4px;
margin-bottom: 0px;
}
h2 {
margin-bottom: 0.5em;
}
h3 {
margin-bottom: 0.3em;
font-size: medium;
}
.link {
border: 1px outset #88f;
background-color: #00beff;
padding: 1px 4px 1px 4px;
font-size: 80%;
text-decoration: none;
font-weight: bold;
font-family: sans-serif;
color: #6c6e6b;
}
.link:hover {
color: #d0d0d0;
}
.link:active {
color: #d0d0d0;
background-color: #00beff;
}
.oaiRecord,
.oaiRecordTitle {
background-color: #eee;
border-style: solid;
border-color: #d0d0d0;
}
h2.oaiRecordTitle {
background-color: #51565c;
color: #fff;
font-size: medium;
font-weight: bold;
padding: 10px;
border-width: 0px 0px 0px 0px;
margin: 0px;
}
.oaiRecord {
margin-bottom: 3em;
border-width: 2px;
padding: 10px;
}
.results {
margin-bottom: 1.5em;
}
ul.quicklinks {
margin-top: 2px;
padding: 4px;
text-align: left;
border-bottom: 2px solid #ccc;
border-top: 2px solid #ccc;
clear: left;
}
ul.quicklinks li {
font-size: 80%;
display: inline;
list-style: none;
font-family: sans-serif;
}
p.intro {
font-size: 80%;
}
.xmlSource {
font-size: 70%;
border: solid #c0c0a0 1px;
/* background-color: #ffffe0; */
background-color: #f4f8f4;
padding: 2em 2em 2em 0em;
}
.xmlBlock {
padding-left: 2em;
}
.xmlTagName {
color: #800000;
font-weight: bold;
}
.xmlAttrName {
font-weight: bold;
}
.xmlAttrValue {
color: #0000c0;
}