<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<!-- first line, no indent, omit xml-declaration-->
	<xsl:output method="text" omit-xml-declaration="yes" indent="no" encoding="iso-8859-1"/>
  
	<xsl:template match="/">
		<xsl:call-template name="VERSION"></xsl:call-template>
		<xsl:for-each select="body[1]">
			<xsl:call-template name="PROCESS_BODY"></xsl:call-template>
		</xsl:for-each>
	</xsl:template>

	<!-- .................................. -->
	<!-- body                           -->
	<!-- .................................. -->
	<xsl:template name="PROCESS_BODY">

		<xsl:variable name="_root" select="/body"/>

		<xsl:for-each select="$_root/address">
			<xsl:sort select="label"/>

			<!-- ....................................... -->
			<!-- handling of information -->
			<!-- ....................................... -->
			<xsl:call-template name="PROCESS_GENERAL">
				<xsl:with-param name="_address" select="current()"/>
			</xsl:call-template>

		</xsl:for-each>
	</xsl:template>

	<!--************************************************************************allgemeine Verarbeitung **************************************************************************** -->
	<xsl:template name="PROCESS_GENERAL">
		<xsl:param name="_address"/>

		<!-- .................................. -->
		<!-- address label             -->
		<!-- .................................. -->
		<xsl:call-template name="BOLD"/>
		<xsl:value-of select="$_address/label"/>

		<xsl:call-template name="BLANK"/>
		<xsl:call-template name="ITALIC_BOLD"/>

		<!-- .................................. -->
		<!-- street         				 -->
		<!-- .................................. -->
		<xsl:if test="string-length($_address/street) > 0">
			<xsl:value-of select="$_address/street"/>
		</xsl:if>

		<!-- .................................. -->
		<!-- phone = Information Desk -->
		<!-- .................................. -->
		<xsl:if test="string-length($_address/phone[function/@id = 0]/number) > 0">
			<xsl:call-template name="BLANK"/>
			<xsl:call-template name="LEFT_PARENTHESIS"/>
			<xsl:value-of select="$_address/phone[function/@id = 0]/area_code"/>
			<xsl:call-template name="HYPHEN"/>
			<xsl:value-of select="$_address/phone[function/@id = 0]/number"/>
			<xsl:call-template name="RIGHT_PARENTHESIS"/>
		</xsl:if>

		<xsl:call-template name="FULLSTOP"/>

		<xsl:variable name="_approach_descriptions" select="$_address/text_system/text[text_type = 'Approach Descriptions' and language = 'english']/version"/>

		<xsl:if test="string-length($_approach_descriptions) > 0">
			<xsl:call-template name="BLANK"/>
		</xsl:if>

		<xsl:call-template name="ITALIC"/>

		<!-- .................................. -->
		<!-- approach discription	 -->
		<!-- .................................. -->
		<xsl:if test="string-length($_approach_descriptions) > 0">
			<xsl:call-template name="ITALIC"/>
			<xsl:value-of select="$_approach_descriptions"/>
			<xsl:call-template name="ITALIC"/>
			<xsl:call-template name="FULLSTOP"/>
		</xsl:if>

		<xsl:if test="position() != last()">
			<xsl:call-template name="CRLF"/>
		</xsl:if>
	</xsl:template>



	<!--................................................  -->
	<!-- Version-Definition Quark Tags -->
	<!--................................................  -->
	
	 <xsl:template name="VERSION">
	 	<xsl:text disable-output-escaping="yes">&lt;v1.70&gt;&lt;e0&gt;</xsl:text>
		<xsl:call-template name="CRLF"/>
	</xsl:template>
	
	<!--................................................  -->
	<!-- Tagging for Quark                    -->
	<!--................................................  -->


	<!-- bold -->
	<xsl:template name="BOLD">
		<xsl:text disable-output-escaping="yes">&lt;*L*h"Standard"*kn0*kt0*ra0*rb0*d0*p(0,0,0,7,0,0,G,"U.S. English")*t(9,0,"1 ")PBs100t0h100z7k0b0c"Black"f"TimeOut-Regular"&gt;</xsl:text>
	</xsl:template>
	
	<!-- italic_bold -->
	<xsl:template name="ITALIC_BOLD">
		<xsl:text disable-output-escaping="yes">&lt;I&gt;&lt;B&gt;</xsl:text>
	</xsl:template>
	
	<!-- italic -->
	<xsl:template name="ITALIC">
		<xsl:text disable-output-escaping="yes">&lt;I&gt;</xsl:text>
	</xsl:template>




	<!--CRLF-->
	<xsl:template name="CRLF">
		<xsl:text disable-output-escaping="yes">&#13;</xsl:text>
	</xsl:template>

	<!--blank-->
	<xsl:template name="BLANK">
		<xsl:text disable-output-escaping="yes"> </xsl:text>
	</xsl:template>

	<!--hyphen-->
	<xsl:template name="HYPHEN">
		<xsl:text disable-output-escaping="yes">-</xsl:text>
	</xsl:template>

	<!--full stop-->
	<xsl:template name="FULLSTOP">
		<xsl:text disable-output-escaping="yes">.</xsl:text>
	</xsl:template>

	<!--left parenthesis-->
	<xsl:template name="LEFT_PARENTHESIS">
		<xsl:text disable-output-escaping="yes">(</xsl:text>
	</xsl:template>

	<!--right parenthesis-->
	<xsl:template name="RIGHT_PARENTHESIS">
		<xsl:text disable-output-escaping="yes">)</xsl:text>
	</xsl:template>

</xsl:stylesheet>
<!-- Stylus Studio meta-information - (c)1998-2004. Sonic Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="yes" name="Scenario1" userelativepaths="yes" externalpreview="no" url="venues.xml" htmlbaseurl="" outputurl="venues_neu.txt" processortype="internal" profilemode="0" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext=""/></scenarios><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/>
</metaInformation>
-->