<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version = "1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="ISO-8859-1" indent="yes"/>

<xsl:template name="spref" match="/">

<xsl:if test="//spref" >

<xsl:if test="//spref/horizsys/geograph/latres">
<xsl:element name="Latitude_Resolution"> <!-- mif name -->
<xsl:apply-templates select="//spref/horizsys/geograph/latres"/> <!-- FGDC path -->
</xsl:element>

<xsl:element name="Longitude_Resolution"> <!-- mif name -->
<xsl:apply-templates select="//spref/horizsys/geograph/longres"/> <!-- FGDC path -->
</xsl:element>

<xsl:element name="Geographic_Coordinate_Units"> <!-- mif name -->
<xsl:apply-templates select="//spref/horizsys/geograph/geogunit"/> <!-- FGDC path -->
</xsl:element>
</xsl:if>

<xsl:if test="//spref/horizsys/local">

<xsl:element name="Local_Description"> <!-- mif name -->
<xsl:apply-templates select="//spref/horizsys/local/localdes"/> <!-- FGDC path -->
</xsl:element>

<xsl:element name="Local_Georeference_Information"> <!-- mif name -->
<xsl:apply-templates select="//spref/horizsys/local/localgeo"/> <!-- FGDC path -->
</xsl:element>

</xsl:if> <!-- -->


<xsl:if test="//spref/horizsys/planar">
<xsl:if test="//spref/horizsys/planar/mapproj">

<xsl:element name="Map_Projection_Name"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/mapprojn"/> 
</xsl:element>

<xsl:if test="//spref/horizsys/planar/mapproj/albers">
<xsl:for-each select="//spref/horizsys/planar/mapproj/albers/stdparll">
<xsl:element name="Standard_Parallel"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="."/> 
</xsl:element>
</xsl:for-each>

<xsl:element name="Longitude_of_Central_Meridian"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/albers/longcm"/> 
</xsl:element>

<xsl:element name="Latitude_of_Projection_Origin"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/albers/latprjo"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/albers/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/albers/fnorth"/> 
</xsl:element>
</xsl:if><!--albers -->

<xsl:if test="//spref/horizsys/planar/mapproj/azimequi">

<xsl:element name="Longitude_of_Central_Meridian"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/azimequi/longcm"/> 
</xsl:element>

<xsl:element name="Latitude_of_Projection_Origin"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/azimequi/latprjo"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/azimequi/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/azimequi/fnorth"/> 
</xsl:element>

</xsl:if><!--azimequi -->

<xsl:if test="//spref/horizsys/planar/mapproj/equicon">

<xsl:for-each select="//spref/horizsys/planar/mapproj/equicon/stdparll">
<xsl:element name="Standard_Parallel"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="."/> 
</xsl:element>
</xsl:for-each>

<xsl:element name="Longitude_of_Central_Meridian"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/equicon/longcm"/> 
</xsl:element>

<xsl:element name="Latitude_of_Projection_Origin"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/equicon/latprjo"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/equicon/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/equicon/fnorth"/> 
</xsl:element>

</xsl:if><!--equicon -->

<xsl:if test="//spref/horizsys/planar/mapproj/equirect">

<xsl:element name="Standard_Parallel"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/equirect/stdparll"/> 
</xsl:element>

<xsl:element name="Longitude_of_Central_Meridian"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/equirect/longcm"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/equirect/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/equirect/fnorth"/> 
</xsl:element>

</xsl:if><!--equirect -->

<xsl:if test="//spref/horizsys/planar/mapproj/gvnsp">

<xsl:element name="Height_of_Perspective_Point_Above_Surface"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/gvnsp/heightpt"/> 
</xsl:element>

<xsl:element name="Longitude_of_Projection_Center"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/gvnsp/longpc"/> 
</xsl:element>

<!-- Longitude_of_Projection_Center -->
<xsl:element name="Latitude_of_Projection_Center"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/gvnsp/latprjc"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/gvnsp/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/gvnsp/fnorth"/> 
</xsl:element>

</xsl:if><!-- centgvnsp -->

<xsl:if test="//spref/horizsys/planar/mapproj/gnomonic">

<xsl:element name="Longitude_of_Projection_Center"> 
<xsl:attribute name="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/gnomonic/longpc"/> 
</xsl:element>

<!-- Longitude_of_Projection_Center -->
<xsl:element name="Latitude_of_Projection_Center"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/gnomonic/latprjc"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/gnomonic/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/gnomonic/fnorth"/> 
</xsl:element>

</xsl:if><!--gnomonic -->

<xsl:if test="//spref/horizsys/planar/mapproj/lamberta">

<xsl:element name="Longitude_of_Projection_Center">
<xsl:attribute name="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/lamberta/longpc"/> 
</xsl:element>

<xsl:element name="Latitude_of_Projection_Center">
<xsl:attribute name="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/lamberta/latprjc"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/lamberta/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/lamberta/fnorth"/> 
</xsl:element>

</xsl:if><!-- lamberta -->

<xsl:if test="//spref/horizsys/planar/mapproj/lambertc">

<xsl:for-each select="//spref/horizsys/planar/mapproj/lambertc/stdparll">
<xsl:element name="Standard_Parallel"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="."/> 
</xsl:element>
</xsl:for-each>

<xsl:element name="Longitude_of_Central_Meridian"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/lambertc/longcm"/> 
</xsl:element>

<xsl:element name="Latitude_of_Projection_Origin"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/lambertc/latprjo"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/lambertc/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/lambertc/fnorth"/> 
</xsl:element>

</xsl:if><!-- lambertc -->

<xsl:if test="//spref/horizsys/planar/mapproj/mercator">

<xsl:if test="//spref/horizsys/planar/mapproj/mercator/stdparll">
<xsl:element name="Standard_Parallel"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/mercator/stdparll"/> 
</xsl:element>
</xsl:if>

<xsl:if test="//spref/horizsys/planar/mapproj/mercator/sfequat">
<xsl:element name="Scale_Factor_at_Equator"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/mercator/sfequat"/> 
</xsl:element>
</xsl:if>

<xsl:element name="Longitude_of_Central_Meridian"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/mercator/longcm"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/mercator/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/mercator/fnorth"/> 
</xsl:element>

</xsl:if><!-- mercator -->

<xsl:if test="//spref/horizsys/planar/mapproj/modsak">

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/modsak/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/modsak/fnorth"/> 
</xsl:element>

</xsl:if><!-- modsak -->

<xsl:if test="//spref/horizsys/planar/mapproj/miller">

<xsl:element name="Longitude_of_Central_Meridian"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/miller/longcm"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/miller/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/miller/fnorth"/> 
</xsl:element>

</xsl:if><!-- miller -->

<xsl:if test="//spref/horizsys/planar/mapproj/obqmerc">

<xsl:element name="Scale_Factor_at_Center_Line"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/obqmerc/sfctrlin"/> 
</xsl:element>

<xsl:if test="//spref/horizsys/planar/mapproj/obqmerc/obqlazim">
<xsl:element name="Azimuthal_Angle"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/obqmerc/obqlazim/azimangl"/> 
</xsl:element>

<xsl:element name="Azimuth_Measure_Point_Longitude"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/obqmerc/obqlazim/azimptl"/> 
</xsl:element>
</xsl:if>

<xsl:if test="//spref/horizsys/planar/mapproj/obqmerc/obqlpt">
<xsl:for-each select="//spref/horizsys/planar/mapproj/obqmerc/obqlpt/obqllat">
<xsl:element name="Oblique_Line_Latitude"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="."/> 
</xsl:element>
</xsl:for-each>

<xsl:for-each select="//spref/horizsys/planar/mapproj/obqmerc/obqlpt/obqllong">
<xsl:element name="Oblique_Line_Longitude"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="."/> 
</xsl:element>
</xsl:for-each>
</xsl:if> <!-- obqlpt -->

<xsl:element name="Latitude_of_Projection_Origin"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/obqmerc/latprjo"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/obqmerc/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/obqmerc/fnorth"/> 
</xsl:element>

</xsl:if><!--obqmerc -->

<xsl:if test="//spref/horizsys/planar/mapproj/orthogr">

<xsl:element name="Longitude_of_Projection_Center">
<xsl:attribute name="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/orthogr/longpc"/> 
</xsl:element>

<xsl:element name="Latitude_of_Projection_Center">
<xsl:attribute name="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/orthogr/latprjc"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/orthogr/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/orthogr/fnorth"/> 
</xsl:element>

</xsl:if><!--orthogr -->

<xsl:if test="//spref/horizsys/planar/mapproj/polarst">

<xsl:element name="Straight_Verticle_Longitude_from_Pole"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/polarst/svlong"/> 
</xsl:element>

<xsl:if test="//spref/horizsys/planar/mapproj/polarst/stdparll">
<xsl:element name="Standard_Parallel"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/polarst/stdparll"/> 
</xsl:element>
</xsl:if>

<xsl:if test="//spref/horizsys/planar/mapproj/polarst/sfprjorg">
<xsl:element name="Scale_Factor_at_Projection_Origin"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/polarst/sfprjorg"/> 
</xsl:element>
</xsl:if>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/polarst/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/polarst/fnorth"/> 
</xsl:element>

</xsl:if><!--polarst -->

<xsl:if test="//spref/horizsys/planar/mapproj/polycon">

<xsl:element name="Longitude_of_Central_Meridian"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/polycon/longcm"/> 
</xsl:element>

<xsl:element name="Latitude_of_Projection_Origin"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/polycon/latprjo"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/polycon/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/polycon/fnorth"/> 
</xsl:element>

</xsl:if><!--polycon -->

<xsl:if test="//spref/horizsys/planar/mapproj/robinson">

<xsl:element name="Longitude_of_Projection_Center">
<xsl:attribute name="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/robinson/longpc"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/robinson/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/robinson/fnorth"/> 
</xsl:element>

</xsl:if><!--robinson -->

<xsl:if test="//spref/horizsys/planar/mapproj/sinusoid">

<xsl:element name="Longitude_of_Central_Meridian"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/sinusoid/longcm"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/sinusoid/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/sinusoid/fnorth"/> 
</xsl:element>

</xsl:if><!--robinson -->

<xsl:if test="//spref/horizsys/planar/mapproj/spaceobq">

<xsl:element name="Landsat_Number"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/spaceobq/landsat"/> 
</xsl:element>

<xsl:element name="Path_Number"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/spaceobq/pathnum"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/spaceobq/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/spaceobq/fnorth"/> 
</xsl:element>

</xsl:if><!--spaceobq -->

<xsl:if test="//spref/horizsys/planar/mapproj/stereo">

<xsl:element name="Longitude_of_Projection_Center">
<xsl:attribute name="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/stereo/longpc"/> 
</xsl:element>

<xsl:element name="Latitude_of_Projection_Center">
<xsl:attribute name="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/stereo/latprjc"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/stereo/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/stereo/fnorth"/> 
</xsl:element>

</xsl:if><!-- stereo -->

<xsl:if test="//spref/horizsys/planar/mapproj/transmer">

<xsl:element name="Scale_Factor_at_Central_Meridian">
<xsl:attribute name="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/transmer/sfctrmer"/> 
</xsl:element>

<xsl:element name="Longitude_of_Central_Meridian">
<xsl:attribute name="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/transmer/longcm"/> 
</xsl:element>

<xsl:element name="Latitude_of_Projection_Origin">
<xsl:attribute name="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/transmer/latprjo"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/transmer/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/transmer/fnorth"/> 
</xsl:element>

</xsl:if><!-- transmer -->

<xsl:if test="//spref/horizsys/planar/mapproj/vdgrin">

<xsl:element name="Longitude_of_Central_Meridian"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/vdgrin/longcm"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/vdgrin/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/vdgrin/fnorth"/> 
</xsl:element>

</xsl:if><!-- vdgrin -->

<xsl:if test="//spref/horizsys/planar/mapproj/mapprojp">

<xsl:element name="Other_Projections_Definition"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/mapproj/mapprojp/otherprj"/> 
</xsl:element>

</xsl:if><!-- vdgrin -->

</xsl:if><!--mapproj -->

<xsl:if test="//spref/horizsys/planar/gridsys">

<xsl:element name="Grid_Coordinate_System_Name"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/gridsysn"/> 
</xsl:element>

<xsl:if test="//spref/horizsys/planar/gridsys/utm">

<xsl:element name="UTM_Zone_Number"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/utm/utmzone"/> 
</xsl:element>

<xsl:element name="Map_Projection_Name"> 
<xsl:attribute name ="gid1">1</xsl:attribute>Transverse Mercator</xsl:element>

<xsl:element name="Scale_Factor_at_Central_Meridian"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/utm/transmer/sfctrmer"/> 
</xsl:element>

<xsl:element name="Longitude_of_Central_Meridian"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/utm/transmer/longcm"/> 
</xsl:element>

<xsl:element name="Latitude_of_Projection_Origin"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/utm/transmer/latprjo"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/utm/transmer/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/utm/transmer/fnorth"/> 
</xsl:element>

</xsl:if><!-- utm -->

<xsl:if test="//spref/horizsys/planar/gridsys/arcsys">

<xsl:element name="ARC_System_Zone_Identifier"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/arcsys/arczone"/> 
</xsl:element>

<xsl:if test="//spref/horizsys/planar/gridsys/arcsys/equirect">
<xsl:element name="Map_Projection_Name"> 
<xsl:attribute name ="gid1">1</xsl:attribute>Equirectangular</xsl:element>

<xsl:element name="Standard_Parallel"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/arcsys/equirect/stdparll"/> 
</xsl:element>

<xsl:element name="Longitude_of_Central_Meridian"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/arcsys/equirect/longcm"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/arcsys/equirect/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/arcsys/equirect/fnorth"/> 
</xsl:element>

</xsl:if><!-- equirect -->

<xsl:if test="//spref/horizsys/planar/gridsys/arcsys/azimequi">
<xsl:element name="Map_Projection_Name"> 
<xsl:attribute name ="gid1">1</xsl:attribute>Azimuthal Equidistant</xsl:element>

<xsl:element name="Longitude_of_Central_Meridian"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/arcsys/azimequi/longcm"/> 
</xsl:element>

<xsl:element name="Latitude_of_Projection_Origin"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/arcsys/azimequi/longcm"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/arcsys/azimequi/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/arcsys/azimequi/fnorth"/> 
</xsl:element>
</xsl:if><!-- azimequi -->

</xsl:if><!-- arcsys -->

<xsl:if test="//spref/horizsys/planar/gridsys/othergrd">

<xsl:element name="Other_Grid_Systems_Definition"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/othergrd"/> 
</xsl:element>

</xsl:if><!-- othergrd -->

<xsl:if test="//spref/horizsys/planar/gridsys/ups">

<xsl:element name="UPS_Zone_Identifier"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/ups/upszone"/> 
</xsl:element>

<xsl:element name="Map_Projection_Name"> 
<xsl:attribute name ="gid1">1</xsl:attribute>Polar Stereographic</xsl:element>

<xsl:element name="Straight_Verticle_Longitude_from_Pole"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/ups/polarst/svlong"/> 
</xsl:element>

<xsl:if test="//spref/horizsys/planar/gridsys/ups/polarst/stdparll">
<xsl:element name="Standard_Parallel"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/ups/polarst/stdparll"/> 
</xsl:element>
</xsl:if><!-- stdparll -->

<xsl:if test="//spref/horizsys/planar/gridsys/ups/polarst/sfprjorg">
<xsl:element name="Scale_Factor_at_Projection_Origin"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/ups/polarst/sfprjorg"/> 
</xsl:element>
</xsl:if><!-- stdparll -->

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/ups/polarst/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/ups/polarst/fnorth"/> 
</xsl:element>

</xsl:if><!-- ups -->

<xsl:if test="//spref/horizsys/planar/gridsys/spcs">

<xsl:element name="SPCS_Zone_Identifier"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/spcs/spcszone"/> 
</xsl:element>


<xsl:if test="//spref/horizsys/planar/gridsys/spcs/lambertc">
<xsl:element name="Map_Projection_Name"> 
<xsl:attribute name ="gid1">1</xsl:attribute>Lambert Conformal Conic</xsl:element>

<xsl:for-each select="//spref/horizsys/planar/gridsys/spcs/lambertc/stdparll">
<xsl:element name="Standard_Parallel"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="."/> 
</xsl:element>
</xsl:for-each>

<xsl:element name="Longitude_of_Central_Meridian"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/spcs/lambertc/longcm"/> 
</xsl:element>

<xsl:element name="Latitude_of_Projection_Origin"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/spcs/lambertc/latprjo"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/spcs/lambertc/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/spcs/lambertc/fnorth"/> 
</xsl:element>
</xsl:if><!-- lambertc -->


<xsl:if test="//spref/horizsys/planar/gridsys/spcs/transmer">
<xsl:element name="Map_Projection_Name"> 
<xsl:attribute name ="gid1">1</xsl:attribute>Transverse Mercator</xsl:element>

<xsl:element name="Scale_Factor_at_Central_Meridian"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/spcs/transmer/sfctrmer"/> 
</xsl:element>

<xsl:element name="Longitude_of_Central_Meridian"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/spcs/transmer/longcm"/> 
</xsl:element>

<xsl:element name="Latitude_of_Projection_Origin"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/spcs/transmer/latprjo"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/spcs/transmer/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/spcs/transmer/fnorth"/> 
</xsl:element>

</xsl:if><!-- transmer -->

<xsl:if test="//spref/horizsys/planar/gridsys/spcs/obqmerc">
<xsl:element name="Map_Projection_Name"> 
<xsl:attribute name ="gid1">1</xsl:attribute>Oblique Mercator</xsl:element>

<xsl:element name="Scale_Factor_at_Center_Line"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/spcs/obqmerc/sfctrlin"/> 
</xsl:element>

<xsl:if test="//spref/horizsys/planar/gridsys/spcs/obqmerc/obqlazim">

<xsl:element name="Azimuthal_Angle"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/spcs/obqmerc/obqlazim/azimangl"/> 
</xsl:element>

<xsl:element name="Azimuth_Measure_Point_Longitude"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/spcs/obqmerc/obqlazim/azimptl"/> 
</xsl:element>
</xsl:if><!-- obqlazim -->

<xsl:if test="//spref/horizsys/planar/gridsys/spcs/obqmerc/obqlpt">

<xsl:for-each select="//spref/horizsys/planar/gridsys/spcs/obqmerc/obqlpt/obqllat">
<xsl:element name="Oblique_Line_Latitude"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="."/> 
</xsl:element>
</xsl:for-each>

<xsl:for-each select="//spref/horizsys/planar/gridsys/spcs/obqmerc/obqlpt/obqllong">
<xsl:element name="Oblique_Line_Longitude"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="."/> 
</xsl:element>
</xsl:for-each>

</xsl:if><!-- obqlazim -->

<xsl:element name="Latitude_of_Projection_Origin"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/spcs/obqmerc/latprjo"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/spcs/obqmerc/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/spcs/obqmerc/fnorth"/> 
</xsl:element>

</xsl:if><!-- obqmerc -->

<xsl:if test="//spref/horizsys/planar/gridsys/spcs/polycon">
<xsl:element name="Map_Projection_Name"> 
<xsl:attribute name ="gid1">1</xsl:attribute>Polyconic</xsl:element>

<xsl:element name="Longitude_of_Central_Meridian"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/spcs/polycon/longcm"/> 
</xsl:element>

<xsl:element name="Latitude_of_Projection_Origin"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/spcs/polycon/latprjo"/> 
</xsl:element>

<xsl:element name="False_Easting"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/spcs/polycon/feast"/> 
</xsl:element>

<xsl:element name="False_Northing"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/gridsys/spcs/polycon/fnorth"/> 
</xsl:element>

</xsl:if><!-- spcs -->

</xsl:if><!-- spcs -->
</xsl:if><!-- gridsys -->

<xsl:if test="//spref/horizsys/planar/planci">

<xsl:element name="Planar_Coordinate_Encoding_Method"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/planci/plance"/> 
</xsl:element>

<xsl:element name="Abscissa_Resolution"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/planci/coordrep/absres"/> 
</xsl:element>

<xsl:element name="Ordinate_Resolution"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/planci/coordrep/ordres"/> 
</xsl:element>

<xsl:element name="Planar_Distance_Units"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="//spref/horizsys/planar/planci/plandu"/> 
</xsl:element>

</xsl:if><!-- planci -->
</xsl:if><!-- planar -->



<xsl:element name="Horizontal_Datum_Name"> <!-- mif name -->
<xsl:apply-templates select="//spref/horizsys/geodetic/horizdn"/> <!-- FGDC path -->
</xsl:element>

<xsl:element name="Ellipsoid_Name"> <!-- mif name -->
<xsl:apply-templates select="//spref/horizsys/geodetic/ellips"/> <!-- FGDC path -->
</xsl:element>

<xsl:element name="Semi-Major_Axis"> <!-- mif name -->
<xsl:apply-templates select="//spref/horizsys/geodetic/semiaxis"/> <!-- FGDC path -->
</xsl:element>

<xsl:element name="Denominator_of_Flattening_Ratio"> <!-- mif name -->
<xsl:apply-templates select="//spref/horizsys/geodetic/denflat"/> <!-- FGDC path -->
</xsl:element>

<!-- <xsl:for-each select="//spdoinfo/ptvctinf/sdtsterm">

<xsl:element name="SDTS_Point_and_Vector_Object_Type"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="sdtstype"/> 
</xsl:element>

<xsl:if test="ptvctcnt">
<xsl:element name="Point_and_Vector_Object_Count"> 
<xsl:attribute name ="gid1">1</xsl:attribute>
<xsl:apply-templates select="ptvctcnt"/> 
</xsl:element>
</xsl:if>

</xsl:for-each> -->
</xsl:if>
</xsl:template>
</xsl:stylesheet>
