📄 metadata-iso19139.xsl.svn-base
字号:
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0" xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" xmlns:gmd ="http://www.isotc211.org/2005/gmd" xmlns:gco ="http://www.isotc211.org/2005/gco" xmlns:geonet="http://www.fao.org/geonetwork" xmlns:xalan = "http://xml.apache.org/xalan"> <!-- default: in simple mode just a flat list --> <xsl:template mode="iso19139" match="*|@*"> <xsl:param name="schema"/> <xsl:param name="edit"/> <!-- do not show empty elements in view mode --> <xsl:choose> <xsl:when test="$edit=true()"> <xsl:apply-templates mode="element" select="."> <xsl:with-param name="schema" select="$schema"/> <xsl:with-param name="edit" select="true()"/> <xsl:with-param name="flat" select="$currTab='simple'"/> </xsl:apply-templates> </xsl:when> <xsl:otherwise> <xsl:variable name="empty"> <xsl:apply-templates mode="iso19139IsEmpty" select="."/> </xsl:variable> <xsl:if test="$empty!=''"> <xsl:apply-templates mode="element" select="."> <xsl:with-param name="schema" select="$schema"/> <xsl:with-param name="edit" select="false()"/> <xsl:with-param name="flat" select="$currTab='simple'"/> </xsl:apply-templates> </xsl:if> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- these elements should be boxed --> <xsl:template mode="iso19139" match="gmd:contact|gmd:identificationInfo|gmd:distributionInfo|gmd:graphicOverview|gmd:descriptiveKeywords|gmd:spatialRepresentationInfo|gmd:pointOfContact|gmd:dataQualityInfo|gmd:referenceSystemInfo|gmd:equivalentScale|gmd:projection|gmd:ellipsoid|gmd:extent|gmd:geographicBox|gmd:MD_Distributor"> <xsl:param name="schema"/> <xsl:param name="edit"/> <xsl:apply-templates mode="complexElement" select="."> <xsl:with-param name="schema" select="$schema"/> <xsl:with-param name="edit" select="$edit"/> </xsl:apply-templates> </xsl:template> <!-- some gco: elements --> <xsl:template mode="iso19139" match="gmd:*[gco:CharacterString|gco:DateTime|gco:Integer|gco:Decimal]"> <xsl:param name="schema"/> <xsl:param name="edit"/> <xsl:call-template name="iso19139String"> <xsl:with-param name="schema" select="$schema"/> <xsl:with-param name="edit" select="$edit"/> </xsl:call-template> </xsl:template> <xsl:template name="iso19139String"> <xsl:param name="schema"/> <xsl:param name="edit"/> <xsl:variable name="title"> <xsl:call-template name="getTitle"> <xsl:with-param name="name" select="name(.)"/> <xsl:with-param name="schema" select="$schema"/> </xsl:call-template> </xsl:variable> <xsl:apply-templates mode="simpleElement" select="*"> <xsl:with-param name="schema" select="$schema"/> <xsl:with-param name="edit" select="$edit"/> <xsl:with-param name="title" select="$title"/> </xsl:apply-templates> </xsl:template> <!-- codelists --> <xsl:template mode="iso19139" match="gmd:*[*/@codeList]"> <xsl:param name="schema"/> <xsl:param name="edit"/> <xsl:call-template name="iso19139Codelist"> <xsl:with-param name="schema" select="$schema"/> <xsl:with-param name="edit" select="$edit"/> </xsl:call-template> </xsl:template> <xsl:template name="iso19139Codelist"> <xsl:param name="schema"/> <xsl:param name="edit"/> <xsl:apply-templates mode="simpleElement" select="."> <xsl:with-param name="schema" select="$schema"/> <xsl:with-param name="edit" select="$edit"/> <xsl:with-param name="text"> <xsl:apply-templates mode="iso19139GetAttributeText" select="*/@codeListValue"> <xsl:with-param name="schema" select="$schema"/> <xsl:with-param name="edit" select="$edit"/> </xsl:apply-templates> </xsl:with-param> </xsl:apply-templates> </xsl:template> <xsl:template mode="iso19139GetAttributeText" match="@*"> <xsl:param name="schema"/> <xsl:param name="edit"/> <xsl:call-template name="getAttributeText"> <xsl:with-param name="schema" select="$schema"/> <xsl:with-param name="edit" select="$edit"/> </xsl:call-template> </xsl:template> <!-- make the following fields always not editable: dateStamp metadataStandardName metadataStandardVersion fileIdentifier characterSet --> <xsl:template mode="iso19139" match="gmd:dateStamp|gmd:metadataStandardName|gmd:metadataStandardVersion|gmd:fileIdentifier" priority="2"> <xsl:param name="schema"/> <xsl:param name="edit"/> <xsl:apply-templates mode="simpleElement" select="."> <xsl:with-param name="schema" select="$schema"/> <xsl:with-param name="edit" select="false()"/> </xsl:apply-templates> </xsl:template> <xsl:template mode="iso19139" match="gmd:characterSet" priority="2"> <xsl:param name="schema"/> <xsl:param name="edit"/> <xsl:call-template name="iso19139Codelist"> <xsl:with-param name="schema" select="$schema"/> <xsl:with-param name="edit" select="false()"/> </xsl:call-template> </xsl:template> <!-- electronicMailAddress --> <xsl:template mode="iso19139" match="gmd:electronicMailAddress" priority="2"> <xsl:param name="schema"/> <xsl:param name="edit"/> <xsl:choose> <xsl:when test="$edit=true()"> <xsl:call-template name="iso19139String"> <xsl:with-param name="schema" select="$schema"/> <xsl:with-param name="edit" select="true()"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:apply-templates mode="simpleElement" select="."> <xsl:with-param name="schema" select="$schema"/> <xsl:with-param name="text"> <a href="mailto:{string(.)}"><xsl:value-of select="string(.)"/></a> </xsl:with-param> </xsl:apply-templates> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- descriptiveKeywords --> <xsl:template mode="iso19139" match="gmd:descriptiveKeywords"> <xsl:param name="schema"/> <xsl:param name="edit"/> <xsl:choose> <xsl:when test="$edit=true()"> <xsl:apply-templates mode="element" select="."> <xsl:with-param name="schema" select="$schema"/> <xsl:with-param name="edit" select="true()"/> </xsl:apply-templates> </xsl:when> <xsl:otherwise> <xsl:apply-templates mode="simpleElement" select="."> <xsl:with-param name="schema" select="$schema"/> <xsl:with-param name="text"> <xsl:for-each select="gmd:MD_Keywords/gmd:keyword"> <xsl:if test="position() > 1">, </xsl:if> <xsl:value-of select="."/> </xsl:for-each> <xsl:if test="gmd:MD_Keywords/gmd:type/gmd:MD_KeywordTypeCode/@codeListValue!=''"> <xsl:text> (</xsl:text> <xsl:value-of select="gmd:MD_Keywords/gmd:type/gmd:MD_KeywordTypeCode/@codeListValue"/> <xsl:text>)</xsl:text> </xsl:if> <xsl:text>.</xsl:text> </xsl:with-param> </xsl:apply-templates> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- place keyword; only called in edit mode (see descriptiveKeywords template) --> <xsl:template mode="iso19139" match="gmd:keyword[following-sibling::gmd:type/gmd:MD_KeywordTypeCode/@codeListValue='place']"> <xsl:param name="schema"/> <xsl:param name="edit"/> <xsl:variable name="text"> <xsl:variable name="ref" select="gco:CharacterString/geonet:element/@ref"/> <xsl:variable name="keyword" select="gco:CharacterString/text()"/> <input class="md" type="text" name="_{$ref}" value="{gco:CharacterString/text()}" size="50" /> <!-- regions combobox --> <xsl:variable name="lang" select="/root/gui/language"/> <select name="place" size="1" onChange="document.mainForm._{$ref}.value=this.options[this.selectedIndex].text"> <option value=""/> <xsl:for-each select="/root/gui/regions/record"> <xsl:sort select="label/child::*[name() = $lang]" order="ascending"/> <option value="{id}"> <xsl:if test="string(label/child::*[name() = $lang])=$keyword"> <xsl:attribute name="selected"/> </xsl:if> <xsl:value-of select="label/child::*[name() = $lang]"/> </option> </xsl:for-each> </select> </xsl:variable> <xsl:apply-templates mode="simpleElement" select="."> <xsl:with-param name="schema" select="$schema"/> <xsl:with-param name="edit" select="true()"/> <xsl:with-param name="text" select="$text"/> </xsl:apply-templates> </xsl:template> <!-- EX_GeographicBoundingBox --> <xsl:template mode="iso19139" match="gmd:EX_GeographicBoundingBox" priority="2"> <xsl:param name="schema"/> <xsl:param name="edit"/> <xsl:variable name="geoBox"> <xsl:apply-templates mode="iso19139GeoBox" select="."> <xsl:with-param name="schema" select="$schema"/> <xsl:with-param name="edit" select="$edit"/> </xsl:apply-templates> </xsl:variable> <xsl:choose> <xsl:when test="$edit=true()"> <xsl:variable name="places"> <xsl:variable name="ref" select="geonet:element/@ref"/> <xsl:variable name="keyword" select="string(.)"/> <xsl:variable name="selection" select="concat(gmd:westBoundLongitude/gco:Decimal,';',gmd:eastBoundLongitude/gco:Decimal,';',gmd:southBoundLatitude/gco:Decimal,';',gmd:northBoundLatitude/gco:Decimal)"/> <!-- regions combobox --> <xsl:variable name="lang" select="/root/gui/language"/> <select name="place" size="1" onChange="javascript:setRegion(document.mainForm._{gmd:westBoundLongitude/gco:Decimal/geonet:element/@ref}, document.mainForm._{gmd:eastBoundLongitude/gco:Decimal/geonet:element/@ref}, document.mainForm._{gmd:southBoundLatitude/gco:Decimal/geonet:element/@ref}, document.mainForm._{gmd:northBoundLatitude/gco:Decimal/geonet:element/@ref}, this.options[this.selectedIndex].value)"> <option value=""/> <xsl:for-each select="/root/gui/regions/record"> <xsl:sort select="label/child::*[name() = $lang]" order="ascending"/> <xsl:variable name="value" select="concat(west,';',east,';',south,';',north)"/> <option value="{$value}"> <xsl:if test="$value=$selection"> <xsl:attribute name="selected"/> </xsl:if> <xsl:value-of select="label/child::*[name() = $lang]"/> </option> </xsl:for-each> </select> </xsl:variable> <xsl:apply-templates mode="complexElement" select="."> <xsl:with-param name="schema" select="$schema"/> <xsl:with-param name="edit" select="$edit"/> <xsl:with-param name="content"> <tr> <td align="center"> <xsl:copy-of select="$geoBox"/> </td> <td> <xsl:copy-of select="$places"/> </td> </tr> </xsl:with-param> </xsl:apply-templates> </xsl:when> <xsl:otherwise> <xsl:apply-templates mode="complexElement" select="."> <xsl:with-param name="schema" select="$schema"/> <xsl:with-param name="edit" select="$edit"/> <xsl:with-param name="content"> <tr> <td align="center"> <xsl:copy-of select="$geoBox"/> </td> </tr> </xsl:with-param> </xsl:apply-templates> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template mode="iso19139GeoBox" match="*"> <xsl:param name="schema"/> <xsl:param name="edit"/> <table> <tr> <td/> <td class="padded" align="center"> <xsl:apply-templates mode="iso19139VertElement" select="gmd:northBoundLatitude/gco:Decimal"> <xsl:with-param name="schema" select="$schema"/> <xsl:with-param name="edit" select="$edit"/> <xsl:with-param name="name" select="'northBoundLatitude'"/> </xsl:apply-templates> </td> <td/> </tr> <tr> <td class="padded" align="center"> <xsl:apply-templates mode="iso19139VertElement" select="gmd:westBoundLongitude/gco:Decimal"> <xsl:with-param name="schema" select="$schema"/> <xsl:with-param name="edit" select="$edit"/> <xsl:with-param name="name" select="'westBoundLongitude'"/> </xsl:apply-templates> </td> <!-- <td class="box" width="100" height="100" align="center"> --> <xsl:variable name="md"> <xsl:apply-templates mode="brief" select="../.."/> </xsl:variable> <xsl:variable name="metadata" select="xalan:nodeset($md)/*[1]"/> <td width="100" height="100" align="center">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -