- 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

@ -493,7 +493,7 @@
</gmd:descriptiveKeywords> </gmd:descriptiveKeywords>
</xsl:template> </xsl:template>
<!-- <gmd:extent> --> <!-- <gmd:extent> -->
<xsl:template name="spatialcoverage"> <xsl:template name="spatialcoverage">
<gmd:extent> <gmd:extent>
<gmd:EX_Extent> <gmd:EX_Extent>
@ -695,26 +695,26 @@
</gmd:extent> </gmd:extent>
</xsl:template> </xsl:template>
<!-- <gmd:onLine> --> <!-- <gmd:onLine> -->
<xsl:template name="datacite_identifier"> <xsl:template name="datacite_identifier">
<xsl:if test=" <xsl:if test="
starts-with($datacite-identifier/@Value, 'doi:') or starts-with(Identifier/@Value, 'doi:') or
$datacite-identifier/@Type = 'Doi' or Identifier/@Type = 'Doi' or
starts-with($datacite-identifier/@Value, 'http://')"> starts-with(Identifier/@Value, 'http://')">
<gmd:onLine> <gmd:onLine>
<gmd:CI_OnlineResource> <gmd:CI_OnlineResource>
<gmd:linkage> <gmd:linkage>
<gmd:URL> <gmd:URL>
<xsl:choose> <xsl:choose>
<xsl:when test="starts-with($datacite-identifier/@Value, 'doi:')"> <xsl:when test="starts-with(Identifier/@Value, 'doi:')">
<!-- stower http auf https gesetzt --> <!-- stower http auf https gesetzt -->
<xsl:value-of select="concat('http://dx.doi.org/', substring-after($datacite-identifier/@Value, 'doi:'))"/> <xsl:value-of select="concat('http://dx.doi.org/', substring-after(Identifier/@Value, 'doi:'))"/>
</xsl:when> </xsl:when>
<xsl:when test="$datacite-identifier/@Type = 'Doi'"> <xsl:when test="Identifier/@Type = 'Doi'">
<xsl:value-of select="concat('http://dx.doi.org/', normalize-space($datacite-identifier/@Value))"/> <xsl:value-of select="concat('http://dx.doi.org/', normalize-space(Identifier/@Value))"/>
</xsl:when> </xsl:when>
<xsl:when test="starts-with($datacite-identifier/@Value, 'http://')"> <xsl:when test="starts-with(Identifier/@Value, 'http://')">
<xsl:value-of select="normalize-space($datacite-identifier/@Value)"/> <xsl:value-of select="normalize-space(Identifier/@Value)"/>
</xsl:when> </xsl:when>
</xsl:choose> </xsl:choose>
</gmd:URL> </gmd:URL>
@ -739,7 +739,7 @@
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
<!-- <gmd:onLine> --> <!-- <gmd:onLine> -->
<xsl:template name="alternate_identifier"> <xsl:template name="alternate_identifier">
<xsl:if test="@landingpage != '' and starts-with(normalize-space(string(@landingpage)), 'http')"> <xsl:if test="@landingpage != '' and starts-with(normalize-space(string(@landingpage)), 'http')">
<gmd:onLine> <gmd:onLine>
@ -754,7 +754,7 @@
</gmd:protocol> </gmd:protocol>
<gmd:name> <gmd:name>
<gco:CharacterString> <gco:CharacterString>
<xsl:value-of select="normalize-space(string('url'))"/> <xsl:value-of select="string('url')"/>
</gco:CharacterString> </gco:CharacterString>
</gmd:name> </gmd:name>
<gmd:description> <gmd:description>
@ -768,7 +768,7 @@
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
<!-- <gmd:dataQualityInfo> --> <!-- <gmd:dataQualityInfo> -->
<xsl:template name="data_quality"> <xsl:template name="data_quality">
<gmd:dataQualityInfo> <gmd:dataQualityInfo>
<gmd:DQ_DataQuality> <gmd:DQ_DataQuality>
@ -822,7 +822,7 @@
</gmd:dataQualityInfo> </gmd:dataQualityInfo>
</xsl:template> </xsl:template>
<!-- <gmd:distributor> --> <!-- <gmd:distributor> -->
<xsl:variable name="distributorOrganisation" select="string('Geological Survey of Austria')"/> <xsl:variable name="distributorOrganisation" select="string('Geological Survey of Austria')"/>
<xsl:variable name="distributorContactEmail" select="string('repository@geologie.ac.at')"/> <xsl:variable name="distributorContactEmail" select="string('repository@geologie.ac.at')"/>
<xsl:template name="distributor"> <xsl:template name="distributor">

View File

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

File diff suppressed because one or more lines are too long