From: <fxp...@us...> - 2008-04-08 11:25:08
|
Revision: 1270 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=1270&view=rev Author: fxprunayre Date: 2008-04-08 04:25:10 -0700 (Tue, 08 Apr 2008) Log Message: ----------- Added XSL to convert SLD document to ISO19139 Added Paths: ----------- trunk/web/geonetwork/xsl/conversion/OGCSLDtoISO19139/ trunk/web/geonetwork/xsl/conversion/OGCSLDtoISO19139/OGCSLD-to-ISO19139.xsl trunk/web/geonetwork/xsl/conversion/OGCSLDtoISO19139/identification.xsl Added: trunk/web/geonetwork/xsl/conversion/OGCSLDtoISO19139/OGCSLD-to-ISO19139.xsl =================================================================== --- trunk/web/geonetwork/xsl/conversion/OGCSLDtoISO19139/OGCSLD-to-ISO19139.xsl (rev 0) +++ trunk/web/geonetwork/xsl/conversion/OGCSLDtoISO19139/OGCSLD-to-ISO19139.xsl 2008-04-08 11:25:10 UTC (rev 1270) @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="2.0" + xmlns="http://www.isotc211.org/2005/gmd" + xmlns:geonet="http://www.fao.org/geonetwork" + xmlns:sld="http://www.opengis.net/sld" + xmlns:gts="http://www.isotc211.org/2005/gts" + xmlns:gco="http://www.isotc211.org/2005/gco" + xmlns:gml="http://www.opengis.net/gml" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:date="http://exslt.org/dates-and-times" + extension-element-prefixes="date"> + + + <!-- ============================================================================= --> + + <xsl:param name="lang">eng</xsl:param> + <xsl:param name="topic"></xsl:param> + + <xsl:include href="identification.xsl"/> + + <!-- ============================================================================= --> + + <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" /> + + <!-- ============================================================================= --> + + <xsl:template match="/"> + <xsl:apply-templates/> + </xsl:template> + + <!-- ============================================================================= --> + + <xsl:template match="sld:StyledLayerDescriptor"> + <MD_Metadata> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <!-- <fileIdentifier> + <gco:CharacterString><xsl:value-of select="/wmc:ViewContext/@id"/></gco:CharacterString> + </fileIdentifier> + --> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <language> + <gco:CharacterString><xsl:value-of select="$lang"/></gco:CharacterString> + <!-- English is default. Not available in Web Map Context. Selected by user from GUI --> + </language> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <characterSet> + <MD_CharacterSetCode codeList="./resources/codeList.xml#MD_CharacterSetCode" codeListValue="utf8" /> + </characterSet> + + <!-- parentIdentifier : Web Map Context has no parent --> + <!-- mdHrLv --> + <!-- mdHrLvName --> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + <xsl:variable name="df">yyyy-MM-dd'T'HH:mm:ss</xsl:variable> + <dateStamp> + <gco:DateTime><xsl:value-of select="date:format-date(date:date-time(),$df)"/></gco:DateTime> + </dateStamp> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <metadataStandardName> + <gco:CharacterString>ISO 19115:2003/19139</gco:CharacterString> + </metadataStandardName> + + <metadataStandardVersion> + <gco:CharacterString>1.0</gco:CharacterString> + </metadataStandardVersion> + + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <identificationInfo> + <MD_DataIdentification> + <xsl:apply-templates select="." mode="DataIdentification"> + <xsl:with-param name="topic"><xsl:value-of select="$topic"/></xsl:with-param> + </xsl:apply-templates> + </MD_DataIdentification> + </identificationInfo> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <distributionInfo> + <MD_Distribution> + <transferOptions> + <MD_DigitalTransferOptions> + <onLine> + <CI_OnlineResource> + <linkage><URL/></linkage> + <protocol> + <!-- FIXME : use standardized label for WMS protocol --> + <gco:CharacterString>OGC-SLD</gco:CharacterString> + </protocol> + <name> + <gco:CharacterString><xsl:value-of select="sld:NamedLayer/sld:Name"/></gco:CharacterString> + </name> + <description> + <gco:CharacterString><xsl:value-of select="sld:NamedLayer/sld:Name"/></gco:CharacterString> + </description> + </CI_OnlineResource> + </onLine> + </MD_DigitalTransferOptions> + </transferOptions> + </MD_Distribution> + </distributionInfo> + </MD_Metadata> + </xsl:template> + +</xsl:stylesheet> Property changes on: trunk/web/geonetwork/xsl/conversion/OGCSLDtoISO19139/OGCSLD-to-ISO19139.xsl ___________________________________________________________________ Name: svn:mime-type + text/plain Added: trunk/web/geonetwork/xsl/conversion/OGCSLDtoISO19139/identification.xsl =================================================================== --- trunk/web/geonetwork/xsl/conversion/OGCSLDtoISO19139/identification.xsl (rev 0) +++ trunk/web/geonetwork/xsl/conversion/OGCSLDtoISO19139/identification.xsl 2008-04-08 11:25:10 UTC (rev 1270) @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<xsl:stylesheet version="2.0" xmlns ="http://www.isotc211.org/2005/gmd" + xmlns:sld="http://www.opengis.net/sld" + xmlns:gco="http://www.isotc211.org/2005/gco" + xmlns:gts="http://www.isotc211.org/2005/gts" + xmlns:ogc="http://www.opengis.net/ogc" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:math="http://exslt.org/math" + xmlns:xalan="http://xml.apache.org/xalan" + extension-element-prefixes="math ogc"> + + <!-- ============================================================================= --> + + <xsl:key name="prop" match="//ogc:PropertyName" use="."/> + + <!-- ============================================================================= --> + + <xsl:template match="*" mode="DataIdentification"> + + <citation> + <CI_Citation> + <title> + <gco:CharacterString><xsl:value-of select="sld:NamedLayer/sld:UserStyle/sld:Title"/></gco:CharacterString> + </title> + </CI_Citation> + </citation> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <abstract> + <gco:CharacterString><xsl:value-of select="sld:NamedLayer/sld:UserStyle/sld:Abstract"/></gco:CharacterString> + </abstract> + + <!--idPurp--> + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <status> + <MD_ProgressCode codeList="./resources/codeList.xml#MD_ProgressCode" codeListValue="completed" /> + </status> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <descriptiveKeywords> + <MD_Keywords> + <xsl:for-each select="//ogc:PropertyName"> + <xsl:sort select="."/> + + <xsl:variable name="thisNode" select="generate-id(.)"/> + <xsl:variable name="nodesAtSameLocation" select="key('prop', .)"/> + <xsl:variable name="firstNodeAtSameLocation" select="generate-id($nodesAtSameLocation[1])"/> + + <xsl:if test="$thisNode = $firstNodeAtSameLocation"> + <keyword> + <gco:CharacterString><xsl:value-of select="."/></gco:CharacterString> + </keyword> + </xsl:if> + </xsl:for-each> + <type> + <MD_KeywordTypeCode codeList="./resources/codeList.xml#MD_KeywordTypeCode" codeListValue="theme" /> + </type> + </MD_Keywords> + </descriptiveKeywords> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <topicCategory> + <MD_TopicCategoryCode><xsl:value-of select="$topic"/></MD_TopicCategoryCode> + </topicCategory> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + </xsl:template> + +</xsl:stylesheet> Property changes on: trunk/web/geonetwork/xsl/conversion/OGCSLDtoISO19139/identification.xsl ___________________________________________________________________ Name: svn:mime-type + text/plain This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |