<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>

<!-- Map Viewer (Third Edition) by Howie Sternberg at howies@snet.net. Map Viewer is placed in the public domain and is "Freeware". Map Viewer may be freely used and redistributed, is provided "AS-IS" without warranty of any kind, and there is no technical support provided. --> 

<!-- Return delimeted string of default map properties. See properties.xml. Delimeter is vertical bar: | -->
<xsl:template match="/">
	<xsl:apply-templates select="mapviewer/properties/mapscale/appliestoprintedmap"/>
	<xsl:apply-templates select="mapviewer/properties/mapscale/screenwidth"/>
	<xsl:apply-templates select="mapviewer/properties/image/size"/>
	<xsl:apply-templates select="mapviewer/properties/image/preserveview"/>
	<xsl:apply-templates select="mapviewer/properties/navigate/maxscale"/>
	<xsl:apply-templates select="mapviewer/properties/feature/maxscale"/>
	<xsl:apply-templates select="mapviewer/properties/feature/minmax"/>
	<xsl:apply-templates select="mapviewer/properties/feature/color"/>
	<xsl:apply-templates select="mapviewer/properties/feature/limitlist"/>		
	<xsl:apply-templates select="mapviewer/properties/feature/pointsymbol/type"/>
	<xsl:apply-templates select="mapviewer/properties/feature/pointsymbol/width"/>
	<xsl:apply-templates select="mapviewer/properties/feature/linesymbol/type"/>
	<xsl:apply-templates select="mapviewer/properties/feature/linesymbol/width"/>
	<xsl:apply-templates select="mapviewer/properties/feature/polygonsymbol/boundary"/>
	<xsl:apply-templates select="mapviewer/properties/feature/polygonsymbol/filltype"/>
	<xsl:apply-templates select="mapviewer/properties/feature/polygonsymbol/filltransparency"/>
	<xsl:apply-templates select="mapviewer/properties/label/textsymbol/font"/>		
	<xsl:apply-templates select="mapviewer/properties/label/textsymbol/fontstyle"/>		
	<xsl:apply-templates select="mapviewer/properties/label/textsymbol/fontsize"/>		
	<xsl:apply-templates select="mapviewer/properties/label/textsymbol/fontcolor"/>
	<xsl:apply-templates select="mapviewer/properties/label/textsymbol/printmode"/>
	<xsl:apply-templates select="mapviewer/properties/label/howmany"/>				
	<xsl:apply-templates select="mapviewer/properties/label/minmax"/>		
	<xsl:apply-templates select="mapviewer/properties/panfactor"/>		
	<xsl:apply-templates select="mapviewer/properties/zoomfactor"/>
	<xsl:apply-templates select="mapviewer/properties/scalebarunits"/>										
</xsl:template>

<xsl:template match="mapviewer/properties/mapscale/appliestoprintedmap">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@value"/>
				<text>|</text>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>

<xsl:template match="mapviewer/properties/mapscale/screenwidth">
		<xsl:if test="@value">
			<xsl:value-of select="@value"/>
			<text>|</text>
		</xsl:if>
</xsl:template>

<xsl:template match="mapviewer/properties/image/size">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@width"/>
				<text>|</text>
				<xsl:value-of select="@height"/>
				<text>|</text>					
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>

<xsl:template match="mapviewer/properties/image/preserveview">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@value"/>
				<text>|</text>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>

<xsl:template match="mapviewer/properties/navigate/maxscale">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@value"/>
				<text>|</text>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>

<xsl:template match="mapviewer/properties/feature/color">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@value"/>
				<text>|</text>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>

<xsl:template match="mapviewer/properties/feature/maxscale">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@value"/>
				<text>|</text>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>

<xsl:template match="mapviewer/properties/feature/minmax">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@value"/>
				<text>|</text>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>

<xsl:template match="mapviewer/properties/feature/limitlist">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@value"/>
				<text>|</text>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>

<xsl:template match="mapviewer/properties/feature/pointsymbol/type">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@value"/>
				<text>|</text>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>

<xsl:template match="mapviewer/properties/feature/pointsymbol/width">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@value"/>
				<text>|</text>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>

<xsl:template match="mapviewer/properties/feature/linesymbol/type">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@value"/>
				<text>|</text>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>

<xsl:template match="mapviewer/properties/feature/linesymbol/width">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@value"/>
				<text>|</text>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>

<xsl:template match="mapviewer/properties/feature/polygonsymbol/boundary">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@value"/>
				<text>|</text>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>

<xsl:template match="mapviewer/properties/feature/polygonsymbol/filltype">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@value"/>
				<text>|</text>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>

<xsl:template match="mapviewer/properties/feature/polygonsymbol/filltransparency">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@value"/>
				<text>|</text>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>

<xsl:template match="mapviewer/properties/label/textsymbol/font">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@value"/>
				<text>|</text>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>

<xsl:template match="mapviewer/properties/label/textsymbol/fontstyle">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@value"/>
				<text>|</text>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>

<xsl:template match="mapviewer/properties/label/textsymbol/fontsize">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@value"/>
				<text>|</text>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>

<xsl:template match="mapviewer/properties/label/textsymbol/fontcolor">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@value"/>
				<text>|</text>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>

<xsl:template match="mapviewer/properties/label/textsymbol/printmode">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@value"/>
				<text>|</text>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>

<xsl:template match="mapviewer/properties/label/howmany">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@value"/>
				<text>|</text>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>

<xsl:template match="mapviewer/properties/label/minmax">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@value"/>
				<text>|</text>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>

<xsl:template match="mapviewer/properties/panfactor">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@value"/>
				<text>|</text>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>

<xsl:template match="mapviewer/properties/zoomfactor">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@value"/>
				<text>|</text>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>

<xsl:template match="mapviewer/properties/scalebarunits">
	<xsl:for-each select="option">
		<xsl:if test="@default">
			<xsl:variable name="isDefault">
				<xsl:value-of select="translate(@default,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
			</xsl:variable>	
			<xsl:if test="$isDefault = 'true'">
				<xsl:value-of select="@value"/>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>
	
</xsl:stylesheet>