Skip to content

Commit

Permalink
fix detection of ogcServiceType for datasets with multiple serviceTyp…
Browse files Browse the repository at this point in the history
…eVersions
  • Loading branch information
jvanzadelhoff committed Jun 5, 2023
1 parent c60a83f commit 441e8c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/resources/iso2dcat.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -731,15 +731,16 @@
<xsl:param name="lastModifiedInMainMetadata"/>
<xsl:variable name="lastModified" select="gmd:dateStamp/*"/>
<xsl:variable name="serviceType" select="string(gmd:identificationInfo/*/srv:serviceType/*)"/>
<xsl:variable name="serviceTypeVersion" select="string(gmd:identificationInfo/*/srv:serviceTypeVersion/*)"/>
<xsl:variable name="serviceTypeVersion" select="gmd:identificationInfo/*/srv:serviceTypeVersion/*"/>
<xsl:variable name="serviceTypeVersionContainsWCS" select="exists($serviceTypeVersion[contains(lower-case(string(.)), 'wcs')])"/>
<xsl:variable name="mdrUri" select="$mdrFileTypes/*/skos:Concept[*/text() = upper-case($serviceType)]/@rdf:about"/>
<xsl:variable name="capabilitiesLinkage" select="gmd:identificationInfo[1]/*/srv:containsOperations/*[lower-case(srv:operationName/*) = 'getcapabilities']/srv:connectPoint/*/gmd:linkage/*"/>
<xsl:variable name="accessUrl">
<xsl:if test="count($capabilitiesLinkage) &gt; 0">
<xsl:variable name="ogcServiceType">
<xsl:choose>
<xsl:when test="lower-case($serviceType) = 'view'">WMS</xsl:when>
<xsl:when test="lower-case($serviceType) = 'download' and contains(lower-case($serviceTypeVersion), 'wcs')">WCS</xsl:when>
<xsl:when test="lower-case($serviceType) = 'download' and $serviceTypeVersionContainsWCS">WCS</xsl:when>
<xsl:when test="lower-case($serviceType) = 'download'">WFS</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$serviceType"/>
Expand Down

0 comments on commit 441e8c8

Please sign in to comment.