- small bug fixes for oai-iso19139 GetRecords request

This commit is contained in:
Arno Kaimbacher 2022-11-17 12:41:51 +01:00
parent 15f3572ef9
commit bb70c087ef
3 changed files with 37 additions and 34 deletions

View file

@ -36,8 +36,8 @@
<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="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>
@ -50,7 +50,7 @@
</xsl:choose>
</xsl:variable>
<!-- main template for is 19139 -->
<!-- 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">
@ -126,21 +126,24 @@
<gmd:identifier>
<gmd:MD_Identifier>
<gmd:code>
<gco:CharacterString>
<xsl:choose>
<xsl:when test="starts-with($datacite-identifier/@Value, 'doi:') or contains($datacite-identifier/@Value, 'doi.org')">
<xsl:value-of select="$datacite-identifier/@Value"/>
</xsl:when>
<xsl:when test="count($datacite-identifier[@Type = 'Doi']) &gt; 0 and $datacentre='Tethys RDR'">
<xsl:value-of select="concat(
'https://doi.org/',
string($datacite-identifier/@Value)
)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$datacite-identifier/@Value"/>
</xsl:otherwise>
</xsl:choose>
<gco:CharacterString>
<xsl:variable name="datacite-identifier" select="Identifier[@Type = 'Doi']"/>
<xsl:if test="string-length($datacite-identifier/@Value) &gt; 0 and count([$datacite-identifier/@Type = 'Doi']) &gt; 0">
<xsl:choose>
<xsl:when test="starts-with($datacite-identifier/@Value, 'doi:') or contains($datacite-identifier/@Value, 'doi.org')">
<xsl:value-of select="$datacite-identifier/@Value"/>
</xsl:when>
<xsl:when test="count($datacite-identifier[@Type = 'Doi']) &gt; 0 and $datacentre='Tethys RDR'">
<xsl:value-of select="concat(
'https://doi.org/',
string($datacite-identifier/@Value)
)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$datacite-identifier/@Value"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</gco:CharacterString>
</gmd:code>
</gmd:MD_Identifier>