Skip to content

Commit

Permalink
Metawal / Record view / Custom citation.
Browse files Browse the repository at this point in the history
  • Loading branch information
fxprunayre committed Feb 14, 2024
1 parent 17facba commit d4ef7e1
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
('publication', 'revision')]/
cit:date/gco:*[. != '']"/>

<xsl:variable name="publicationDates">
<xsl:variable name="publicationDates" as="node()*">
<xsl:perform-sort select="$dates">
<xsl:sort select="." order="descending"/>
</xsl:perform-sort>
Expand All @@ -108,6 +108,11 @@
select="gn-fn-iso19115-3.2018:get-author-list($publishers, $langId)"/>

<!-- Electronic Retrieval Location -->
<xsl:variable name="mwResourceIdentifier"
select="(//mdb:identificationInfo/*/mri:citation/*/
cit:identifier/*[contains(mcc:codeSpace/*/text(), '://geodata.wallonie.be')]
/concat(mcc:codeSpace/*/text(), mcc:code/*/text()))[1]"/>

<xsl:variable name="doiInResourceIdentifier"
select="(//mdb:identificationInfo/*/mri:citation/*/
cit:identifier/*/mcc:code[
Expand All @@ -121,7 +126,9 @@
$doiProtocolRegex)]/cit:linkage/gco:CharacterString[. != '']"/>

<xsl:variable name="doiUrl"
select="if ($doiInResourceIdentifier != '')
select="if ($mwResourceIdentifier != '')
then $mwResourceIdentifier
else if ($doiInResourceIdentifier != '')
then $doiInResourceIdentifier
else if ($doiInOnline != '')
then $doiInOnline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<!-- Who is the creator of the data set? This can be an individual, a group of individuals, or an organization. -->
<xsl:param name="authorRoles"
select="'custodian,author'"/>
select="'owner'"/>
<xsl:variable name="authorRolesList"
select="tokenize($authorRoles, ',')"/>

Expand Down Expand Up @@ -48,21 +48,22 @@
select="count(authorsNameAndOrgList/*) > 0"/>
<xsl:variable name="hasPublisher"
select="count(publishersNameAndOrgList/*) > 0"/>

<textResponse><xsl:value-of select="normalize-space(concat(
(if ($hasAuthor)
then string-join(authorsNameAndOrgList/*, ', ')
else ''),
(if ($hasAuthor)
then ' '
then ' - '
else ''),
(if (lastPublicationDate != '')
then concat('(', substring(lastPublicationDate, 1, 4), '). ')
else if ($hasAuthor) then '. ' else ''),
normalize-space(translatedTitle),
'. ',
(if (lastPublicationDate != '')
then concat(' (version ', lastPublicationDate, ') - ')
else if ($hasAuthor) then ' - ' else ''),
(:'. ',
(if ($hasPublisher)
then concat(string-join(publishersNameAndOrgList/*, ', '), '. ')
else ''),
else ''),:)
if (doiUrl != '') then doiUrl else landingPageUrl))"/>
</textResponse>
</xsl:template>
Expand Down Expand Up @@ -119,20 +120,26 @@
</div>
<div class="col-md-9">
<p>
<!--
Metawal citation format:
[organisation propriétaire de la donnée (sans l'acronyme - role=owner - ', ' si n)] - [nom de la donnée] (version [date de révision ou à défaut date de création]) - [identifiant de la ressource au format https://geodata.wallonie.be/id/mduuid]-->

<xsl:call-template name="citation-contact">
<xsl:with-param name="contact" select="authorsNameAndOrgList"/>
</xsl:call-template>

<xsl:value-of select="if (lastPublicationDate != '')
then concat('(', substring(lastPublicationDate, 1, 4), ').')
else if ($hasAuthor) then '.'
<xsl:value-of select="if ($hasAuthor) then ' - '
else ''"/>

<span><xsl:copy-of select="translatedTitle/(text()|*)"/>.</span>
<span><xsl:copy-of select="translatedTitle/(text()|*)"/></span>

<xsl:call-template name="citation-contact">
<xsl:value-of select="if (lastPublicationDate != '')
then concat('(', lastPublicationDate, ')')
else ''"/>

<!--<xsl:call-template name="citation-contact">
<xsl:with-param name="contact" select="publishersNameAndOrgList"/>
</xsl:call-template>
</xsl:call-template>-->
<br></br>

<xsl:variable name="url"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
('publication', 'revision')]/
gmd:date/gco:*[. != '']"/>

<xsl:variable name="publicationDates">
<xsl:variable name="publicationDates" as="node()*">
<xsl:perform-sort select="$dates">
<xsl:sort select="." order="descending"/>
</xsl:perform-sort>
Expand Down

0 comments on commit d4ef7e1

Please sign in to comment.