Skip to content

Instantly share code, notes, and snippets.

@mejackreed
Last active August 29, 2015 14:18
Show Gist options
  • Save mejackreed/e3dd41e75025efc92e68 to your computer and use it in GitHub Desktop.
Save mejackreed/e3dd41e75025efc92e68 to your computer and use it in GitHub Desktop.
Markup of Kim's iso2html
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:gco="http://www.isotc211.org/2005/gco"
xmlns:gts="http://www.isotc211.org/2005/gts"
xmlns:srv="http://www.isotc211.org/2005/srv"
xmlns:gml="http://www.opengis.net/gml"
exclude-result-prefixes="gmd gco gml srv xlink gts">
<xsl:output method="html" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/>
<xsl:template match="/">
<!DOCTYPE html>
<head>
<title><xsl:value-of select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:title"/></title>
</head>
<body>
<h1><xsl:value-of select="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:title"/></h1>
<ul>
<xsl:for-each select="gmd:MD_Metadata/gmd:identificationInfo">
<li><a href="#identification">Identification Information</a></li>
</xsl:for-each>
<xsl:for-each select="gmd:MD_Metadata/gmd:referenceSystemInfo">
<li><a href="#spatialreference">Spatial Reference Information</a></li>
</xsl:for-each>
<xsl:for-each select="gmd:MD_Metadata/gmd:contentInfo">
<li><a href="#content">Content Information</a></li>
</xsl:for-each>
<xsl:for-each select="gmd:MD_Metadata/gmd:dataQualityInfo">
<li><a href="#dataquality">Data Quality Information</a></li>
</xsl:for-each>
<xsl:for-each select="gmd:MD_Metadata/gmd:distributionInfo">
<li><a href="#distribution">Distribution Information</a></li>
</xsl:for-each>
<xsl:for-each select="gmd:MD_Metadata">
<li><a href="#metadatareference">Metadata Reference Information</a></li>
</xsl:for-each>
<xsl:for-each select="gmd:MD_Metadata/gmd:spatialRepresentationInfo">
<li><a href="#spatialrepresentation">Spatial Representation Information</a></li>
</xsl:for-each>
</ul>
<div>
<xsl:apply-templates/>
</div>
</body>
</html>
</xsl:template>
<xsl:template match="gmd:MD_Metadata">
<dl>
<dt id="identification">Identification Information</dt>
<dd>
<dl>
<xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation">
<dt>Citation</dt>
<dd>
<dl>
<dt>Title</dt>
<dd>
<xsl:value-of select="gmd:title"/>
</dd>
<xsl:for-each select="gmd:citedResponsibleParty/gmd:CI_ResponsibleParty/gmd:role/gmd:CI_RoleCode[@codeListValue='originator']">
<dt>Originator</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:organisationName | ancestor-or-self::*/gmd:individualName"/></dd>
</xsl:for-each>
<xsl:for-each select="gmd:citedResponsibleParty/gmd:CI_ResponsibleParty/gmd:role/gmd:CI_RoleCode[@codeListValue='publisher']">
<dt>Publisher</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:organisationName | ancestor-or-self::*/gmd:individualName"/></dd>
<xsl:if test="ancestor-or-self::*/gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:city">
<dt>Place of Publication</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:city"/></dd>
</xsl:if>
</xsl:for-each>
<xsl:for-each select="gmd:date/gmd:CI_Date">
<xsl:if test="contains(gmd:dateType/gmd:CI_DateTypeCode/@codeListValue,'publication')">
<dt>Publication Date</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:date/gmd:CI_Date/gmd:date"/></dd>
</xsl:if>
<xsl:if test="contains(gmd:dateType/gmd:CI_DateTypeCode/@codeListValue,'creation')">
<dt>Creation Date</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:date/gmd:CI_Date/gmd:date"/></dd>
</xsl:if>
<xsl:if test="contains(gmd:dateType/gmd:CI_DateTypeCode/@codeListValue,'revision')">
<dt>Revision Date</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:date/gmd:CI_Date/gmd:date"/></dd>
</xsl:if>
</xsl:for-each>
<xsl:if test="gmd:edition">
<dt>Edition</dt>
<dd>
<xsl:value-of select="gmd:edition"/>
</dd>
</xsl:if>
<xsl:if test="gmd:identifier/gmd:MD_Identifier/gmd:code">
<dt>Identifier</dt>
<dd>
<xsl:value-of select="gmd:identifier/gmd:MD_Identifier/gmd:code"/>
</dd>
</xsl:if>
<xsl:for-each select="gmd:presentationForm/gmd:CI_PresentationFormCode/@codeListValue">
<dt>Geospatial Data Presentation Form</dt>
<dd><xsl:value-of select="."/></dd>
</xsl:for-each>
<xsl:for-each select="gmd:collectiveTitle">
<dt>Collection Title</dt>
<dd><xsl:value-of select="."/></dd>
</xsl:for-each>
</dl>
</dd>
</xsl:for-each>
<dt>ISO Topic Category</dt>
<xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:topicCategory/gmd:MD_TopicCategoryCode">
<dd>
<xsl:value-of select="."/>
</dd>
</xsl:for-each>
<xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:resourceConstraints">
<xsl:if test="gmd:MD_LegalConstraints">
<dt>Legal Constraints</dt>
</xsl:if>
<xsl:if test="gmd:MD_SecurityConstraints">
<dt>Security Constraints</dt>
</xsl:if>
<xsl:if test="gmd:MD_Constraints">
<dt>Resource Constraints</dt>
</xsl:if>
<dd>
<dl>
<xsl:if test="*/gmd:useLimitation">
<dt>Use Limitation</dt>
<dd>
<xsl:value-of select="*/gmd:useLimitation"/>
</dd>
</xsl:if>
<xsl:if test="*/gmd:accessConstraints">
<dt>Access Restrictions</dt>
<dd>
<xsl:value-of select="*/gmd:accessConstraints/gmd:MD_RestrictionCode/@codeListValue"/>
</dd>
</xsl:if>
<xsl:if test="*/gmd:useConstraints">
<dt>Use Restrictions</dt>
<dd>
<xsl:value-of select="*/gmd:useConstraints/gmd:MD_RestrictionCode/@codeListValue"/>
</dd>
</xsl:if>
<xsl:if test="*/gmd:otherConstraints">
<dt>Other Restrictions</dt>
<dd>
<xsl:value-of select="*/gmd:otherConstraints"/>
</dd>
</xsl:if>
</dl>
</dd>
</xsl:for-each>
<xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:aggregationInfo/gmd:MD_AggregateInformation/gmd:associationType/gmd:DS_AssociationTypeCode[@codeListValue='largerWorkCitation']">
<dt>Collection</dt>
<dd>
<dl>
<dt>Collection Title</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:aggregateDataSetName/gmd:CI_Citation/gmd:title"/></dd>
<dt>URL</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:aggregateDataSetName/gmd:CI_Citation/gmd:identifier/gmd:MD_Identifier/gmd:code"/></dd>
<xsl:for-each select="ancestor-or-self::*/gmd:aggregateDataSetName/gmd:CI_Citation/gmd:citedResponsibleParty/gmd:CI_ResponsibleParty/gmd:role/gmd:CI_RoleCode[@codeListValue='originator']">
<dt>Originator</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:organisationName | ancestor-or-self::*/gmd:individualName"/></dd>
</xsl:for-each>
<xsl:for-each select="ancestor-or-self::*/gmd:aggregateDataSetName/gmd:CI_Citation/gmd:citedResponsibleParty/gmd:CI_ResponsibleParty/gmd:role/gmd:CI_RoleCode[@codeListValue='publisher']">
<dt>Publisher</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:organisationName | ancestor-or-self::*/gmd:individualName"/></dd>
</xsl:for-each>
<xsl:for-each select="ancestor-or-self::*/gmd:aggregateDataSetName/gmd:CI_Citation/gmd:date">
<xsl:if test="contains(descendant-or-self::*/gmd:dateType/gmd:CI_DateTypeCode/@codeListValue,'publication')">
<dt>Publication Date</dt>
<dd><xsl:value-of select="gmd:CI_Date/gmd:date"/></dd>
</xsl:if>
<xsl:if test="contains(descendant-or-self::*/gmd:dateType/gmd:CI_DateTypeCode/@codeListValue,'creation')">
<dt>Creation Date</dt>
<dd><xsl:value-of select="gmd:CI_Date/gmd:date"/></dd>
</xsl:if>
<xsl:if test="contains(descendant-or-self::*/gmd:dateType/gmd:CI_DateTypeCode/@codeListValue,'revision')">
<dt>Revision Date</dt>
<dd><xsl:value-of select="gmd:CI_Date/gmd:date"/></dd>
</xsl:if>
</xsl:for-each>
</dl>
</dd>
</xsl:for-each>
<xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:aggregationInfo/gmd:MD_AggregateInformation/gmd:associationType/gmd:DS_AssociationTypeCode[@codeListValue='crossReference']">
<dt>Cross Reference</dt>
<dd>
<dl>
<dt>Title</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:aggregateDataSetName/gmd:CI_Citation/gmd:title"/></dd>
<dt>URL</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:aggregateDataSetName/gmd:CI_Citation/gmd:identifier/gmd:MD_Identifier/gmd:code"/></dd>
<xsl:for-each select="ancestor-or-self::*/gmd:aggregateDataSetName/gmd:CI_Citation/gmd:citedResponsibleParty/gmd:CI_ResponsibleParty/gmd:role/gmd:CI_RoleCode[@codeListValue='originator']">
<dt>Originator</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:organisationName | ancestor-or-self::*/gmd:individualName"/></dd>
</xsl:for-each>
<xsl:for-each select="ancestor-or-self::*/gmd:aggregateDataSetName/gmd:CI_Citation/gmd:citedResponsibleParty/gmd:CI_ResponsibleParty/gmd:role/gmd:CI_RoleCode[@codeListValue='publisher']">
<dt>Publisher</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:organisationName | ancestor-or-self::*/gmd:individualName"/></dd>
</xsl:for-each>
<xsl:for-each select="ancestor-or-self::*/gmd:aggregateDataSetName/gmd:CI_Citation/gmd:date">
<xsl:if test="contains(descendant-or-self::*/gmd:dateType/gmd:CI_DateTypeCode/@codeListValue,'publication')">
<dt>Publication Date</dt>
<dd><xsl:value-of select="gmd:CI_Date/gmd:date"/></dd>
</xsl:if>
<xsl:if test="contains(descendant-or-self::*/gmd:dateType/gmd:CI_DateTypeCode/@codeListValue,'creation')">
<dt>Creation Date</dt>
<dd><xsl:value-of select="gmd:CI_Date/gmd:date"/></dd>
</xsl:if>
<xsl:if test="contains(descendant-or-self::*/gmd:dateType/gmd:CI_DateTypeCode/@codeListValue,'revision')">
<dt>Revision Date</dt>
<dd><xsl:value-of select="gmd:CI_Date/gmd:date"/></dd>
</xsl:if>
</xsl:for-each>
</dl>
</dd>
</xsl:for-each>
<dt>Language</dt>
<dd>
<xsl:value-of select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:language"/>
</dd>
<dt>Extent</dt>
<xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent">
<dd>
<dl>
<xsl:for-each select="gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox">
<dt>Bounding Box</dt>
<dd>
<dl>
<dt>West</dt>
<dd>
<xsl:value-of select="gmd:westBoundLongitude"/>
</dd>
<dt>East</dt>
<dd>
<xsl:value-of select="gmd:eastBoundLongitude"/>
</dd>
<dt>North</dt>
<dd>
<xsl:value-of select="gmd:northBoundLatitude"/>
</dd>
<dt>South</dt>
<dd>
<xsl:value-of select="gmd:southBoundLatitude"/>
</dd>
</dl>
</dd>
</xsl:for-each>
<xsl:for-each select="gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent">
<dt>Temporal Extent</dt>
<dd>
<dl>
<dt>Currentness Reference</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:description"/></dd>
<xsl:choose>
<xsl:when test="gml:TimePeriod">
<dt>Time Period</dt>
<dd>
<dl>
<dt>Begin</dt>
<dd>
<xsl:value-of select="gml:TimePeriod/gml:beginPosition"/>
</dd>
<dt>End</dt>
<dd>
<xsl:value-of select="gml:TimePeriod/gml:endPosition"/>
</dd>
</dl>
</dd>
</xsl:when>
<xsl:when test="gml:TimeInstant">
<dt>Time Instant</dt>
<dd><xsl:value-of select="gml:TimeInstant/gml:timePosition"/></dd>
</xsl:when>
</xsl:choose>
</dl>
</dd>
</xsl:for-each>
</dl>
</dd>
</xsl:for-each>
<xsl:if test="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:abstract">
<dt>Abstract</dt>
<dd><xsl:value-of select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:abstract"/></dd>
</xsl:if>
<xsl:if test="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:purpose">
<dt>Purpose</dt>
<dd><xsl:value-of select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:purpose"/></dd>
</xsl:if>
<xsl:if test="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:credit">
<dt>Credit</dt>
<dd><xsl:value-of select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:credit"/></dd>
</xsl:if>
<xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:status">
<dt>Status</dt>
<dd><xsl:value-of select="."/></dd>
</xsl:for-each>
<xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:pointOfContact">
<dt>Point of Contact</dt>
<dd>
<dl>
<xsl:for-each select="gmd:CI_ResponsibleParty">
<dt>Contact</dt>
<dd>
<xsl:value-of select="gmd:organisationName | gmd:individualName"/>
</dd>
<xsl:if test="gmd:positionName">
<dt>Position Name</dt>
<dd>
<xsl:value-of select="gmd:positionName"/>
</dd>
</xsl:if>
<xsl:if test="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:deliveryPoint">
<dt>Delivery Point</dt>
<dd>
<xsl:value-of select="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:deliveryPoint"/>
</dd>
</xsl:if>
<xsl:if test="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:city">
<dt>City</dt>
<dd>
<xsl:value-of select="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:city"/>
</dd>
</xsl:if>
<xsl:if test="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:administrativeArea">
<dt>Administrative Area</dt>
<dd>
<xsl:value-of select="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:administrativeArea"/>
</dd>
</xsl:if>
<xsl:if test="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:postalCode">
<dt>Postal Code</dt>
<dd><xsl:value-of select="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:postalCode"/></dd>
</xsl:if>
<xsl:if test="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:country">
<dt>Country</dt>
<dd>
<xsl:value-of select="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:country"/>
</dd>
</xsl:if>
<xsl:if test="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:electronicMailAddress">
<dt>Email</dt>
<dd>
<xsl:value-of select="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:electronicMailAddress"/>
</dd>
</xsl:if>
<xsl:if test="gmd:contactInfo/gmd:CI_Contact/gmd:phone/gmd:CI_Telephone/gmd:voice">
<dt>Phone</dt>
<dd>
<xsl:value-of select="gmd:contactInfo/gmd:CI_Contact/gmd:phone/gmd:CI_Telephone/gmd:voice"/>
</dd>
</xsl:if>
</xsl:for-each>
</dl>
</dd>
</xsl:for-each>
<xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:resourceMaintenance/gmd:MD_MaintenanceInformation/gmd:maintenanceAndUpdateFrequency">
<dt>Maintenance and Update Frequency</dt>
<dd>
<xsl:value-of select="gmd:MD_MaintenanceFrequencyCode/@codeListValue"/>
</dd>
</xsl:for-each>
<dt>Keywords</dt>
<xsl:for-each select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords/gmd:MD_Keywords">
<dd>
<dl>
<xsl:choose>
<xsl:when test="ancestor-or-self::*/gmd:type/gmd:MD_KeywordTypeCode[@codeListValue='theme']">
<xsl:for-each select="gmd:keyword">
<dt>Theme Keyword</dt>
<dd>
<xsl:value-of select="."/>
</dd>
</xsl:for-each>
<xsl:if test="ancestor-or-self::*/gmd:thesaurusName">
<dt>Theme Keyword Thesaurus</dt>
<dd>
<xsl:value-of select="ancestor-or-self::*/gmd:thesaurusName/gmd:CI_Citation/gmd:title"/>
</dd>
</xsl:if>
</xsl:when>
<xsl:when test="ancestor-or-self::*/gmd:type/gmd:MD_KeywordTypeCode[@codeListValue='place']">
<xsl:for-each select="gmd:keyword">
<dt>Place Keyword</dt>
<dd>
<xsl:value-of select="."/>
</dd>
</xsl:for-each>
<xsl:if test="ancestor-or-self::*/gmd:thesaurusName">
<dt>Place Keyword Thesaurus</dt>
<dd>
<xsl:value-of select="ancestor-or-self::*/gmd:thesaurusName/gmd:CI_Citation/gmd:title"/>
</dd>
</xsl:if>
</xsl:when>
<xsl:when test="ancestor-or-self::*/gmd:type/gmd:MD_KeywordTypeCode[@codeListValue='temporal']">
<xsl:for-each select="gmd:keyword">
<dt>Temporal Keyword</dt>
<dd>
<xsl:value-of select="."/>
</dd>
</xsl:for-each>
<xsl:if test="ancestor-or-self::*/gmd:thesaurusName">
<dt>Temporal Keyword Thesaurus</dt>
<dd>
<xsl:value-of select="ancestor-or-self::*/gmd:thesaurusName/gmd:CI_Citation/gmd:title"/>
</dd>
</xsl:if>
</xsl:when>
</xsl:choose>
</dl>
</dd>
</xsl:for-each>
<xsl:if test="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:supplementalInformation">
<dt>Supplemental Information</dt>
<dd>
<xsl:value-of select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:supplementalInformation"/>
</dd>
</xsl:if>
</dl>
</dd>
<!-- Spatial Reference Info -->
<xsl:if test="gmd:referenceSystemInfo">
<dt id="spatialreference">Spatial Reference Information</dt>
<dd>
<dl>
<dt>Reference System Identifier</dt>
<dd>
<dl>
<dt>Code</dt>
<dd><xsl:value-of select="gmd:referenceSystemInfo/gmd:MD_ReferenceSystem/gmd:referenceSystemIdentifier/gmd:RS_Identifier/gmd:code"/></dd>
<dt>Code Space</dt>
<dd><xsl:value-of select="gmd:referenceSystemInfo/gmd:MD_ReferenceSystem/gmd:referenceSystemIdentifier/gmd:RS_Identifier/gmd:codeSpace"/></dd>
<dt>Version</dt>
<dd><xsl:value-of select="gmd:referenceSystemInfo/gmd:MD_ReferenceSystem/gmd:referenceSystemIdentifier/gmd:RS_Identifier/gmd:version"/></dd>
</dl>
</dd>
</dl>
</dd>
</xsl:if>
<!-- ContentInfo -->
<xsl:if test="gmd:contentInfo">
<dt id="content">Content Information</dt>
<dd>
<dl>
<xsl:if test="gmd:contentInfo/gmd:MD_FeatureCatalogueDescription">
<dt>Feature Catalog Description</dt>
<dd>
<dl>
<dt>Compliance Code</dt>
<dd><xsl:value-of select="gmd:contentInfo/gmd:MD_FeatureCatalogueDescription/gmd:complianceCode"/></dd>
<dt>Language</dt>
<dd><xsl:value-of select="gmd:contentInfo/gmd:MD_FeatureCatalogueDescription/gmd:language"/></dd>
<dt>Included With Dataset</dt>
<dd><xsl:value-of select="gmd:contentInfo/gmd:MD_FeatureCatalogueDescription/gmd:includedWithDataset"/></dd>
<dt>Feature Catalog Citation</dt>
<dd>
<dl>
<dt>Title</dt>
<dd>
<xsl:value-of select="gmd:contentInfo/gmd:MD_FeatureCatalogueDescription/gmd:featureCatalogueCitation/gmd:CI_Citation/gmd:title"/>
</dd>
<xsl:for-each select="gmd:contentInfo/gmd:MD_FeatureCatalogueDescription/gmd:featureCatalogueCitation/gmd:CI_Citation/gmd:date/gmd:CI_Date">
<xsl:if test="contains(gmd:dateType/gmd:CI_DateTypeCode/@codeListValue,'publication')">
<dt>Publication Date</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:date/gmd:CI_Date/gmd:date"/></dd>
</xsl:if>
<xsl:if test="contains(gmd:dateType/gmd:CI_DateTypeCode/@codeListValue,'creation')">
<dt>Creation Date</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:date/gmd:CI_Date/gmd:date"/></dd>
</xsl:if>
<xsl:if test="contains(gmd:dateType/gmd:CI_DateTypeCode/@codeListValue,'revision')">
<dt>Revision Date</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:date/gmd:CI_Date/gmd:date"/></dd>
</xsl:if>
</xsl:for-each>
<dt>Feature Catalog Identifier</dt>
<dd><xsl:value-of select="gmd:contentInfo/gmd:MD_FeatureCatalogueDescription/gmd:featureCatalogueCitation/gmd:CI_Citation/gmd:identifier/gmd:MD_Identifier/gmd:code"/></dd>
</dl>
</dd>
</dl>
</dd>
</xsl:if>
<xsl:if test="gmd:contentInfo/gmd:MD_ImageDescription">
<dt>Image Description</dt>
<dd>
<dl>
<dt>Content Type</dt>
<dd>
<xsl:value-of select="gmd:contentInfo/gmd:MD_ImageDescription/gmd:contentType/gmd:MD_CoverageContentTypeCode[@codeListValue]"/>
</dd>
</dl>
</dd>
</xsl:if>
</dl>
</dd>
</xsl:if>
<!-- Data Quality Info -->
<xsl:if test="gmd:dataQualityInfo/gmd:DQ_DataQuality">
<dt id="dataquality">Data Quality Information</dt>
<dd>
<dl>
<xsl:if test="gmd:DQ_Scope/gmd:level">
<dt>Scope</dt>
<dd>
<xsl:value-of select="gmd:DQ_Scope/gmd:level/gmd:MD_ScopeCode[@codeListValue]"/>
</dd>
</xsl:if>
<xsl:for-each select="gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:report">
<xsl:if test="gmd:DQ_QuantitativeAttributeAccuracy">
<dt>Quantitative Attribute Accuracy Report</dt>
<dd>
<dl>
<xsl:if test="gmd:DQ_QuantitativeAttributeAccuracy/gmd:evaluationMethodDescription/text()">
<dt>Evaluation Method</dt>
<dd><xsl:value-of select="gmd:DQ_QuantitativeAttributeAccuracy/gmd:evaluationMethodDescription"/></dd>
</xsl:if>
<xsl:if test="gmd:DQ_QuantitativeAttributeAccuracy/gmd:result/text()">
<dt>Result</dt>
<dd><xsl:value-of select="gmd:DQ_QuantitativeAttributeAccuracy/gmd:result"/></dd>
</xsl:if>
</dl>
</dd>
</xsl:if>
<xsl:if test="gmd:DQ_AbsoluteExternalPositionalAccuracy">
<dt>Absolute External Positional Accuracy</dt>
<dd>
<dl>
<xsl:if test="gmd:DQ_AbsoluteExternalPositionalAccuracy/gmd:evaluationMethodDescription/text()">
<dt>Evaluation Method</dt>
<dd><xsl:value-of select="gmd:DQ_AbsoluteExternalPositionalAccuracy/gmd:evaluationMethodDescription"/></dd>
</xsl:if>
<xsl:if test="gmd:DQ_AbsoluteExternalPositionalAccuracy/gmd:result/text()">
<dt>Result</dt>
<dd><xsl:value-of select="gmd:DQ_AbsoluteExternalPositionalAccuracy/gmd:result"/></dd>
</xsl:if>
</dl>
</dd>
</xsl:if>
<xsl:if test="gmd:DQ_CompletenessCommission">
<dt>Completeness Commission</dt>
<dd>
<dl>
<xsl:if test="gmd:DQ_CompletenessCommission/gmd:evaluationMethodDescription/text()">
<dt>Evaluation Method</dt>
<dd><xsl:value-of select="gmd:DQ_CompletenessCommission/gmd:evaluationMethodDescription"/></dd>
</xsl:if>
<xsl:if test="gmd:DQ_CompletenessCommission/gmd:result/text()">
<dt>Result</dt>
<dd><xsl:value-of select="gmd:DQ_CompletenessCommission/gmd:result"/></dd>
</xsl:if>
</dl>
</dd>
</xsl:if>
</xsl:for-each>
<xsl:for-each select="gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:lineage/gmd:LI_Lineage">
<dt>Lineage</dt>
<dd>
<dl>
<xsl:if test="gmd:statement">
<dt>Statement</dt>
<dd>
<xsl:value-of select="gmd:statement"/>
</dd>
</xsl:if>
<xsl:for-each select="gmd:source/gmd:LI_Source/gmd:sourceCitation">
<dt>Source</dt>
<dd>
<dl>
<dt>Title</dt>
<dd>
<xsl:value-of select="gmd:CI_Citation/gmd:title"/>
</dd>
<xsl:for-each select="gmd:CI_Citation/gmd:date/gmd:CI_Date">
<xsl:if test="contains(gmd:dateType/gmd:CI_DateTypeCode/@codeListValue,'publication')">
<dt>Publication Date</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:date/gmd:CI_Date/gmd:date"/></dd>
</xsl:if>
<xsl:if test="contains(gmd:dateType/gmd:CI_DateTypeCode/@codeListValue,'creation')">
<dt>Creation Date</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:date/gmd:CI_Date/gmd:date"/></dd>
</xsl:if>
<xsl:if test="contains(gmd:dateType/gmd:CI_DateTypeCode/@codeListValue,'revision')">
<dt>Revision Date</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:date/gmd:CI_Date/gmd:date"/></dd>
</xsl:if>
</xsl:for-each>
<xsl:for-each select="gmd:CI_Citation/gmd:citedResponsibleParty/gmd:CI_ResponsibleParty/gmd:role/gmd:CI_RoleCode[@codeListValue='originator']">
<dt>Originator</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:organisationName | ancestor-or-self::*/gmd:individualName"/></dd>
</xsl:for-each>
<xsl:for-each select="gmd:CI_Citation/gmd:citedResponsibleParty/gmd:CI_ResponsibleParty/gmd:role/gmd:CI_RoleCode[@codeListValue='publisher']">
<dt>Publisher</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:organisationName | ancestor-or-self::*/gmd:individualName"/></dd>
<xsl:if test="ancestor-or-self::*/gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:city">
<dt>Place of Publication</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:city"/></dd>
</xsl:if>
</xsl:for-each>
<xsl:if test="gmd:CI_Citation/gmd:identifier/gmd:MD_Identifier/gmd:code">
<dt>Identifier</dt>
<dd><xsl:value-of select="gmd:CI_Citation/gmd:identifier/gmd:MD_Identifier/gmd:code"/></dd>
</xsl:if>
<xsl:if test="ancestor-or-self::*/gmd:description">
<dt>Description</dt>
<dd><xsl:value-of select="ancestor-or-self::*/gmd:description"/></dd>
</xsl:if>
</dl>
</dd>
</xsl:for-each>
</dl>
</dd>
</xsl:for-each>
</dl>
</dd>
</xsl:if>
<!-- Metadata Reference Info -->
<dt id="metadatareference">Metadata Reference Information</dt>
<dd>
<dl>
<dt>Metadata File Identifier</dt>
<dd>
<xsl:value-of select="gmd:fileIdentifier"/>
</dd>
<dt>Parent Identifier</dt>
<dd>
<xsl:value-of select="gmd:parentIdentifier"/>
</dd>
<dt>Dataset URI</dt>
<dd>
<xsl:value-of select="gmd:dataSetURI"/>
</dd>
<xsl:for-each select="gmd:metadataMaintenance/gmd:MD_MaintenanceInformation/gmd:contact">
<dt>Metadata Point of Contact</dt>
<dd>
<dl>
<xsl:for-each select="gmd:CI_ResponsibleParty">
<dt>Name</dt>
<dd>
<xsl:value-of select="gmd:organisationName | gmd:individualName"/>
</dd>
<xsl:if test="gmd:positionName">
<dt>Position Name</dt>
<dd>
<xsl:value-of select="gmd:positionName"/>
</dd>
</xsl:if>
<xsl:if test="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:deliveryPoint">
<dt>Delivery Point</dt>
<dd>
<xsl:value-of select="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:deliveryPoint"/>
</dd>
</xsl:if>
<xsl:if test="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:city">
<dt>City</dt>
<dd>
<xsl:value-of select="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:city"/>
</dd>
</xsl:if>
<xsl:if test="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:administrativeArea">
<dt>Administrative Area</dt>
<dd>
<xsl:value-of select="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:administrativeArea"/>
</dd>
</xsl:if>
<xsl:if test="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:postalCode">
<dt>Postal Code</dt>
<dd><xsl:value-of select="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:postalCode"/></dd>
</xsl:if>
<xsl:if test="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:country">
<dt>Country</dt>
<dd>
<xsl:value-of select="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:country"/>
</dd>
</xsl:if>
<xsl:if test="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:electronicMailAddress">
<dt>Email</dt>
<dd>
<xsl:value-of select="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:electronicMailAddress"/>
</dd>
</xsl:if>
<xsl:if test="gmd:contactInfo/gmd:CI_Contact/gmd:phone/gmd:CI_Telephone/gmd:voice">
<dt>Phone</dt>
<dd>
<xsl:value-of select="gmd:contactInfo/gmd:CI_Contact/gmd:phone/gmd:CI_Telephone/gmd:voice"/>
</dd>
</xsl:if>
</xsl:for-each>
</dl>
</dd>
</xsl:for-each>
<dt>Metadata Date Stamp</dt>
<dd>
<xsl:value-of select="gmd:dateStamp"/>
</dd>
<dt>Metadata Standard Name</dt>
<dd>
<xsl:value-of select="gmd:metadataStandardName"/>
</dd>
<dt>Metadata Standard Version</dt>
<dd>
<xsl:value-of select="gmd:metadataStandardVersion"/>
</dd>
<dt>Character Set</dt>
<dd>
<xsl:value-of select="gmd:characterSet"/>
</dd>
</dl>
</dd>
<!-- Distribution -->
<xsl:if test="gmd:distributionInfo">
<dt id="distribution">Distribution Information</dt>
<dd>
<dl>
<xsl:if test="gmd:distributionInfo/gmd:MD_Distribution/gmd:distributionFormat/gmd:MD_Format">
<dt>Format Name</dt>
<dd>
<xsl:value-of select="gmd:distributionInfo/gmd:MD_Distribution/gmd:distributionFormat/gmd:MD_Format/gmd:name"/>
</dd>
<xsl:if test="gmd:distributionInfo/gmd:MD_Distribution/gmd:distributionFormat/gmd:MD_Format/gmd:version/text()">
<dt>Format Version</dt>
<dd>
<xsl:value-of select="gmd:distributionInfo/gmd:MD_Distribution/gmd:distributionFormat/gmd:MD_Format/gmd:version"/>
</dd>
</xsl:if>
</xsl:if>
<dt>Distributor</dt>
<dd>
<xsl:value-of select="gmd:distributionInfo/gmd:MD_Distribution/gmd:distributor/gmd:MD_Distributor/gmd:distributorContact/gmd:CI_ResponsibleParty/gmd:organisationName"/>
</dd>
<xsl:for-each select="gmd:distributionInfo/gmd:MD_Distribution/gmd:transferOptions/gmd:MD_DigitalTransferOptions/gmd:onLine">
<dt>Online Access</dt>
<dd>
<xsl:value-of select="gmd:CI_OnlineResource/gmd:linkage/gmd:URL"/>
</dd>
<dt>Protocol</dt>
<dd>
<xsl:value-of select="gmd:CI_OnlineResource/gmd:protocol"/>
</dd>
<dt>Name</dt>
<dd>
<xsl:value-of select="gmd:CI_OnlineResource/gmd:name"/>
</dd>
<dt>Function</dt>
<dd>
<xsl:value-of select="gmd:CI_OnlineResource/gmd:function/gmd:CI_OnLineFunctionCode/@codeListValue"/>
</dd>
</xsl:for-each>
</dl>
</dd>
</xsl:if>
<!-- Spatial Representation -->
<xsl:if test="gmd:spatialRepresentationInfo">
<dt id="spatialrepresentation">Spatial Representation Information</dt>
<dd>
<dl>
<xsl:choose>
<xsl:when test="gmd:spatialRepresentationInfo/gmd:MD_VectorSpatialRepresentation">
<dt>Vector</dt>
<dd>
<dl>
<dt>Vector Object Type</dt>
<dd>
<xsl:value-of select="gmd:spatialRepresentationInfo/gmd:MD_VectorSpatialRepresentation/gmd:geometricObjects/gmd:MD_GeometricObjects/gmd:geometricObjectType/gmd:MD_GeometricObjectTypeCode[@codeListValue]"/>
</dd>
<dt>Vector Object Count</dt>
<dd>
<xsl:value-of select="gmd:spatialRepresentationInfo/gmd:MD_VectorSpatialRepresentation/gmd:geometricObjects/gmd:MD_GeometricObjects/gmd:geometricObjectCount"/>
</dd>
</dl>
</dd>
</xsl:when>
<xsl:when test="gmd:spatialRepresentationInfo/gmd:MD_GridSpatialRepresentation">
<dt>Raster</dt>
<dd>
<dl>
<xsl:if test="gmd:spatialRepresentationInfo/gmd:MD_GridSpatialRepresentation/gmd:numberOfDimensions">
<dt>Number of Dimensions</dt>
<dd>
<xsl:value-of select="gmd:spatialRepresentationInfo/gmd:MD_GridSpatialRepresentation/gmd:numberOfDimensions"/>
</dd>
</xsl:if>
<xsl:if test="contains(gmd:spatialRepresentationInfo/gmd:MD_GridSpatialRepresentation/gmd:axisDimensionProperties/gmd:MD_Dimension/gmd:dimensionName/gmd:MD_DimensionNameTypeCode/@codeListValue, 'row')">
<dt>Row Count</dt>
<dd>
<xsl:value-of select="gmd:spatialRepresentationInfo/gmd:MD_GridSpatialRepresentation/gmd:axisDimensionProperties/gmd:MD_Dimension/gmd:dimensionSize"/>
</dd>
</xsl:if>
</dl>
</dd>
</xsl:when>
</xsl:choose>
</dl>
</dd>
</xsl:if>
</dl>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment