<?xml version="1.0" encoding="UTF-8" ?>

<!--
   Name:   CI_PresentationFormCode.xsl
   Author:  Matthew J. McCready
   Date:  20110608
   Description:  XSLT stylesheet that transforms the value in the  citation/citeinfo/geoform (Geospatial Data Presentation Form) element into
  the correct CI_PresentationFormCode codeList value ,which can be found of page 93 of the ISO standard, for the gmd:CI_PresentationFormCode ISO element and the 
 codeListValue and codeSpace attributes. This stylesheet is called by the 11_gmd:identificationInfo.xsl
   Modification History:
      Initial   Date      Change Request ID   Description

-->


<!-- <xsl:import href="../IsoSchema/18_gmdTemplate1.xsl"/> -->

<!-- <xsl:include href="../IsoSchema/18_gmdTemplate1.xsl"/>
<xsl:import href="../IsoSchema/19_gmdTemplate2.xsl"/>
<xsl:import href="../IsoSchema/20_gmdTemplate3.xsl"/>
<xsl:import href="../IsoSchema/21_gmdTemplate4.xsl"/>
<xsl:import href="../IsoSchema/22_gmdFunctions.xsl"/> -->


<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" 
>
<xsl:output method="xml" version="1.0" encoding="ISO-8859-1" indent="yes"/>
<xsl:variable name ="MetDate"   select= "//metadata/metainfo/metd"/>
<!-- <xsl:variable name="SDTSPntVot" select="//metadata/spdoinfo/ptvctinf/sdtsterm/sdtstype"/> -->



<xsl:template name="CI_PresentationFormCode">
<xsl:variable name="PresentationFormCode" select="metadata/idinfo/citation/citeinfo/geoform"/>
<xsl:choose>
<xsl:when test="$PresentationFormCode='atlas'">
	<xsl:element name="gmd:presentationForm">
		<xsl:element name="gmd:CI_PresentationFormCode">
			<xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_PresentationFormCode</xsl:attribute>
			<xsl:attribute name="codeListValue">mapHardcopy </xsl:attribute>
			<xsl:attribute name="codeSpace">006 </xsl:attribute>
                         mapHardcopy
		</xsl:element><!-- gmd:CI_PresentationFormCode -->
	</xsl:element><!-- gmd:presentationForm -->
</xsl:when>
<xsl:when test="$PresentationFormCode='audio'">
        <xsl:element name="gmd:presentationForm">
                <xsl:element name="gmd:CI_PresentationFormCode">
                        <xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_PresentationFormCode</xsl:attribute>
                        <xsl:attribute name="codeListValue">documentDigital</xsl:attribute>
                        <xsl:attribute name="codeSpace">001 </xsl:attribute>
                         documentDigital
                </xsl:element><!-- gmd:CI_PresentationFormCode -->
        </xsl:element><!-- gmd:presentationForm -->
</xsl:when>
<xsl:when test="$PresentationFormCode='diagram'">
        <xsl:element name="gmd:presentationForm">
                <xsl:element name="gmd:CI_PresentationFormCode">
                        <xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_PresentationFormCode</xsl:attribute>
                        <xsl:attribute name="codeListValue">documentDigital</xsl:attribute>
                        <xsl:attribute name="codeSpace">001 </xsl:attribute>
                           documentDigital
                </xsl:element><!-- gmd:CI_PresentationFormCode -->
        </xsl:element><!-- gmd:presentationForm -->
</xsl:when>
<xsl:when test="$PresentationFormCode='document'">
        <xsl:element name="gmd:presentationForm">
                <xsl:element name="gmd:CI_PresentationFormCode">
                        <xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_PresentationFormCode</xsl:attribute>
                        <xsl:attribute name="codeListValue">documentDigital</xsl:attribute>
                        <xsl:attribute name="codeSpace">001 </xsl:attribute>
                          documentDigital
                </xsl:element><!-- gmd:CI_PresentationFormCode -->
        </xsl:element><!-- gmd:presentationForm -->
</xsl:when>
<xsl:when test="$PresentationFormCode='globe'">
        <xsl:element name="gmd:presentationForm">
                <xsl:element name="gmd:CI_PresentationFormCode">
                        <xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_PresentationFormCode</xsl:attribute>
                        <xsl:attribute name="codeListValue">documentHardcopy</xsl:attribute>
                        <xsl:attribute name="codeSpace">002 </xsl:attribute>
                                     documentHardcopy
                </xsl:element><!-- gmd:CI_PresentationFormCode -->
        </xsl:element><!-- gmd:presentationForm -->
</xsl:when>
<xsl:when test="$PresentationFormCode='map'">
        <xsl:element name="gmd:presentationForm">
                <xsl:element name="gmd:CI_PresentationFormCode">
                        <xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_PresentationFormCode</xsl:attribute>
                        <xsl:attribute name="codeListValue">mapDigital</xsl:attribute>
                        <xsl:attribute name="codeSpace">005</xsl:attribute>
                            mapDigital
                </xsl:element><!-- gmd:CI_PresentationFormCode -->
        </xsl:element><!-- gmd:presentationForm -->
</xsl:when>
<xsl:when test="$PresentationFormCode='printed map'">
        <xsl:element name="gmd:presentationForm">
                <xsl:element name="gmd:CI_PresentationFormCode">
                        <xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_PresentationFormCode</xsl:attribute>
                        <xsl:attribute name="codeListValue">mapHardcopy </xsl:attribute>
                        <xsl:attribute name="codeSpace">006 </xsl:attribute>
                            mapHardcopy
                </xsl:element><!-- gmd:CI_PresentationFormCode -->
        </xsl:element><!-- gmd:presentationForm -->
</xsl:when>
<xsl:when test="$PresentationFormCode='model'">
        <xsl:element name="gmd:presentationForm">
                <xsl:element name="gmd:CI_PresentationFormCode">
                        <xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_PresentationFormCode</xsl:attribute>
                        <xsl:attribute name="codeListValue">modelDigital</xsl:attribute>
                        <xsl:attribute name="codeSpace">007 </xsl:attribute>
                                    modelDigital
                </xsl:element><!-- gmd:CI_PresentationFormCode -->
        </xsl:element><!-- gmd:presentationForm -->
</xsl:when>
<xsl:when test="$PresentationFormCode='physical model'">
        <xsl:element name="gmd:presentationForm">
                <xsl:element name="gmd:CI_PresentationFormCode">
                        <xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_PresentationFormCode</xsl:attribute>
                        <xsl:attribute name="codeListValue">mapHardcopy </xsl:attribute>
                        <xsl:attribute name="codeSpace">006 </xsl:attribute>
                                  mapHardcopy
                </xsl:element><!-- gmd:CI_PresentationFormCode -->
        </xsl:element><!-- gmd:presentationForm -->
</xsl:when>
<xsl:when test="$PresentationFormCode='multimedia presentation'">
        <xsl:element name="gmd:presentationForm">
                <xsl:element name="gmd:CI_PresentationFormCode">
                        <xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_PresentationFormCode</xsl:attribute>
                        <xsl:attribute name="codeListValue">imageDigital</xsl:attribute>
                        <xsl:attribute name="codeSpace">003 </xsl:attribute>
                                imageDigital
                </xsl:element><!-- gmd:CI_PresentationFormCode -->
        </xsl:element><!-- gmd:presentationForm -->
</xsl:when>
<xsl:when test="$PresentationFormCode='profile'">
        <xsl:element name="gmd:presentationForm">
                <xsl:element name="gmd:CI_PresentationFormCode">
                        <xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_PresentationFormCode</xsl:attribute>
                        <xsl:attribute name="codeListValue">profileDigital</xsl:attribute>
                        <xsl:attribute name="codeSpace">009</xsl:attribute>
                              profileDigital
                </xsl:element><!-- gmd:CI_PresentationFormCode -->
        </xsl:element><!-- gmd:presentationForm -->
</xsl:when>
<xsl:when test="$PresentationFormCode='cross-section'">
        <xsl:element name="gmd:presentationForm">
                <xsl:element name="gmd:CI_PresentationFormCode">
                        <xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_PresentationFormCode</xsl:attribute>
                        <xsl:attribute name="codeListValue">profileHardcopy</xsl:attribute>
                        <xsl:attribute name="codeSpace">010</xsl:attribute>
                                     profileHardcopy
                </xsl:element><!-- gmd:CI_PresentationFormCode -->
        </xsl:element><!-- gmd:presentationForm -->
</xsl:when>
<xsl:when test="$PresentationFormCode='raster digital data'">
        <xsl:element name="gmd:presentationForm">
                <xsl:element name="gmd:CI_PresentationFormCode">
                        <xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_PresentationFormCode</xsl:attribute>
                        <xsl:attribute name="codeListValue">mapDigital</xsl:attribute>
                        <xsl:attribute name="codeSpace">005</xsl:attribute>
                              mapDigital
                </xsl:element><!-- gmd:CI_PresentationFormCode -->
        </xsl:element><!-- gmd:presentationForm -->
</xsl:when>
<xsl:when test="$PresentationFormCode='remote-sensing image'">
        <xsl:element name="gmd:presentationForm">
                <xsl:element name="gmd:CI_PresentationFormCode">
                        <xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_PresentationFormCode</xsl:attribute>
                        <xsl:attribute name="codeListValue">imageDigital</xsl:attribute>
                        <xsl:attribute name="codeSpace">003 </xsl:attribute>
                          imageDigital
                </xsl:element><!-- gmd:CI_PresentationFormCode -->
        </xsl:element><!-- gmd:presentationForm -->
</xsl:when>
<xsl:when test="$PresentationFormCode='section'">
        <xsl:element name="gmd:presentationForm">
                <xsl:element name="gmd:CI_PresentationFormCode">
                        <xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_PresentationFormCode</xsl:attribute>
                        <xsl:attribute name="codeListValue">profileHardcopy</xsl:attribute>
                        <xsl:attribute name="codeSpace">010</xsl:attribute>
                              profileHardcopy
                </xsl:element><!-- gmd:CI_PresentationFormCode -->
        </xsl:element><!-- gmd:presentationForm -->
</xsl:when>
<xsl:when test="$PresentationFormCode='spreadsheet'">
        <xsl:element name="gmd:presentationForm">
                <xsl:element name="gmd:CI_PresentationFormCode">
                        <xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_PresentationFormCode</xsl:attribute>
                        <xsl:attribute name="codeListValue">tableDigital</xsl:attribute>
                        <xsl:attribute name="codeSpace">011</xsl:attribute>
                          tableDigital
                </xsl:element><!-- gmd:CI_PresentationFormCode -->
        </xsl:element><!-- gmd:presentationForm -->
</xsl:when>
<xsl:when test="$PresentationFormCode='tabular digital data'">
        <xsl:element name="gmd:presentationForm">
                <xsl:element name="gmd:CI_PresentationFormCode">
                        <xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_PresentationFormCode</xsl:attribute>
                        <xsl:attribute name="codeListValue">tableDigital</xsl:attribute>
                        <xsl:attribute name="codeSpace">011</xsl:attribute>
                                tableDigital
                </xsl:element><!-- gmd:CI_PresentationFormCode -->
        </xsl:element><!-- gmd:presentationForm -->
</xsl:when>
<xsl:when test="$PresentationFormCode='vector digital data'">
        <xsl:element name="gmd:presentationForm">
                <xsl:element name="gmd:CI_PresentationFormCode">
                        <xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_PresentationFormCode</xsl:attribute>
                        <xsl:attribute name="codeListValue">mapDigital</xsl:attribute>
                        <xsl:attribute name="codeSpace">005</xsl:attribute>
                                    mapDigital
                </xsl:element><!-- gmd:CI_PresentationFormCode -->
        </xsl:element><!-- gmd:presentationForm -->
</xsl:when>
<xsl:when test="$PresentationFormCode='video'">
        <xsl:element name="gmd:presentationForm">
                <xsl:element name="gmd:CI_PresentationFormCode">
                        <xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_PresentationFormCode</xsl:attribute>
                        <xsl:attribute name="codeListValue">videoDigital</xsl:attribute>
                        <xsl:attribute name="codeSpace">013</xsl:attribute>
                                     videoDigital
                </xsl:element><!-- gmd:CI_PresentationFormCode -->
        </xsl:element><!-- gmd:presentationForm -->
</xsl:when>
<xsl:when test="$PresentationFormCode='view'">
        <xsl:element name="gmd:presentationForm">
                <xsl:element name="gmd:CI_PresentationFormCode">
                        <xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_PresentationFormCode</xsl:attribute>
                        <xsl:attribute name="codeListValue">imageDigital</xsl:attribute>
                        <xsl:attribute name="codeSpace">003</xsl:attribute>
                                imageDigital
                </xsl:element><!-- gmd:CI_PresentationFormCode -->
        </xsl:element><!-- gmd:presentationForm -->
</xsl:when>
<xsl:when test="$PresentationFormCode='database'">
        <xsl:element name="gmd:presentationForm">
                <xsl:element name="gmd:CI_PresentationFormCode">
                        <xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_PresentationFormCode</xsl:attribute>
                        <xsl:attribute name="codeListValue">documentDigital</xsl:attribute>
                        <xsl:attribute name="codeSpace">001</xsl:attribute>
                                  documentDigital
                </xsl:element><!-- gmd:CI_PresentationFormCode -->
        </xsl:element><!-- gmd:presentationForm -->
</xsl:when>

</xsl:choose>
</xsl:template>
</xsl:stylesheet>
