Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Cleanup mods #157

Merged
merged 2 commits into from
Aug 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
52 changes: 40 additions & 12 deletions kepler/templates/fgdc_to_mods.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -21,43 +21,71 @@

<xsl:template match="origin">
<mods:name>
<mods:displayForm><xsl:value-of select="." /></mods:displayForm>
<mods:role>
<mods:roleTerm type="text">creator</mods:roleTerm>
</mods:role>
<mods:displayForm>
<xsl:value-of select="." />
</mods:displayForm>
</mods:name>
</xsl:template>

<xsl:template match="pubdate">
<xsl:template match="citeinfo[pubdate or pubinfo/publish]">
<mods:originInfo>
<mods:dateCreated point="start">
<xsl:value-of select="." />
</mods:dateCreated>
<xsl:if test="pubdate">
<mods:dateCreated point="start">
<xsl:value-of select="pubdate" />
</mods:dateCreated>
</xsl:if>
<xsl:if test="pubinfo/publish">
<mods:publisher>
<xsl:value-of select="pubinfo/publish" />
</mods:publisher>
</xsl:if>
</mods:originInfo>
<xsl:apply-templates />
</xsl:template>

<xsl:template match="abstract">
<mods:abstract><xsl:value-of select="." /></mods:abstract>
</xsl:template>

<xsl:template match="accconst">
<mods:accessCondition type="restrictionOnAccess">
<mods:accessCondition type="use and reproduction">
<xsl:value-of
select="concat(
translate(normalize-space(.), '.', ''), '. ',
normalize-space(//distinfo/distliab))" />
</mods:accessCondition>
</xsl:template>

<xsl:template match="themekey">
<mods:subject>
<mods:topic><xsl:value-of select="." /></mods:topic>
</mods:subject>
</xsl:template>

<xsl:template match="placekey">
<mods:subject>
<mods:geographic><xsl:value-of select="." /></mods:geographic>
</mods:subject>
</xsl:template>

<xsl:template match="bounding">
<mods:subject>
<mods:cartographic>
<mods:cartographics>
<mods:coordinates>
<xsl:value-of select="concat(
eastbc, ',', southbc, ' ',
eastbc, ',', northbc, ' ',
westbc, ',', northbc, ' ',
westbc, ',', southbc
'POLYGON ((',
westbc, ' ', southbc, ', ',
eastbc, ' ', southbc, ', ',
eastbc, ' ', northbc, ', ',
westbc, ' ', northbc, ', ',
westbc, ' ', southbc,
'))'
)" />
</mods:coordinates>
</mods:cartographic>
</mods:cartographics>
</mods:subject>
</xsl:template>

Expand Down
Binary file modified tests/fixtures/bags/674a0ab1-325f-561a-a837-09e9a9a79b91.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<origin>Ginnungagap, the Yawning Emptiness of Abyssal Chaos</origin>
<title>Some land</title>
<pubdate>20031001</pubdate>
<pubinfo>
<publish>A publisher</publish>
</pubinfo>
</citeinfo>
</citation>
<descript>
Expand All @@ -20,6 +23,15 @@
<southbc>70</southbc>
</bounding>
</spdom>
<keywords>
<theme>
<themekey>Land</themekey>
<themekey>Geo</themekey>
</theme>
<place>
<placekey>Earth</placekey>
</place>
</keywords>
</idinfo>
<spdoinfo>
<direct>Raster</direct>
Expand Down