<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gml="http://www.opengis.net/gml"
  xmlns:gts="http://www.isotc211.org/2005/gts" xmlns:gmi="http://www.isotc211.org/2005/gmi" xmlns:srv="http://www.isotc211.org/2005/srv" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
  <xd:doc xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet">
    <xd:desc>
      <xd:p><xd:b>Created on:</xd:b>April 14, 2011</xd:p>
      <xd:p><xd:b>Author:</xd:b>ted.habermann@noaa.gov</xd:p>
      <xd:p/>
    </xd:desc>
  </xd:doc>
  <xsl:variable name="transformName" select="'ISO19115Components-HTMLTable.xsl'"/>
  <xsl:variable name="transformVersion" select="'1.6'"/>
  <xsl:variable name="contact" select="gmi:MI_Metadata/gmd:contact"/>
  <xsl:variable name="fileID" select="gmi:MI_Metadata/gmd:fileIdentifier/gco:CharacterString|gmd:MD_Metadata/gmd:fileIdentifier/gco:CharacterString|//gmd:seriesMetadata/gmi:MI_Metadata/gmd:fileIdentifier/gco:CharacterString"/>
  <xsl:variable name="fileScope" select="gmi:MI_Metadata/gmd:hierarchyLevel/gmd:MD_ScopeCode|gmd:MD_Metadata/gmd:hierarchyLevel/gmd:MD_ScopeCode|//gmd:seriesMetadata/gmi:MI_Metadata/gmd:hierarchyLevel/gmd:MD_ScopeCode"/>
  <xsl:key name="responsibleIndividuals" match="//gmd:CI_ResponsibleParty/gmd:individualName/gco:CharacterString" use="."/>
  <xsl:key name="responsibleOrganizations" match="//gmd:CI_ResponsibleParty/gmd:organisationName/gco:CharacterString" use="."/>
  <!-- Display Results Fields -->
  <xsl:template match="/">
    <html>
      <head>
        <style type="text/css">
          table {
              empty-cells:show;
          }</style>
        <title>ISO Table View</title>
      </head>
      <body>
        <h1>ISO 19115 Summary</h1>
        <p>This report displays some of the contents of ISO 19115 record</p>
        <p>This report is produced using this <a href="http://www.ngdc.noaa.gov/metadata/published/xsl/ISO19115Components-HTMLTable.xsl">stylesheet</a>. Please contact <a href="mailto:john.kozimor@noaa.gov">John Kozimor</a> if you have
          questions or suggestions.</p>
        <h2>Identifier: <xsl:value-of select="$fileID"/> (<xsl:value-of select="$fileScope"/>)</h2>
        <xsl:if test="count(//gmd:identificationInfo//gmd:citation)">
          <div>
            <a name="Citations"/>
          </div>
          <h2>Data Citations</h2>
          <table width="95%" border="1" cellpadding="2" cellspacing="2">
            <tr>
              <th valign="top">ID</th>
              <th valign="top">UUID</th>
              <th valign="top">Identifier Code</th>
              <th valign="top">Title</th>
              <th valign="top">Date</th>
            </tr>
            <xsl:for-each select="//gmd:identificationInfo//gmd:citation">
              <xsl:variable name="ID" select="gmd:CI_Citation/@id"/>
              <xsl:variable name="UUID" select="gmd:CI_Citation/@uuid"/>
              <xsl:variable name="Link" select="./@xlink:href"/>
              <xsl:variable name="LinkTitle" select="./@xlink:title"/>
              <xsl:variable name="identifierCode" select="gmd:CI_Citation/gmd:identifier/gmd:MD_Identifier/gmd:code/gco:CharacterString"/>
              <xsl:variable name="title" select="gmd:CI_Citation/gmd:title/gco:CharacterString"/>
              <xsl:variable name="date" select="gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:date/gco:Date"/>
              <tr>
                <td valign="top">
                  <xsl:value-of select="$ID"/>
                </td>
                <td valign="top">
                  <a>
                    <xsl:attribute name="href">
                      <xsl:value-of select="concat('http://www.ngdc.noaa.gov/docucomp/iso/',$UUID)"/>
                    </xsl:attribute>
                    <xsl:value-of select="$UUID"/>
                  </a>
                </td>
                <td valign="top">
                  <xsl:value-of select="$identifierCode"/>
                </td>
                <td valign="top">
                  <xsl:value-of select="$title"/>
                </td>
                <td valign="top">
                  <xsl:value-of select="$date"/>
                </td>
              </tr>
            </xsl:for-each>
          </table>
          <div style="font-size:12px">
            <a href="#responsibleParties">Responsible Parties</a> | <a href="#citationResponsibleParties">Citation Responsible Parties</a> | <a href="#boundingExtent">Bounding Extent</a> | <a href="#onlineResources">OnlineResources</a> | <a
              href="#Distributors">Distributors</a> | <a href="#Services">Services</a> | <a href="#platforms">Platforms</a> | <a href="#instruments">Instruments</a> | <a href="#operations">Operations</a><br/></div>
        </xsl:if>
        <xsl:if test="count(//gmd:sourceCitation)">
          <div>
            <a name="Sources"/>
          </div>
          <h2>Sources</h2>
          <table width="95%" border="1" cellpadding="2" cellspacing="2">
            <tr>
              <th valign="top">ID</th>
              <th valign="top">UUID</th>
              <th valign="top">Identifier Code</th>
              <th valign="top">Title</th>
              <th valign="top">Date</th>
            </tr>
            <xsl:for-each select="//gmd:sourceCitation">
              <xsl:variable name="ID" select="gmd:CI_Citation/@id"/>
              <xsl:variable name="UUID" select="gmd:CI_Citation/@uuid"/>
              <xsl:variable name="Link" select="./@xlink:href"/>
              <xsl:variable name="LinkTitle" select="./@xlink:title"/>
              <xsl:variable name="identifierCode" select="gmd:CI_Citation/gmd:identifier/gmd:MD_Identifier/gmd:code/gco:CharacterString"/>
              <xsl:variable name="title" select="gmd:CI_Citation/gmd:title/gco:CharacterString"/>
              <xsl:variable name="date" select="gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:date/gco:Date"/>
              <tr>
                <td valign="top">
                  <xsl:value-of select="$ID"/>
                </td>
                <td valign="top">
                  <a>
                    <xsl:attribute name="href">
                      <xsl:value-of select="concat('http://www.ngdc.noaa.gov/docucomp/iso/',$UUID)"/>
                    </xsl:attribute>
                    <xsl:value-of select="$UUID"/>
                  </a>
                </td>
                <td valign="top">
                  <xsl:value-of select="$identifierCode"/>
                </td>
                <td valign="top">
                  <xsl:value-of select="$title"/>
                </td>
                <td valign="top">
                  <xsl:value-of select="$date"/>
                </td>
              </tr>
            </xsl:for-each>
          </table>
          <div style="font-size:12px">
            <a href="#responsibleParties">Responsible Parties</a> | <a href="#citationResponsibleParties">Citation Responsible Parties</a> | <a href="#boundingExtent">Bounding Extent</a> | <a href="#onlineResources">OnlineResources</a> | <a
              href="#Distributors">Distributors</a> | <a href="#Services">Services</a> | <a href="#platforms">Platforms</a> | <a href="#instruments">Instruments</a> | <a href="#operations">Operations</a><br/></div>
        </xsl:if>
        <xsl:if test="count(//gmd:lineage//gmd:processStep//gmd:description)">
          <h2>Process Steps</h2>
          <table width="95%" border="1" cellpadding="2" cellspacing="2">
            <tr>
              <th valign="top">Description</th>
              <th valign="top">Process Command</th>
              <th valign="top">Input</th>
              <th valign="top">Output</th>
            </tr>
            <xsl:for-each select="//gmi:LE_ProcessStep">
              <!-- 
              <xsl:variable name="ProcessDescription" select="gmd:description/gco:CharacterString"/>
              <xsl:variable name="ProcessCommand" select="gmi:processingInformation/gmi:LE_Processing/gmi:runTimeParameters/gco:CharacterString"/>
              <xsl:variable name="input" select="gmd:source/@xlink:href"/>
              <xsl:variable name="output" select="gmi:output/@xlink:href"/>
              -->
              <tr>
                <td valign="top">
                  <xsl:value-of select="gmd:description/gco:CharacterString"/>
                </td>
                <td valign="top">
                  <xsl:value-of select="gmi:processingInformation/gmi:LE_Processing/gmi:runTimeParameters/gco:CharacterString"/>
                </td>
                <td valign="top">
                  <xsl:for-each select="gmd:source">
                    <xsl:value-of select="@xlink:title"/>
                    <br/>
                  </xsl:for-each>
                </td>
                <td valign="top">
                  <xsl:for-each select="gmi:output">
                    <xsl:value-of select="@xlink:title"/>
                    <br/>
                  </xsl:for-each>
                </td>
              </tr>
            </xsl:for-each>
          </table>
          <div style="font-size:12px">
            <a href="#responsibleParties">Responsible Parties</a> | <a href="#citationResponsibleParties">Citation Responsible Parties</a> | <a href="#boundingExtent">Bounding Extent</a> | <a href="#onlineResources">OnlineResources</a> | <a
              href="#Distributors">Distributors</a> | <a href="#Services">Services</a> | <a href="#platforms">Platforms</a> | <a href="#instruments">Instruments</a> | <a href="#operations">Operations</a><br/></div>
        </xsl:if>
        <xsl:if test="count(//gmd:identificationInfo//gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty)">
          <div>
            <a name="citationResponsibleParties"/>
          </div>
          <h2>Citation Responsible Parties</h2>
          <table width="95%" border="1" cellpadding="2" cellspacing="2">
            <tr>
              <th valign="top">ID</th>
              <th valign="top">UUID</th>
              <th valign="top">Individual</th>
              <th valign="top">Organization</th>
              <th valign="top">Position</th>
              <th valign="top">Email</th>
              <th valign="top">Role</th>
              <th valign="top">Linkage</th>
            </tr>
            <xsl:for-each select="//gmd:identificationInfo//gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty">
              <xsl:variable name="ID" select="gmd:CI_ResponsibleParty/@id"/>
              <xsl:variable name="UUID" select="gmd:CI_ResponsibleParty/@uuid"/>
              <xsl:variable name="Link" select="./@xlink:href"/>
              <xsl:variable name="LinkTitle" select="./@xlink:title"/>
              <xsl:variable name="Title" select="./xlink:title"/>
              <xsl:variable name="individualName" select="gmd:CI_ResponsibleParty/gmd:individualName/gco:CharacterString"/>
              <xsl:variable name="organisationName" select="gmd:CI_ResponsibleParty/gmd:organisationName/gco:CharacterString"/>
              <xsl:variable name="positionName" select="gmd:CI_ResponsibleParty/gmd:positionName/gco:CharacterString"/>
              <xsl:variable name="linkage" select="gmd:CI_ResponsibleParty/gmd:contactInfo/gmd:CI_Contact/gmd:onlineResource/gmd:CI_OnlineResource/gmd:linkage/gmd:URL"/>
              <xsl:variable name="email" select="gmd:CI_ResponsibleParty/gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:electronicMailAddress/gco:CharacterString"/>
              <xsl:variable name="role" select="gmd:CI_ResponsibleParty/gmd:role/gmd:CI_RoleCode"/>
              <tr>
                <td valign="top">
                  <xsl:value-of select="$ID"/>
                </td>
                <xsl:choose>
                  <xsl:when test="$UUID">
                    <td valign="top">
                      <a>
                        <xsl:attribute name="href">
                          <xsl:value-of select="concat('http://www.ngdc.noaa.gov/docucomp/iso/',$UUID)"/>
                        </xsl:attribute>
                        <xsl:value-of select="$LinkTitle"/>
                      </a>
                    </td>
                  </xsl:when>
                  <xsl:otherwise>
                    <td valign="top">
                      <a>
                        <xsl:attribute name="href">
                          <xsl:value-of select="$Link"/>
                        </xsl:attribute>
                        <xsl:value-of select="$LinkTitle"/>
                      </a>
                    </td>
                  </xsl:otherwise>
                </xsl:choose>
                <td valign="top">
                  <xsl:value-of select="$individualName"/>
                </td>
                <td valign="top">
                  <xsl:value-of select="$organisationName"/>
                </td>
                <td valign="top">
                  <xsl:value-of select="$positionName"/>
                </td>
                <td valign="top">
                  <xsl:value-of select="$email"/>
                </td>
                <td valign="top">
                  <xsl:value-of select="$role"/>
                </td>
                <td valign="top">
                  <a>
                    <xsl:attribute name="href">
                      <xsl:value-of select="$linkage"/>
                    </xsl:attribute>
                    <xsl:value-of select="$linkage"/>
                  </a>
                </td>
              </tr>
            </xsl:for-each>
          </table>
          <div style="font-size:12px">
            <a href="#responsibleParties">Responsible Parties</a> | <a href="#citationResponsibleParties">Citation Responsible Parties</a> | <a href="#boundingExtent">Bounding Extent</a> | <a href="#onlineResources">OnlineResources</a> | <a
              href="#Distributors">Distributors</a> | <a href="#Services">Services</a> | <a href="#platforms">Platforms</a> | <a href="#instruments">Instruments</a> | <a href="#operations">Operations</a><br/></div>
        </xsl:if>
        <xsl:if test="count(//gmd:CI_ResponsibleParty)">
          <a name="responsibleParties"/>
          <h2>Other Responsible Individuals</h2>
          <table width="95%" border="1" cellpadding="2" cellspacing="2">
            <tr>
              <th valign="top">ID</th>
              <th valign="top">Link/UUID</th>
              <th valign="top">Individual</th>
              <th valign="top">Organization</th>
              <th valign="top">Position</th>
              <th valign="top">Email</th>
              <th valign="top">Role</th>
              <th valign="top">Linkage</th>
            </tr>
            <xsl:for-each select="//gmd:CI_ResponsibleParty/gmd:individualName/gco:CharacterString[generate-id()=generate-id(key('responsibleIndividuals',.))]">
              <xsl:variable name="ID" select="../../@id"/>
              <xsl:variable name="UUID" select="../../@uuid"/>
              <xsl:variable name="Title" select="../../../@xlink:title"/>
              <xsl:variable name="Link" select="../../@xlink:href"/>
              <xsl:variable name="LinkTitle" select="../../@xlink:title"/>
              <xsl:variable name="individualName" select="."/>
              <xsl:variable name="organisationName" select="../../gmd:organisationName/gco:CharacterString"/>
              <xsl:variable name="positionName" select="../../gmd:positionName/gco:CharacterString"/>
              <xsl:variable name="email" select="../../gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:electronicMailAddress/gco:CharacterString"/>
              <xsl:variable name="role" select="../../gmd:role/gmd:CI_RoleCode"/>
              <xsl:variable name="linkage" select="../../gmd:contactInfo/gmd:CI_Contact/gmd:onlineResource/gmd:CI_OnlineResource/gmd:linkage/gmd:URL"/>
              <tr>
                <td valign="top">
                  <tt>
                    <xsl:value-of select="$ID"/>
                  </tt>
                </td>
                <xsl:choose>
                  <xsl:when test="$UUID">
                    <td valign="top">
                      <tt>
                        <a><xsl:attribute name="href"><xsl:value-of select="concat('http://www.ngdc.noaa.gov/docucomp/',$UUID)"/></xsl:attribute><xsl:value-of select="$Title"/></a>
                      </tt>
                    </td>
                  </xsl:when>
                  <xsl:otherwise>
                    <td valign="top">
                      <tt>
                        <a><xsl:attribute name="href"><xsl:value-of select="$Link"/></xsl:attribute><xsl:value-of select="$LinkTitle"/></a>
                      </tt>
                    </td>
                  </xsl:otherwise>
                </xsl:choose>
                <td valign="top">
                  <tt>
                    <xsl:value-of select="$individualName"/>
                  </tt>
                </td>
                <td valign="top">
                  <tt>
                    <xsl:value-of select="$organisationName"/>
                  </tt>
                </td>
                <td valign="top">
                  <tt>
                    <xsl:value-of select="$positionName"/>
                  </tt>
                </td>
                <td valign="top">
                  <tt>
                    <xsl:value-of select="$email"/>
                  </tt>
                </td>
                <td valign="top">
                  <tt>
                    <xsl:value-of select="$role"/>
                  </tt>
                </td>
                <td valign="top">
                  <tt>
                    <a><xsl:attribute name="href"><xsl:value-of select="$linkage"/></xsl:attribute><xsl:value-of select="$linkage"/></a>
                  </tt>
                </td>
              </tr>
            </xsl:for-each>
          </table>
          <div style="font-size:12px">
            <a href="#responsibleParties">Responsible Parties</a> | <a href="#citationResponsibleParties">Citation Responsible Parties</a> | <a href="#boundingExtent">Bounding Extent</a> | <a href="#onlineResources">OnlineResources</a> | <a
              href="#Distributors">Distributors</a> | <a href="#Services">Services</a> | <a href="#platforms">Platforms</a> | <a href="#instruments">Instruments</a> | <a href="#operations">Operations</a><br/></div>
          <h2>Other Responsible Organizations</h2>
          <table width="95%" border="1" cellpadding="2" cellspacing="2">
            <tr>
              <th valign="top">ID</th>
              <th valign="top">Link/UUID</th>
              <th valign="top">Individual</th>
              <th valign="top">Organization</th>
              <th valign="top">Position</th>
              <th valign="top">Email</th>
              <th valign="top">Role</th>
              <th valign="top">Linkage</th>
            </tr>
            <xsl:for-each select="//gmd:CI_ResponsibleParty/gmd:organisationName/gco:CharacterString[generate-id()=generate-id(key('responsibleOrganizations',.))]">
              <xsl:variable name="ID" select="../../@id"/>
              <xsl:variable name="UUID" select="../../@uuid"/>
              <xsl:variable name="Title" select="../../../@xlink:title"/>
              <xsl:variable name="Link" select="../../@xlink:href"/>
              <xsl:variable name="LinkTitle" select="../../@xlink:title"/>
              <xsl:variable name="individualName" select="../../gmd:individualName/gco:CharacterString"/>
              <xsl:variable name="organisationName" select="."/>
              <xsl:variable name="positionName" select="../../gmd:positionName/gco:CharacterString"/>
              <xsl:variable name="email" select="../../gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:electronicMailAddress/gco:CharacterString"/>
              <xsl:variable name="role" select="../../gmd:role/gmd:CI_RoleCode"/>
              <xsl:variable name="linkage" select="../../gmd:contactInfo/gmd:CI_Contact/gmd:onlineResource/gmd:CI_OnlineResource/gmd:linkage/gmd:URL"/>
              <tr>
                <td valign="top">
                  <tt>
                    <xsl:value-of select="$ID"/>
                  </tt>
                </td>
                <xsl:choose>
                  <xsl:when test="$UUID">
                    <td valign="top">
                      <tt>
                        <a><xsl:attribute name="href"><xsl:value-of select="concat('http://www.ngdc.noaa.gov/docucomp/',$UUID)"/></xsl:attribute><xsl:value-of select="$organisationName"/></a>
                      </tt>
                    </td>
                  </xsl:when>
                  <xsl:otherwise>
                    <td valign="top">
                      <tt>
                        <a><xsl:attribute name="href"><xsl:value-of select="$Link"/></xsl:attribute><xsl:value-of select="$LinkTitle"/></a>
                      </tt>
                    </td>
                  </xsl:otherwise>
                </xsl:choose>
                <td valign="top">
                  <tt>
                    <xsl:value-of select="$individualName"/>
                  </tt>
                </td>
                <td valign="top">
                  <tt>
                    <xsl:value-of select="$organisationName"/>
                  </tt>
                </td>
                <td valign="top">
                  <tt>
                    <xsl:value-of select="$positionName"/>
                  </tt>
                </td>
                <td valign="top">
                  <tt>
                    <xsl:value-of select="$email"/>
                  </tt>
                </td>
                <td valign="top">
                  <tt>
                    <xsl:value-of select="$role"/>
                  </tt>
                </td>
                <td valign="top">
                  <tt>
                    <a><xsl:attribute name="href"><xsl:value-of select="$linkage"/></xsl:attribute><xsl:value-of select="$linkage"/></a>
                  </tt>
                </td>
              </tr>
            </xsl:for-each>
          </table>
          <div  style="font-size:12px">
          <a href="#responsibleParties">Responsible Parties</a> | <a href="#citationResponsibleParties">Citation Responsible Parties</a> | <a href="#boundingExtent">Bounding Extent</a> | <a href="#onlineResources">OnlineResources</a> | <a
            href="#Distributors">Distributors</a> | <a href="#Services">Services</a> | <a href="#platforms">Platforms</a> | <a href="#instruments">Instruments</a> | <a href="#operations">Operations</a><br/></div>
        </xsl:if>
        <xsl:if test="count(/gmd:DS_OtherAggregate/gmd:composedOf/gmd:DS_DataSet/gmd:has/gmi:MI_Metadata)">
          <div>
            <a name="dimensionGroups"/>
          </div>
          <h2>Dimension Groups</h2>
          <xsl:for-each select="/gmd:DS_OtherAggregate/gmd:composedOf/gmd:DS_DataSet/gmd:has/gmi:MI_Metadata">
            <xsl:variable name="aggregateID" select="./gmd:fileIdentifier/gco:CharacterString"/>
            <xsl:variable name="aggregateScope" select="./gmd:hierarchyLevel/gmd:MD_ScopeCode"/>
            <h3><xsl:value-of select="$aggregateID"/> (<xsl:value-of select="$aggregateScope"/>)</h3>
            <table border="1" cellpadding="4" cellspacing="2">
              <tr>
                <td valign="top">
                  <h2>Spatial Representation</h2>
                  <xsl:if test="count(./gmd:spatialRepresentationInfo)">
                    <div>
                      <a name="spatialRepresentation"/>
                    </div>
                    <b><xsl:value-of select="./gmd:spatialRepresentationInfo//gmd:numberOfDimensions/gco:Integer"/> Dimensions</b>
                    <table border="1" cellpadding="2" cellspacing="2">
                      <tr>
                        <th valign="top">Name</th>
                        <th valign="top">Size</th>
                      </tr>
                      <xsl:for-each select="./gmd:spatialRepresentationInfo//gmd:axisDimensionProperties">
                        <tr>
                          <xsl:choose>
                            <xsl:when test="./gmd:MD_Dimension/@id">
                              <td><xsl:value-of select="./gmd:MD_Dimension/@id"/> (<xsl:value-of select="./gmd:MD_Dimension/gmd:dimensionName/gmd:MD_DimensionNameTypeCode"/>) </td>
                            </xsl:when>
                            <xsl:otherwise>
                              <td><a>
                                  <xsl:attribute name="href">#Dimensions</xsl:attribute>
                                  <xsl:value-of select="@xlink:href"/>
                                </a>
                              </td>
                            </xsl:otherwise>
                          </xsl:choose>
                          <td> <xsl:value-of select="./gmd:MD_Dimension/gmd:dimensionSize/gco:Integer"/> </td> </tr>
                      </xsl:for-each>
                    </table>
                    <b>Transform Description: </b>
                    <xsl:value-of select="./gmd:spatialRepresentationInfo/gmd:MD_Georectified/gmd:transformationDimensionDescription/gco:CharacterString"/>
                  </xsl:if>
                </td>
                <xsl:if test="count(./gmd:contentInfo)">
                  <div>
                    <a name="contentInformation"/>
                  </div>
                  <xsl:for-each select="./gmd:contentInfo">
                    <td valign="top">
                      <h2>Content Information</h2>
                      <b>
                        <xsl:value-of select="./gmd:MD_CoverageDescription/gmd:contentType/gmd:MD_CoverageContentTypeCode"/>
                      </b>
                      <table border="1" cellpadding="2" cellspacing="2">
                        <tr>
                          <th valign="top">Name</th>
                          <th valign="top">Description</th>
                          <th valign="top">Type</th>
                        </tr>
                        <xsl:for-each select="./gmd:MD_CoverageDescription/gmd:dimension">
                          <xsl:sort select=".//gmd:sequenceIdentifier/gco:MemberName/gco:aName/gco:CharacterString"/>
                          <tr>
                            <td>
                              <xsl:value-of select=".//gmd:sequenceIdentifier/gco:MemberName/gco:aName/gco:CharacterString"/>
                            </td>
                            <td>
                              <xsl:value-of select=".//gmd:descriptor/gco:CharacterString|./gmi:MI_Band/gmd:description/gco:CharacterString"/>
                            </td>
                            <td>
                              <xsl:value-of select=".//gmd:sequenceIdentifier/gco:MemberName/gco:attributeType/gco:TypeName/gco:aName/gco:CharacterString"/>
                            </td>
                          </tr>
                        </xsl:for-each>
                      </table>
                    </td>
                  </xsl:for-each>
                </xsl:if>
              </tr>
            </table>
          </xsl:for-each>
        </xsl:if>
        <xsl:if test="count(//gmi:MI_Metadata/gmd:spatialRepresentationInfo//gmd:axisDimensionProperties/gmd:MD_Dimension)">
          <xsl:variable name="numberOfDimensions" select="count(//gmi:MI_Metadata/gmd:spatialRepresentationInfo//gmd:axisDimensionProperties/gmd:MD_Dimension)"/>
          <div>
            <a name="dimensions"/>
          </div>
          <h2><xsl:value-of select="$numberOfDimensions"/> Dimensions</h2>
          <table border="1" cellpadding="2" cellspacing="2">
            <tr>
              <th valign="top">Name</th>
              <th valign="top">Size</th>
            </tr>
            <xsl:for-each select="//gmi:MI_Metadata/gmd:spatialRepresentationInfo//gmd:axisDimensionProperties/gmd:MD_Dimension">
              <tr>
                <xsl:choose>
                  <xsl:when test="@id">
                    <td><xsl:value-of select="@id"/> (<xsl:value-of select="./gmd:dimensionName/gmd:MD_DimensionNameTypeCode"/>) </td>
                  </xsl:when>
                  <xsl:otherwise>
                    <td>
                      <xsl:value-of select="@xlink:href"/>
                    </td>
                  </xsl:otherwise>
                </xsl:choose>
                <td>
                  <xsl:value-of select="./gmd:dimensionSize/gco:Integer"/>
                </td>
              </tr>
            </xsl:for-each>
          </table>
          <div style="font-size:12px">
            <a href="#responsibleParties">Responsible Parties</a> | <a href="#citationResponsibleParties">Citation Responsible Parties</a> | <a href="#boundingExtent">Bounding Extent</a> | <a href="#onlineResources">OnlineResources</a> | <a
              href="#Distributors">Distributors</a> | <a href="#Services">Services</a> | <a href="#platforms">Platforms</a> | <a href="#instruments">Instruments</a> | <a href="#operations">Operations</a><br/></div>
        </xsl:if>
        <xsl:if test="count(//gmd:EX_Extent)">
          <div>
            <a name="boundingExtent"/>
          </div>
          <h2>Extents</h2>
          <table width="95%" border="1" cellpadding="2" cellspacing="2">
            <tr>
              <th valign="top">ID</th>
              <th valign="top">Link/UUID</th>
              <th valign="top">West</th>
              <th valign="top">East</th>
              <th valign="top">South</th>
              <th valign="top">North</th>
              <th valign="top">Start</th>
              <th valign="top">End</th>
            </tr>
            <xsl:for-each select="//gmd:EX_Extent">
              <xsl:variable name="ID" select="./@id"/>
              <xsl:variable name="UUID" select="./@uuid"/>
              <xsl:variable name="Link" select="./@xlink:href"/>
              <xsl:variable name="LinkTitle" select="./@xlink:title"/>
              <xsl:variable name="Description" select="./gmd:description"/>
              <xsl:variable name="West" select="./gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:westBoundLongitude/gco:Decimal"/>
              <xsl:variable name="East" select="./gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:eastBoundLongitude/gco:Decimal"/>
              <xsl:variable name="South" select="./gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:southBoundLatitude/gco:Decimal"/>
              <xsl:variable name="North" select="./gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:northBoundLatitude/gco:Decimal"/>
              <xsl:variable name="Start" select="./gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition"/>
              <xsl:variable name="End" select="./gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:endPosition"/>
              <tr>
                <td valign="top">
                  <xsl:value-of select="$Description"/>
                  <xsl:if test="$ID">(<xsl:value-of select="$ID"/>)</xsl:if>
                </td>
                <xsl:choose>
                  <xsl:when test="$UUID">
                    <td valign="top">
                      <a>
                        <xsl:attribute name="href">
                          <xsl:value-of select="concat('http://www.ngdc.noaa.gov/docucomp/iso/',$UUID)"/>
                        </xsl:attribute>
                        <xsl:value-of select="$LinkTitle"/>
                      </a>
                    </td>
                  </xsl:when>
                  <xsl:when test="$Link">
                    <td valign="top">
                      <a>
                        <xsl:attribute name="href">
                          <xsl:value-of select="$Link"/>
                        </xsl:attribute>
                        <xsl:value-of select="$LinkTitle"/>
                      </a>
                    </td>
                  </xsl:when>
                  <xsl:otherwise>
                    <td/>
                  </xsl:otherwise>
                </xsl:choose>
                <td valign="top">
                  <xsl:value-of select="$West"/>
                </td>
                <td valign="top">
                  <xsl:value-of select="$East"/>
                </td>
                <td valign="top">
                  <xsl:value-of select="$South"/>
                </td>
                <td valign="top">
                  <xsl:value-of select="$North"/>
                </td>
                <td valign="top">
                  <xsl:value-of select="$Start"/>
                </td>
                <td valign="top">
                  <xsl:value-of select="$End"/>
                </td>
              </tr>
            </xsl:for-each>
          </table>
          <div style="font-size:12px">
            <a href="#responsibleParties">Responsible Parties</a> | <a href="#citationResponsibleParties">Citation Responsible Parties</a> | <a href="#dimensionGroups">Dimension Groups</a> | <a href="#dimensions">Dimensions</a> | <a
              href="#boundingExtent">Bounding Extent</a> | <a href="#onlineResources">OnlineResources</a> | <a href="#Distributors">Distributors</a> | <a href="#Services">Services</a> | <a href="#platforms">Platforms</a> | <a
              href="#instruments">Instruments</a> | <a href="#operations">Operations</a><br/></div>
        </xsl:if>
        <xsl:if test="count(//gmd:identificationInfo/srv:SV_ServiceIdentification)">
          <div>
            <a name="Services"/>
          </div>
          <h2>Services</h2>
          <table width="95%" border="1" cellpadding="2" cellspacing="2">
            <tr>
              <th valign="top">ID</th>
              <th valign="top">UUID</th>
              <th valign="top">Title</th>
              <th valign="top">Description</th>
              <th valign="top">Connection Point</th>
            </tr>
            <xsl:for-each select="//gmd:identificationInfo/srv:SV_ServiceIdentification/srv:containsOperations">
              <xsl:variable name="ID" select="gmd:MD_Distributor/@id"/>
              <xsl:variable name="UUID" select="gmd:MD_Distributor/@uuid"/>
              <xsl:variable name="Link" select="./@xlink:href"/>
              <xsl:variable name="LinkTitle" select="./@xlink:title"/>
              <xsl:variable name="title" select="../gmd:citation/gmd:CI_Citation/gmd:title/gco:CharacterString"/>
              <xsl:variable name="name" select="../srv:serviceType/gco:LocalName"/>
              <xsl:variable name="desc" select="./srv:SV_OperationMetadata/srv:operationName/gco:CharacterString"/>
              <xsl:variable name="linkage" select="./srv:SV_OperationMetadata/srv:connectPoint/gmd:CI_OnlineResource/gmd:linkage/gmd:URL"/>
              <tr>
                <td valign="top">
                  <xsl:value-of select="$ID"/>
                </td>
                <xsl:choose>
                  <xsl:when test="$UUID">
                    <td valign="top">
                      <a>
                        <xsl:attribute name="href">
                          <xsl:value-of select="concat('http://www.ngdc.noaa.gov/docucomp/iso/',$UUID)"/>
                        </xsl:attribute>
                        <xsl:value-of select="$UUID"/>
                      </a>
                    </td>
                  </xsl:when>
                  <xsl:when test="$Link">
                    <td valign="top">
                      <a>
                        <xsl:attribute name="href">
                          <xsl:value-of select="$Link"/>
                        </xsl:attribute>
                        <xsl:value-of select="$LinkTitle"/>
                      </a>
                    </td>
                  </xsl:when>
                  <xsl:otherwise>
                    <td/>
                  </xsl:otherwise>
                </xsl:choose>
                <td colspan="1" valign="top">
                  <xsl:value-of select="$title"/>
                </td>
                <td colspan="1" valign="top">
                  <div><xsl:value-of select="$name"/>:<xsl:value-of select="$desc"/></div>
                </td>
                <td colspan="1" valign="top">
                  <a>
                    <xsl:attribute name="href">
                      <xsl:value-of select="$linkage"/>
                    </xsl:attribute>
                    <xsl:value-of select="$linkage"/>
                  </a>
                </td>
              </tr>
            </xsl:for-each>
          </table>
          <div style="font-size:12px">
            <a href="#responsibleParties">Responsible Parties</a> | <a href="#citationResponsibleParties">Citation Responsible Parties</a> | <a href="#boundingExtent">Bounding Extent</a> | <a href="#onlineResources">OnlineResources</a> | <a
              href="#Distributors">Distributors</a> | <a href="#Services">Services</a> | <a href="#platforms">Platforms</a> | <a href="#instruments">Instruments</a> | <a href="#operations">Operations</a><br/></div>
        </xsl:if>
        <xsl:if test="count(//gmd:distributionInfo/gmd:MD_Distribution/gmd:distributor)">
          <div>
            <a name="Distributors"/>
          </div>
          <h2>Distributors</h2>
          <table width="95%" border="1" cellpadding="2" cellspacing="2">
            <tr>
              <th valign="top">ID</th>
              <th valign="top">UUID</th>
              <th valign="top">Name</th>
              <th valign="top">Description</th>
              <th valign="top">Protocol</th>
              <th valign="top">Linkage</th>
              <th valign="top">Function</th>
              <th valign="top">Application Profile</th>
            </tr>
            <xsl:for-each select="//gmd:distributionInfo/gmd:MD_Distribution/gmd:distributor">
              <xsl:variable name="ID" select="gmd:MD_Distributor/@id"/>
              <xsl:variable name="UUID" select="gmd:MD_Distributor/@uuid"/>
              <xsl:variable name="Link" select="./@xlink:href"/>
              <xsl:variable name="LinkTitle" select="./@xlink:title"/>
              <xsl:variable name="name" select=".//gmd:CI_OnlineResource/gmd:name/gco:CharacterString"/>
              <xsl:variable name="desc" select=".//gmd:CI_OnlineResource/gmd:description/gco:CharacterString"/>
              <xsl:variable name="protocol" select=".//gmd:CI_OnlineResource/gmd:protocol/gco:CharacterString"/>
              <xsl:variable name="linkage" select=".//gmd:CI_OnlineResource/gmd:linkage/gmd:URL"/>
              <xsl:variable name="function" select=".//gmd:CI_OnlineResource/gmd:function/gmd:CI_OnLineFunctionCode"/>
              <xsl:variable name="applicationProfile" select=".//gmd:CI_OnlineResource/gmd:applicationProfile/gco:CharacterString"/>
              <tr>
                <td valign="top">
                  <xsl:value-of select="$ID"/>
                </td>
                <xsl:choose>
                  <xsl:when test="$UUID">
                    <td valign="top">
                      <a>
                        <xsl:attribute name="href">
                          <xsl:value-of select="concat('http://www.ngdc.noaa.gov/docucomp/iso/',$UUID)"/>
                        </xsl:attribute>
                        <xsl:value-of select="$UUID"/>
                      </a>
                    </td>
                  </xsl:when>
                  <xsl:when test="$Link">
                    <td valign="top">
                      <a>
                        <xsl:attribute name="href">
                          <xsl:value-of select="$Link"/>
                        </xsl:attribute>
                        <xsl:value-of select="$LinkTitle"/>
                      </a>
                    </td>
                  </xsl:when>
                  <xsl:otherwise>
                    <td/>
                  </xsl:otherwise>
                </xsl:choose>
                <td colspan="1" valign="top">
                  <xsl:value-of select="$name"/>
                </td>
                <td colspan="1" valign="top">
                  <xsl:value-of select="$desc"/>
                </td>
                <td colspan="1" valign="top">
                  <xsl:value-of select="$protocol"/>
                </td>
                <td colspan="1" valign="top">
                  <a>
                    <xsl:attribute name="href">
                      <xsl:value-of select="$linkage"/>
                    </xsl:attribute>
                    <xsl:value-of select="$linkage"/>
                  </a>
                </td>
                <td colspan="1" valign="top">
                  <xsl:value-of select="$function"/>
                </td>
                <td colspan="1" valign="top">
                  <xsl:value-of select="$applicationProfile"/>
                </td>
              </tr>
            </xsl:for-each>
          </table>
          <div style="font-size:12px">
            <a href="#responsibleParties">Responsible Parties</a> | <a href="#citationResponsibleParties">Citation Responsible Parties</a> | <a href="#boundingExtent">Bounding Extent</a> | <a href="#onlineResources">OnlineResources</a> | <a
              href="#Distributors">Distributors</a> | <a href="#Services">Services</a> | <a href="#platforms">Platforms</a> | <a href="#instruments">Instruments</a> | <a href="#operations">Operations</a><br/></div>
        </xsl:if>
        <xsl:if test="count(//gmd:distributionInfo//gmd:onLine)">
          <div>
            <a name="onlineResources"/>
          </div>
          <h2>Distribution Online Resources</h2>
          <table width="95%" border="1" cellpadding="2" cellspacing="2">
            <tr>
              <th valign="top">ID</th>
              <th valign="top">UUID</th>
              <th valign="top">Name</th>
              <th valign="top">Description</th>
              <th valign="top">Protocol</th>
              <th valign="top">Linkage</th>
              <th valign="top">Function</th>
              <th valign="top">Application Profile</th>
            </tr>
            <xsl:for-each select="//gmd:distributionInfo//gmd:onLine">
              <xsl:variable name="ID" select="gmd:CI_OnlineResource/@id"/>
              <xsl:variable name="UUID" select="gmd:CI_OnlineResource/@uuid"/>
              <xsl:variable name="name" select="gmd:CI_OnlineResource/gmd:name/gco:CharacterString"/>
              <xsl:variable name="desc" select="gmd:CI_OnlineResource/gmd:description/gco:CharacterString"/>
              <xsl:variable name="protocol" select="gmd:CI_OnlineResource/gmd:protocol/gco:CharacterString"/>
              <xsl:variable name="linkage" select="gmd:CI_OnlineResource/gmd:linkage/gmd:URL"/>
              <xsl:variable name="function" select="gmd:CI_OnlineResource/gmd:function/gmd:CI_OnLineFunctionCode"/>
              <xsl:variable name="applicationProfile" select="gmd:CI_OnlineResource/gmd:applicationProfile/gco:CharacterString"/>
              <tr>
                <td valign="top">
                  <xsl:value-of select="$ID"/>
                </td>
                <td valign="top">
                  <a>
                    <xsl:attribute name="href">
                      <xsl:value-of select="concat('http://www.ngdc.noaa.gov/docucomp/iso/',$UUID)"/>
                    </xsl:attribute>
                    <xsl:value-of select="$UUID"/>
                  </a>
                </td>
                <td colspan="1" valign="top">
                  <xsl:value-of select="$name"/>
                </td>
                <td colspan="1" valign="top">
                  <xsl:value-of select="$desc"/>
                </td>
                <td colspan="1" valign="top">
                  <xsl:value-of select="$protocol"/>
                </td>
                <td colspan="1" valign="top">
                  <a>
                    <xsl:attribute name="href">
                      <xsl:value-of select="$linkage"/>
                    </xsl:attribute>
                    <xsl:value-of select="$linkage"/>
                  </a>
                </td>
                <td colspan="1" valign="top">
                  <xsl:value-of select="$function"/>
                </td>
                <td colspan="1" valign="top">
                  <xsl:value-of select="$applicationProfile"/>
                </td>
              </tr>
            </xsl:for-each>
          </table>
          <div style="font-size:12px">
            <a href="#responsibleParties">Responsible Parties</a> | <a href="#citationResponsibleParties">Citation Responsible Parties</a> | <a href="#boundingExtent">Bounding Extent</a> | <a href="#onlineResources">OnlineResources</a> | <a
              href="#Distributors">Distributors</a> | <a href="#Services">Services</a> | <a href="#platforms">Platforms</a> | <a href="#instruments">Instruments</a> | <a href="#operations">Operations</a><br/></div>
        </xsl:if>
        <xsl:if test="count(//gmi:acquisitionInformation/gmi:MI_AcquisitionInformation/gmi:platform)">
          <div>
            <a name="platforms"/>
          </div>
          <h2>Platforms</h2>
          <table width="95%" border="1" cellpadding="2" cellspacing="2">
            <tr>
              <th valign="top">ID</th>
              <th valign="top">UUID</th>
              <th valign="top">Code</th>
              <th valign="top">Description</th>
            </tr>
            <xsl:for-each select="//gmi:acquisitionInformation/gmi:MI_AcquisitionInformation/gmi:platform">
              <xsl:variable name="ID" select="gmi:MI_Platform/@id"/>
              <xsl:variable name="UUID" select="gmi:MI_Platform/@uuid"/>
              <xsl:variable name="code" select="gmi:MI_Platform/gmi:identifier/gmd:MD_Identifier/gmd:code/gco:CharacterString"/>
              <xsl:variable name="desc" select="gmi:MI_Platform/gmi:description/gco:CharacterString"/>
              <tr>
                <td valign="top">
                  <xsl:value-of select="$ID"/>
                </td>
                <td valign="top">
                  <a>
                    <xsl:attribute name="href">
                      <xsl:value-of select="concat('http://www.ngdc.noaa.gov/docucomp/iso/',$UUID)"/>
                    </xsl:attribute>
                    <xsl:value-of select="$UUID"/>
                  </a>
                </td>
                <td colspan="1" valign="top">
                  <xsl:value-of select="$code"/>
                </td>
                <td colspan="1" valign="top">
                  <xsl:value-of select="$desc"/>
                </td>
              </tr>
            </xsl:for-each>
          </table>
          <div style="font-size:12px"><a href="#responsibleParties">Responsible Parties</a> | <a href="#citationResponsibleParties">Citation Responsible Parties</a> | <a href="#boundingExtent">Bounding Extent</a> | <a
              href="#onlineResources">OnlineResources</a> | <a href="#Distributors">Distributors</a> | <a href="#Services">Services</a> | <a href="#platforms">Platforms</a> | <a href="#instruments">Instruments</a> | <a href="#operations"
              >Operations</a><br/></div>
        </xsl:if>
        <xsl:if test="count(//gmi:acquisitionInformation/gmi:MI_AcquisitionInformation/gmi:instrument)">
          <div>
            <a name="instruments"/>
          </div>
          <h2>Instruments</h2>
          <table width="95%" border="1" cellpadding="2" cellspacing="2">
            <tr>
              <th valign="top">ID</th>
              <th valign="top">UUID</th>
              <th valign="top">Code</th>
              <th valign="top">Type</th>
              <th valign="top">Description</th>
            </tr>
            <xsl:for-each select="//gmi:acquisitionInformation/gmi:MI_AcquisitionInformation/gmi:instrument">
              <xsl:variable name="ID" select="gmi:MI_Instrument/@id"/>
              <xsl:variable name="UUID" select="gmi:MI_Instrument/@uuid"/>
              <xsl:variable name="code" select="gmi:MI_Instrument/gmi:identifier/gmd:MD_Identifier/gmd:code/gco:CharacterString"/>
              <xsl:variable name="type" select="gmi:MI_Instrument/gmi:type/gco:CharacterString"/>
              <xsl:variable name="desc" select="gmi:MI_Instrument/gmi:description/gco:CharacterString"/>
              <tr>
                <td valign="top">
                  <xsl:value-of select="$ID"/>
                </td>
                <td valign="top">
                  <a>
                    <xsl:attribute name="href">
                      <xsl:value-of select="concat('http://www.ngdc.noaa.gov/docucomp/iso/',$UUID)"/>
                    </xsl:attribute>
                    <xsl:value-of select="$UUID"/>
                  </a>
                </td>
                <td colspan="1" valign="top">
                  <xsl:value-of select="$code"/>
                </td>
                <td colspan="1" valign="top">
                  <xsl:value-of select="$type"/>
                </td>
                <td colspan="1" valign="top">
                  <xsl:value-of select="$desc"/>
                </td>
              </tr>
            </xsl:for-each>
          </table>
          <div style="font-size:12px"><a href="#responsibleParties">Responsible Parties</a> | <a href="#citationResponsibleParties">Citation Responsible Parties</a> | <a href="#boundingExtent">Bounding Extent</a> | <a
              href="#onlineResources">OnlineResources</a> | <a href="#Distributors">Distributors</a> | <a href="#Services">Services</a> | <a href="#platforms">Platforms</a> | <a href="#instruments">Instruments</a> | <a href="#operations"
              >Operations</a><br/></div>
        </xsl:if>
        <xsl:if test="count(//gmi:acquisitionInformation/gmi:MI_AcquisitionInformation/gmi:operation)">
          <div>
            <a name="operations"/>
          </div>
          <h2>Operations</h2>
          <table width="95%" border="1" cellpadding="2" cellspacing="2">
            <tr>
              <th valign="top">UUID</th>
              <th valign="top">Code</th>
              <th valign="top">Type</th>
              <th valign="top">Status</th>
              <th valign="top">Description</th>
            </tr>
            <xsl:for-each select="//gmi:acquisitionInformation/gmi:MI_AcquisitionInformation/gmi:operation">
              <xsl:variable name="UUID" select="gmi:MI_Operation/@id"/>
              <xsl:variable name="code" select="gmi:MI_Operation/gmi:identifier/gmd:MD_Identifier/gmd:code/gco:CharacterString"/>
              <xsl:variable name="type" select="gmi:MI_Operation/gmi:type/gco:CharacterString"/>
              <xsl:variable name="status" select="gmi:MI_Operation/gmi:status"/>
              <xsl:variable name="desc" select="gmi:MI_Operation/gmi:description/gco:CharacterString"/>
              <tr>
                <td valign="top">
                  <a>
                    <xsl:attribute name="href">
                      <xsl:value-of select="concat('http://www.ngdc.noaa.gov/docucomp/iso/',$UUID)"/>
                    </xsl:attribute>
                    <xsl:value-of select="$UUID"/>
                  </a>
                </td>
                <td colspan="1" valign="top">
                  <xsl:value-of select="$code"/>
                </td>
                <td colspan="1" valign="top">
                  <xsl:value-of select="$type"/>
                </td>
                <td colspan="1" valign="top">
                  <xsl:value-of select="$status"/>
                </td>
                <td colspan="1" valign="top">
                  <xsl:value-of select="$desc"/>
                </td>
              </tr>
            </xsl:for-each>
          </table>
          <div style="font-size:12px"><a href="#responsibleParties">Responsible Parties</a> | <a href="#citationResponsibleParties">Citation Responsible Parties</a> | <a href="#boundingExtent">Bounding Extent</a> | <a
              href="#onlineResources">OnlineResources</a> | <a href="#Distributors">Distributors</a> | <a href="#Services">Services</a> | <a href="#platforms">Platforms</a> | <a href="#instruments">Instruments</a> | <a href="#operations"
              >Operations</a><br/></div>
        </xsl:if>
        <hr/>
        <i><xsl:value-of select="$transformName"/>:Version <xsl:value-of select="$transformVersion"/></i>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>
