Skip to content

Commit

Permalink
Standards / ISO / Formatters / DCAT / Period of time using beginPosit…
Browse files Browse the repository at this point in the history
…ion.
  • Loading branch information
fxprunayre committed Apr 29, 2024
1 parent 1d42c08 commit 2d1e5d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@
match="mri:extent/*/gex:temporalElement/*/gex:extent">
<dct:temporal>
<dct:PeriodOfTime>
<xsl:for-each select="*/gml:begin/*[gml:timePosition/text() != '']">
<xsl:for-each select="*/gml:begin/*[gml:timePosition/text() != '']|*/gml:beginPosition[. != '']">
<xsl:call-template name="rdf-date">
<xsl:with-param name="nodeName" select="'dcat:startDate'"/>
</xsl:call-template>
</xsl:for-each>
<xsl:for-each select="*/gml:end/*[gml:timePosition/text() != '']">
<xsl:for-each select="*/gml:end/*[gml:timePosition/text() != '']|*/gml:endPosition[. != '']">
<xsl:call-template name="rdf-date">
<xsl:with-param name="nodeName" select="'dcat:endDate'"/>
</xsl:call-template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,14 @@
<xsl:param name="nodeName"
as="xs:string"/>

<xsl:variable name="date"
as="xs:string?"
select="if (*/text()) then */text() else text()"/>

<xsl:element name="{$nodeName}">
<xsl:attribute name="rdf:datatype"
select="concat('http://www.w3.org/2001/XMLSchema#date', (if (contains(*/text(), 'T')) then 'Time' else ''))"/>
<xsl:value-of select="*/text()"/>
select="concat('http://www.w3.org/2001/XMLSchema#date', (if (contains($date, 'T')) then 'Time' else ''))"/>
<xsl:value-of select="$date"/>
</xsl:element>
</xsl:template>

Expand Down

0 comments on commit 2d1e5d8

Please sign in to comment.