- apply SortOrder for metadata standard dc, datacite and iso19139

This commit is contained in:
Arno Kaimbacher 2023-04-04 14:39:16 +02:00
parent 2a6a2a6def
commit 5b6f81c34d
4 changed files with 73 additions and 61 deletions

View File

@ -153,10 +153,14 @@
</gmd:identifier>
<!-- gmd:citedResponsibleParty - creator -->
<xsl:apply-templates select="PersonAuthor" mode="iso19139" />
<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:apply-templates select="PersonContributor" mode="iso19139">
<xsl:sort select="@SortOrder"/>
</xsl:apply-templates>
<!-- publisher -->
<gmd:citedResponsibleParty>

View File

@ -29,16 +29,16 @@
*/
-->
<xsl:stylesheet version="1.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">
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">
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> -->
@ -55,10 +55,12 @@
</identifier>
</xsl:otherwise>
</xsl:choose>
<!--<datacite:creator>-->
<creators>
<xsl:apply-templates select="PersonAuthor" mode="oai_datacite" />
<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" />
@ -79,7 +81,9 @@
</language>
<xsl:if test="PersonContributor">
<contributors>
<xsl:apply-templates select="PersonContributor" mode="oai_datacite" />
<xsl:apply-templates select="PersonContributor" mode="oai_datacite">
<xsl:sort select="@SortOrder"/>
</xsl:apply-templates>
</contributors>
</xsl:if>
<dates>
@ -89,11 +93,11 @@
<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" />
@ -125,12 +129,12 @@
<northBoundLatitude>50.18691</northBoundLatitude>
</geoLocationBox>
</geoLocation> -->
</geoLocations>
</geoLocations>
</resource>
</xsl:template>
<xsl:template name="RdrDate2"
xmlns="http://datacite.org/schema/kernel-4">
xmlns="http://datacite.org/schema/kernel-4">
<xsl:if test="EmbargoDate and ($unixTimestamp &lt; EmbargoDate/@UnixTimestamp)">
<date>
<xsl:attribute name="dateType">Available</xsl:attribute>
@ -154,9 +158,9 @@
</date>
</xsl:if>
</xsl:template>
<xsl:template match="Coverage" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
xmlns="http://datacite.org/schema/kernel-4">
<geoLocation>
<geoLocationBox>
<westBoundLongitude>
@ -174,9 +178,9 @@
</geoLocationBox>
</geoLocation>
</xsl:template>
<xsl:template match="TitleAbstract" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
xmlns="http://datacite.org/schema/kernel-4">
<description>
<xsl:attribute name="xml:lang">
<xsl:value-of select="@Language" />
@ -191,7 +195,7 @@
</description>
</xsl:template>
<xsl:template match="TitleAbstractAdditional" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
xmlns="http://datacite.org/schema/kernel-4">
<description>
<xsl:attribute name="xml:lang">
<xsl:value-of select="@Language" />
@ -206,8 +210,8 @@
<xsl:value-of select="@Value" />
</description>
</xsl:template>
<xsl:template name="CamelCaseWord">
<xsl:param name="text" />
<xsl:param name="firstLower" select="true()" />
@ -225,10 +229,10 @@
<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">
xmlns="http://datacite.org/schema/kernel-4">
<identifier>
<xsl:attribute name="identifierType">
<xsl:text>DOI</xsl:text>
@ -236,9 +240,9 @@
<xsl:value-of select="@Value" />
</identifier>
</xsl:template>
<xsl:template match="TitleMain" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
xmlns="http://datacite.org/schema/kernel-4">
<title>
<xsl:if test="@Language != ''">
<xsl:attribute name="xml:lang">
@ -254,7 +258,7 @@
</title>
</xsl:template>
<xsl:template match="TitleAdditional" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
xmlns="http://datacite.org/schema/kernel-4">
<title>
<xsl:if test="@Language != ''">
<xsl:attribute name="xml:lang">
@ -278,9 +282,9 @@
<xsl:value-of select="@Value" />
</title>
</xsl:template>
<xsl:template match="Subject" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
xmlns="http://datacite.org/schema/kernel-4">
<subject>
<xsl:if test="@Language != ''">
<xsl:attribute name="xml:lang">
@ -290,9 +294,9 @@
<xsl:value-of select="@Value" />
</subject>
</xsl:template>
<xsl:template name="AlternateIdentifier" match="AlternateIdentifier" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
xmlns="http://datacite.org/schema/kernel-4">
<alternateIdentifier>
<xsl:attribute name="alternateIdentifierType">
<xsl:text>url</xsl:text>
@ -301,9 +305,9 @@
<xsl:value-of select="@landingpage" />
</alternateIdentifier>
</xsl:template>
<xsl:template match="Reference" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
xmlns="http://datacite.org/schema/kernel-4">
<relatedIdentifier>
<xsl:attribute name="relatedIdentifierType">
<xsl:value-of select="@Type" />
@ -314,9 +318,9 @@
<xsl:value-of select="@Value" />
</relatedIdentifier>
</xsl:template>
<xsl:template match="PersonContributor" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
xmlns="http://datacite.org/schema/kernel-4">
<contributor>
<xsl:if test="@ContributorType != ''">
<xsl:attribute name="contributorType">
@ -333,9 +337,9 @@
</contributorName>
</contributor>
</xsl:template>
<xsl:template match="PersonAuthor" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
xmlns="http://datacite.org/schema/kernel-4">
<creator>
<creatorName>
<xsl:if test="@NameType != ''">
@ -354,7 +358,7 @@
<xsl:text>)</xsl:text>
</xsl:if>
</creatorName>
<xsl:if test="@NameType = 'Personal'">
<givenName>
<xsl:value-of select="@FirstName" />
@ -364,7 +368,7 @@
</familyName>
<affiliation>GBA</affiliation>
</xsl:if>
<xsl:if test="@IdentifierOrcid != ''">
<nameIdentifier schemeURI="http://orcid.org/" nameIdentifierScheme="ORCID">
<xsl:value-of select="@IdentifierOrcid" />
@ -373,12 +377,12 @@
<!--
<nameType><xsl:value-of select="@NameType" /></nameType>
</xsl:if> -->
</creator>
</creator>
</xsl:template>
<xsl:template match="File/@MimeType" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
xmlns="http://datacite.org/schema/kernel-4">
<format>
<xsl:choose>
<xsl:when test=". = 'application/x-sqlite3'">
@ -390,9 +394,9 @@
</xsl:choose>
</format>
</xsl:template>
<xsl:template match="Licence" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
xmlns="http://datacite.org/schema/kernel-4">
<rights>
<xsl:attribute name="xml:lang">
<xsl:value-of select="@Language" />
@ -422,5 +426,5 @@
</rights>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View File

@ -418,7 +418,9 @@
<!-- 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:apply-templates select="PersonAuthor" mode="oai_dc">
<xsl:sort select="@SortOrder"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="@CreatingCorporation">
<dc:creator>
@ -440,7 +442,9 @@
</dc:publisher>
<!-- dc:contributor -->
<xsl:apply-templates select="PersonContributor" mode="oai_dc" />
<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 -->
@ -461,9 +465,9 @@
<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>
<xsl:with-param name="str" select="@landingpage"/>
</xsl:call-template> -->
</dc:identifier>
<!-- dc:language -->
<xsl:apply-templates select="@Language" mode="oai_dc" />
<!-- dc:relation -->
@ -614,9 +618,9 @@
<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:with-param name="str" select="@Value"/>
</xsl:call-template> -->
</dc:relation>
</xsl:template>
@ -723,9 +727,9 @@
<!-- <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:with-param name="str" select="concat($doiPrefix, @Value)"/>
</xsl:call-template> -->
</dc:relation>
</xsl:template>
<xsl:template match="@CreatingCorporation" mode="oai_dc">

File diff suppressed because one or more lines are too long