forked from geonetwork/core-geonetwork
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Standard / ISO / DCAT formatters / Better support multilingual records.
- Loading branch information
1 parent
304bba9
commit 56c7154
Showing
7 changed files
with
64 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
schemas/iso19139/src/main/plugin/iso19139/formatter/dcat/dcat-utils.xsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
xmlns:gmd="http://www.isotc211.org/2005/gmd" | ||
xmlns:util="java:org.fao.geonet.util.XslUtil" | ||
xmlns:xs="http://www.w3.org/2001/XMLSchema" | ||
version="2.0" | ||
exclude-result-prefixes="#all"> | ||
|
||
<xsl:template mode="get-language" | ||
match="gmd:MD_Metadata" | ||
as="node()*"> | ||
<xsl:variable name="defaultLanguage" | ||
select="$metadata/gmd:language"/> | ||
<xsl:for-each select="$defaultLanguage"> | ||
<xsl:variable name="iso3code" | ||
as="xs:string?" | ||
select="*/@codeListValue"/> | ||
|
||
<language id="{../gmd:locale/*[gmd:languageCode/*/@codeListValue = $iso3code]/@id}" | ||
iso3code="{$iso3code}" | ||
iso2code="{util:twoCharLangCode($iso3code)}" | ||
default=""/> | ||
</xsl:for-each> | ||
|
||
<xsl:for-each select="$metadata/gmd:locale/*[not(@id = $defaultLanguage/@id)]"> | ||
<language id="{@id}" | ||
iso3code="{gmd:languageCode/*/@codeListValue}" | ||
iso2code="{util:twoCharLangCode(gmd:languageCode/*/@codeListValue)}"/> | ||
</xsl:for-each> | ||
</xsl:template> | ||
</xsl:stylesheet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters