<?xml version="1.0" encoding="UTF-8"?>
<!-- XSLT Filter um Lokdaten aus iTrain in Calc zu importieren -->
<!-- Status: ok -->
<!-- Hinweise und Fehler an tuxator@tuxator.de -->

<!-- ############################################################################################### -->
<!--              Struktur des locomotive-Knotens der iTrain-XML-Datei                               -->
<!-- ############################################################################################### -->
<!--      <locomotive name="BR 01.5" active="false" type="steam" cabin="both" direction="forward"> -->
<!--        <interface name="TAMS MC" address="2"/> -->
<!--        <decoder protocol="dcc" steps="28"/> -->
<!--        <length unit="cm">20.7</length> -->
<!--        <options/> -->
<!--        <feedback count="3" unit="cm"> -->
<!--          <offset type="occupancy" front="7.5" rear="8.0"/> -->
<!--          <offset type="reed"/> -->
<!--          <offset type="light_barrier"/> -->
<!--        </feedback> -->
<!--        <delay value="0.2" unit="s"/> -->
<!--        <acceleration delay="650" unit="ms" step="1"/> -->
<!--        <deceleration delay="500" unit="ms" step="1"/> -->
<!--        <speed-limit forward="130.0" backward="50.0" unit="km_h"/> -->
<!--        <speed-control count="29" direction-specific="true" unit="km_h"> -->
<!--          <speed step="1" forward="1.1136059" backward="1.1080645"/> -->
<!--          <speed step="2" forward="3.443548" backward="3.3689728"/> -->
<!--          <speed step="3" forward="5.1875067" backward="5.153901"/> -->
<!--          <speed step="4" forward="8.094891" backward="8.064968"/> -->
<!--          <speed step="5" forward="10.444875" backward="10.497667"/> -->
<!--          <speed step="6" forward="12.712238" backward="12.72497"/> -->
<!--          <speed step="7" forward="16.238161" backward="16.206482"/> -->
<!--          <speed step="8" forward="20.476845" backward="20.504059"/> -->
<!--          <speed step="9" forward="23.40829" backward="23.3703"/> -->
<!--          <speed step="10" forward="27.39726" backward="27.400736"/> -->
<!--          <speed step="11" forward="31.47541" backward="31.450205"/> -->
<!--          <speed step="12" forward="37.18048" backward="37.222126"/> -->
<!--          <speed step="13" forward="42.274197" backward="41.933605"/> -->
<!--          <speed step="14" forward="46.129204" backward="46.60194"/> -->
<!--          <speed step="15" forward="51.48987" backward="51.74892"/> -->
<!--          <speed step="16" forward="56.984566" backward="57.08245"/> -->
<!--          <speed step="17" forward="61.90886" backward="61.793736"/> -->
<!--          <speed step="18" forward="67.75408" backward="67.86051"/> -->
<!--          <speed step="19" forward="73.53191" backward="74.137634"/> -->
<!--          <speed step="20" forward="78.889694" backward="79.22244"/> -->
<!--          <speed step="21" forward="84.73911" backward="86.46917"/> -->
<!--          <speed step="22" forward="91.71974" backward="92.703865"/> -->
<!--          <speed step="23" forward="99.1053" backward="99.49332"/> -->
<!--          <speed step="24" forward="107.78443" backward="106.35155"/> -->
<!--          <speed step="25" forward="115.353806" backward="113.594536"/> -->
<!--          <speed step="26" forward="121.75874" backward="120.670395"/> -->
<!--          <speed step="27" forward="127.584175" backward="127.32095"/> -->
<!--          <speed step="28" forward="130.86943" backward="130.47418"/> -->
<!--        </speed-control> -->
<!--        <image file="iTrain/images/myimages/01.5.jpg"/> -->
<!--        <functions count="1"> -->
<!--          <function nr="0" id="light.main" description="Licht vorn/hinten"/> -->
<!--        </functions> -->
<!--        <fuel unit="s" start="0" period="18000" percentage="18" derived="true"/> -->
<!--        <maintenance unit="s" period="144000"/> -->
<!--        <total> -->
<!--          <distance unit="m">1316.41109375</distance> -->
<!--          <time unit="s">14729</time> -->
<!--        </total> -->
<!--        <comment>Beckmann</comment> -->
<!--      </locomotive> -->
<!-- ############################################################################################### -->

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:tra="http://www.berros.eu/xml/train" exclude-result-prefixes="tra">
	<xsl:decimal-format name="westeuropa" decimal-separator=',' grouping-separator='.' />
    <xsl:template match="/">
		<office:document-content xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" office:version="1.0">
		  
		<office:automatic-styles>

			<!-- Formate für Spalten -->
			<!-- Typ -->
			<style:style style:name="co1" style:family="table-column">
				<style:table-column-properties fo:break-before="auto" style:column-width="18.0mm"/>
			</style:style>
			<!-- Lokame -->
			<style:style style:name="co2" style:family="table-column">
				<style:table-column-properties fo:break-before="auto" style:column-width="32.4mm"/>
			</style:style>
			<!-- Beschreibung -->
			<style:style style:name="co3" style:family="table-column">
				<style:table-column-properties fo:break-before="auto" style:column-width="44.1mm"/>
			</style:style>
			<!-- Adresse -->
			<style:style style:name="co4" style:family="table-column">
				<style:table-column-properties fo:break-before="auto" style:column-width="18.0mm"/>
			</style:style>
			<!-- Adresse 2 -->
			<style:style style:name="co5" style:family="table-column">
				<style:table-column-properties fo:break-before="auto" style:column-width="18.0mm"/>
			</style:style>
			<!-- Länge -->
			<style:style style:name="co6" style:family="table-column">
				<style:table-column-properties fo:break-before="auto" style:column-width="24.8mm"/>
			</style:style>
			<!-- Vmax Vorwärts -->
			<style:style style:name="co7" style:family="table-column">
				<style:table-column-properties fo:break-before="auto" style:column-width="21.5mm"/>
			</style:style>
			<!-- Vmax Rückwärts -->
			<style:style style:name="co8" style:family="table-column">
				<style:table-column-properties fo:break-before="auto" style:column-width="21.5mm"/>
			</style:style>
			<!-- Offset vorn -->
			<style:style style:name="co9" style:family="table-column">
				<style:table-column-properties fo:break-before="auto" style:column-width="21.5mm"/>
			</style:style>
			<!-- Offset hinten -->
			<style:style style:name="co10" style:family="table-column">
				<style:table-column-properties fo:break-before="auto" style:column-width="21.5mm"/>
			</style:style>
			<!-- Verzögerung Vorwärts -->
			<style:style style:name="co11" style:family="table-column">
				<style:table-column-properties fo:break-before="auto" style:column-width="24.8mm"/>
			</style:style>
			<!-- Verzögerung Rückwärts -->
			<style:style style:name="co12" style:family="table-column">
				<style:table-column-properties fo:break-before="auto" style:column-width="24.8mm"/>
			</style:style>
			<!-- Verzögerung Vorwärts -->
			<style:style style:name="co13" style:family="table-column">
				<style:table-column-properties fo:break-before="auto" style:column-width="24.8mm"/>
			</style:style>
			<!-- Verzögerung Rückwärts -->
			<style:style style:name="co14" style:family="table-column">
				<style:table-column-properties fo:break-before="auto" style:column-width="24.8mm"/>
			</style:style>
			<!-- Verzögerung Vorwärts -->
			<style:style style:name="co15" style:family="table-column">
				<style:table-column-properties fo:break-before="auto" style:column-width="24.8mm"/>
			</style:style>
			<!-- Verzögerung Rückwärts -->
			<style:style style:name="co16" style:family="table-column">
				<style:table-column-properties fo:break-before="auto" style:column-width="24.8mm"/>
			</style:style>
			<!-- Beschleunigen -->
			<style:style style:name="co17" style:family="table-column">
				<style:table-column-properties fo:break-before="auto" style:column-width="29.0mm"/>
			</style:style>
			<!-- Bremsen -->
			<style:style style:name="co18" style:family="table-column">
				<style:table-column-properties fo:break-before="auto" style:column-width="29.0mm"/>
			</style:style>
			<!-- Sichtseite -->
			<style:style style:name="co19" style:family="table-column">
				<style:table-column-properties fo:break-before="auto" style:column-width="24.8mm"/>
			</style:style>
			<!-- Optionen -->
			<style:style style:name="co20" style:family="table-column">
				<style:table-column-properties fo:break-before="auto" style:column-width="44.1mm"/>
			</style:style>
			<!-- Kommentar -->
			<style:style style:name="co21" style:family="table-column">
				<style:table-column-properties fo:break-before="auto" style:column-width="100.0mm"/>
			</style:style>
			<!-- Bild -->
			<style:style style:name="co22" style:family="table-column">
				<style:table-column-properties fo:break-before="auto" style:column-width="100.0mm"/>
			</style:style>

			<!-- Formate für Zellen -->
			<!-- ce1 linksbündig, 1pt Umrandung -->
			<style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default">
				<style:table-cell-properties fo:border="1pt solid #000000" style:text-align-source="fix" style:repeat-content="false"/>
				<style:paragraph-properties fo:text-align="start"/>
			</style:style>
			<!-- ce2 rechtsbündig, 1pt Umrandung -->
			<style:style style:name="ce2" style:family="table-cell" style:parent-style-name="Default">
				<style:table-cell-properties fo:border="1pt solid #000000" style:text-align-source="fix" style:repeat-content="false"/>
				<style:paragraph-properties fo:text-align="end"/>
			</style:style>
			<!-- ce3 mittig, Fett, 1pt Umrandung,  Hintergrundfarbe -->
			<style:style style:name="ce3" style:family="table-cell" style:parent-style-name="Default">
				<style:table-cell-properties fo:border="1pt solid #000000" fo:background-color="#009185" style:vertical-align="middle"/>
				<style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/>
				<style:paragraph-properties fo:text-align="center"/>
			</style:style>

		</office:automatic-styles>
		<!-- Aufbau Tabelle -->
		<office:body>
			<office:spreadsheet>
				<table:table>

				<!-- 22 Spalten für Loks formatieren -->
				<table:table-column table:style-name="co1" table:default-cell-style-name="Default"/> <!-- Loktyp -->
				<table:table-column table:style-name="co2" table:default-cell-style-name="Default"/> <!-- Lokame -->
				<table:table-column table:style-name="co3" table:default-cell-style-name="Default"/> <!-- Beschreibung -->
				<table:table-column table:style-name="co4" table:default-cell-style-name="Default"/> <!-- Adresse -->
				<table:table-column table:style-name="co5" table:default-cell-style-name="Default"/> <!-- Adresse -->
				<table:table-column table:style-name="co6" table:default-cell-style-name="Default"/> <!-- Länge -->
				<table:table-column table:style-name="co7" table:default-cell-style-name="Default"/> <!-- Vmax Vorwärts -->
				<table:table-column table:style-name="co8" table:default-cell-style-name="Default"/> <!-- Vmax Rückwärts -->
				<table:table-column table:style-name="co9" table:default-cell-style-name="Default"/> <!-- Offset vorn -->
				<table:table-column table:style-name="co10" table:default-cell-style-name="Default"/> <!-- Offset hinten -->
				<table:table-column table:style-name="co11" table:default-cell-style-name="Default"/> <!-- Offset vorn -->
				<table:table-column table:style-name="co12" table:default-cell-style-name="Default"/> <!-- Offset hinten -->
				<table:table-column table:style-name="co13" table:default-cell-style-name="Default"/> <!-- Offset vorn -->
				<table:table-column table:style-name="co14" table:default-cell-style-name="Default"/> <!-- Offset hinten -->
				<table:table-column table:style-name="co15" table:default-cell-style-name="Default"/> <!-- Verzögerung Vorwärts -->
				<table:table-column table:style-name="co16" table:default-cell-style-name="Default"/> <!-- Verzögerung Rückwärts -->
				<table:table-column table:style-name="co17" table:default-cell-style-name="Default"/> <!-- Beschleunigen -->
				<table:table-column table:style-name="co18" table:default-cell-style-name="Default"/> <!-- Bremsen -->
				<table:table-column table:style-name="co19" table:default-cell-style-name="Default"/> <!-- Sichtseite -->
				<table:table-column table:style-name="co20" table:default-cell-style-name="Default"/> <!-- Optionen -->
				<table:table-column table:style-name="co21" table:default-cell-style-name="Default"/> <!-- Kommentar -->
				<table:table-column table:style-name="co22" table:default-cell-style-name="Default"/> <!-- Bild -->
				
				<!-- Überschriften -->
				<!-- 1.Zeile -->
				<table:table-row>
					<table:table-cell table:style-name="ce3" table:number-rows-spanned="3"><text:p>Typ</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3" table:number-rows-spanned="3"><text:p>Lokname</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3" table:number-rows-spanned="3"><text:p>Beschreibung</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3" table:number-rows-spanned="3"><text:p>Adresse</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3" table:number-rows-spanned="3"><text:p>Adresse 2</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3" table:number-rows-spanned="3"><text:p>Länge in cm</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3" table:number-columns-spanned="2" table:number-rows-spanned="2"><text:p>Vmax</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3" table:number-columns-spanned="6"><text:p>Offset in cm</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3" table:number-columns-spanned="2" table:number-rows-spanned="2"><text:p>Verzögerung in ms</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3" table:number-rows-spanned="3">><text:p>Beschleunigen</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3" table:number-rows-spanned="3">><text:p>Bremsen</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3" table:number-rows-spanned="3"><text:p>Sichtseite</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3" table:number-rows-spanned="3"><text:p>Optionen</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3" table:number-rows-spanned="3"><text:p>Kommentar</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3" table:number-rows-spanned="3"><text:p>Bild</text:p></table:table-cell>
				</table:table-row>
				<!-- 2.Zeile -->
				<table:table-row>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3" table:number-columns-spanned="2"><text:p>Belegtmelder</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3" table:number-columns-spanned="2"><text:p>Reedkontakt</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3" table:number-columns-spanned="2"><text:p>Lichtschranke</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
				</table:table-row>
				<!-- 3.Zeile -->
				<table:table-row>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p>vorwärts</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p>rückwärts</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p>vorn</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p>hinten</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p>vorn</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p>hinten</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p>vorn</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p>hinten</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p>vorwärts</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p>rückwärts</text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
					<table:table-cell table:style-name="ce3"><text:p></text:p></table:table-cell>
				</table:table-row>
				
				<!-- alle Lokomotiv-Daten -->
				<xsl:for-each select="/tra:train-control/tra:control-items/tra:locomotives/tra:locomotive">
					<table:table-row>
						<!-- Typ -->
						<table:table-cell table:style-name="ce1">
							<xsl:if test="./@type = 'steam'">
								<text:p>Dampflok</text:p>
							</xsl:if>
							<xsl:if test="./@type = 'diesel'">
								<text:p>Diesellok</text:p>
							</xsl:if>
							<xsl:if test="./@type = 'electric'">
								<text:p>E-Lok</text:p>
							</xsl:if>
							<xsl:if test="./@type = 'misc'">
								<text:p>Sonstige</text:p>
							</xsl:if>
						</table:table-cell>
						<!-- Lokame -->
						<table:table-cell table:style-name="ce1"><text:p><xsl:value-of select="./@name"/></text:p></table:table-cell>
						<!-- Beschreibung -->
						<table:table-cell table:style-name="ce1"><text:p><xsl:value-of select="tra:description"/></text:p></table:table-cell>
						<!-- Adresse -->
						<xsl:choose>
							<xsl:when test="tra:interface/@address">
								<table:table-cell table:style-name="ce2"><text:p><xsl:value-of select="tra:interface/@address"/></text:p></table:table-cell>
								<table:table-cell table:style-name="ce2"></table:table-cell>
							</xsl:when>
							<xsl:otherwise>
								<xsl:for-each select="./tra:interface">
									<table:table-cell table:style-name="ce2"><text:p><xsl:value-of select="./tra:address[1]"/></text:p></table:table-cell>
									<!-- Adresse 2 -->
									<table:table-cell table:style-name="ce2"><text:p><xsl:value-of select="./tra:address[2]"/></text:p></table:table-cell>
								</xsl:for-each>
							</xsl:otherwise>
						</xsl:choose>
						<!-- Länge -->
						<table:table-cell table:style-name="ce2">
							<xsl:if test="tra:length">
								<text:p><xsl:value-of select="format-number(tra:length, '##00.0##', 'westeuropa')"/></text:p>
							</xsl:if>
						</table:table-cell>
						<!-- Vmax Vorwärts -->
						<table:table-cell table:style-name="ce2">
							<xsl:if test="tra:speed-limit/@forward">
								<text:p><xsl:value-of select="number(tra:speed-limit/@forward)"/></text:p>
							</xsl:if>
						</table:table-cell>
						<!-- Vmax Rückwärts -->
						<table:table-cell table:style-name="ce2">
							<xsl:if test="tra:speed-limit/@backward">
								<text:p><xsl:value-of select="number(tra:speed-limit/@backward)"/></text:p>
							</xsl:if>
						</table:table-cell>
						<!-- Rückmeldeoffset -->
						<xsl:choose>
							<!-- Melder 1 ist Belegtmelder -->
							<xsl:when test="tra:feedback/tra:offset[1]/@type='occupancy'">
								<table:table-cell table:style-name="ce2">
									<xsl:if test="tra:feedback/tra:offset[1]/@front">
										<text:p><xsl:value-of select="format-number(tra:feedback/tra:offset[1]/@front, '##00.0##', 'westeuropa')"/></text:p>
									</xsl:if>
								</table:table-cell>
								<table:table-cell table:style-name="ce2">
									<xsl:if test="tra:feedback/tra:offset[1]/@rear">
										<text:p><xsl:value-of select="format-number(tra:feedback/tra:offset[1]/@rear, '##00.0##', 'westeuropa')"/></text:p>
									</xsl:if>
								</table:table-cell>
							</xsl:when>
							<xsl:otherwise>
							<!-- Melder 1 ist nicht Belegtmelder -->
								<xsl:choose>
									<!-- Melder 1 ist Reedkontakt -->
									<xsl:when test="tra:feedback/tra:offset[1]/@type='reed'">
										<!-- 2 Zellen überspringen -->
										<table:table-cell table:style-name="ce2">
											<text:p></text:p>
										</table:table-cell>
										<table:table-cell table:style-name="ce2">
											<text:p></text:p>
										</table:table-cell>
										<table:table-cell table:style-name="ce2">
											<xsl:if test="tra:feedback/tra:offset[1]/@front">
												<text:p><xsl:value-of select="format-number(tra:feedback/tra:offset[1]/@front, '##00.0##', 'westeuropa')"/></text:p>
											</xsl:if>
										</table:table-cell>
										<table:table-cell table:style-name="ce2">
											<xsl:if test="tra:feedback/tra:offset[1]/@rear">
												<text:p><xsl:value-of select="format-number(tra:feedback/tra:offset[1]/@rear, '##00.0##', 'westeuropa')"/></text:p>
											</xsl:if>
										</table:table-cell>
									</xsl:when>
									<xsl:otherwise>
										<!-- Melder 1 ist nicht Reedkontakt -->
										<xsl:choose>
											<!-- Melder 1 ist Lichtschranke -->
											<xsl:when test="tra:feedback/tra:offset[1]/@type='light_barrier'">
												<!-- 4 Zellen überspringen -->
												<table:table-cell table:style-name="ce2">
													<text:p></text:p>
												</table:table-cell>
												<table:table-cell table:style-name="ce2">
													<text:p></text:p>
												</table:table-cell>
												<table:table-cell table:style-name="ce2">
													<text:p></text:p>
												</table:table-cell>
												<table:table-cell table:style-name="ce2">
													<text:p></text:p>
												</table:table-cell>
												<table:table-cell table:style-name="ce2">
													<xsl:if test="tra:feedback/tra:offset[1]/@front">
														<text:p><xsl:value-of select="format-number(tra:feedback/tra:offset[1]/@front, '##00.0##', 'westeuropa')"/></text:p>
													</xsl:if>
												</table:table-cell>
												<table:table-cell table:style-name="ce2">
													<xsl:if test="tra:feedback/tra:offset[1]/@rear">
														<text:p><xsl:value-of select="format-number(tra:feedback/tra:offset[1]/@rear, '##00.0##', 'westeuropa')"/></text:p>
													</xsl:if>
												</table:table-cell>
											</xsl:when>
											<xsl:otherwise>
												<!-- Melder 1 ist nicht vorhanden -->
												<!-- 6 Zellen überspringen -->
												<table:table-cell table:style-name="ce2">
													<text:p></text:p>
												</table:table-cell>
												<table:table-cell table:style-name="ce2">
													<text:p></text:p>
												</table:table-cell>
												<table:table-cell table:style-name="ce2">
													<text:p></text:p>
												</table:table-cell>
												<table:table-cell table:style-name="ce2">
													<text:p></text:p>
												</table:table-cell>
												<table:table-cell table:style-name="ce2">
													<text:p></text:p>
												</table:table-cell>
												<table:table-cell table:style-name="ce2">
													<text:p></text:p>
												</table:table-cell>
											</xsl:otherwise>
										</xsl:choose>
									</xsl:otherwise>
								</xsl:choose>
							</xsl:otherwise>
						</xsl:choose>
						<xsl:choose>
							<!-- Melder 2 ist Reedkontakt -->
							<xsl:when test="tra:feedback/tra:offset[2]/@type='reed'">
								<table:table-cell table:style-name="ce2">
									<xsl:if test="tra:feedback/tra:offset[2]/@front">
										<text:p><xsl:value-of select="format-number(tra:feedback/tra:offset[2]/@front, '##00.0##', 'westeuropa')"/></text:p>
									</xsl:if>
								</table:table-cell>
								<table:table-cell table:style-name="ce2">
									<xsl:if test="tra:feedback/tra:offset[2]/@rear">
										<text:p><xsl:value-of select="format-number(tra:feedback/tra:offset[2]/@rear, '##00.0##', 'westeuropa')"/></text:p>
									</xsl:if>
								</table:table-cell>
							</xsl:when>
							<!-- Melder 2 ist kein Reedkontakt -->
							<xsl:otherwise>
								<xsl:choose>
									<!-- Melder 2 ist Lichtschranke -->
									<xsl:when test="tra:feedback/tra:offset[2]/@type='light_barrier'">
										<!-- 2 Zellen überspringen -->
										<xsl:if test="tra:feedback/tra:offset[1]/@type!='reed'">
											<table:table-cell table:style-name="ce2">
												<text:p></text:p>
											</table:table-cell>
											<table:table-cell table:style-name="ce2">
												<text:p></text:p>
											</table:table-cell>
										</xsl:if>
										<table:table-cell table:style-name="ce2">
											<xsl:if test="tra:feedback/tra:offset[2]/@front">
												<text:p><xsl:value-of select="format-number(tra:feedback/tra:offset[2]/@front, '##00.0##', 'westeuropa')"/></text:p>
											</xsl:if>
										</table:table-cell>
										<table:table-cell table:style-name="ce2">
												<xsl:if test="tra:feedback/tra:offset[2]/@rear">
													<text:p><xsl:value-of select="format-number(tra:feedback/tra:offset[2]/@rear, '##00.0##', 'westeuropa')"/></text:p>
												</xsl:if>
										</table:table-cell>
									</xsl:when>
									<xsl:otherwise>
										<!-- Melder 2 ist nicht vorhanden -->
										<!-- 2 Zellen überspringen wenn Melder 1 nicht Lichtschranke-->
										<xsl:if test="tra:feedback/tra:offset[1]/@type != 'light_barrier'">
											<table:table-cell table:style-name="ce2">
												<text:p></text:p>
											</table:table-cell>
											<table:table-cell table:style-name="ce2">
												<text:p></text:p>
											</table:table-cell>
										</xsl:if>
									</xsl:otherwise>
								</xsl:choose>
							</xsl:otherwise>
						</xsl:choose>
						<xsl:choose>
							<!-- Melder 3 ist Lichtschranke -->
							<xsl:when test="tra:feedback/tra:offset[3]/@type='light_barrier'">
								<table:table-cell table:style-name="ce2">
									<xsl:if test="tra:feedback/tra:offset[3]/@front">
										<text:p><xsl:value-of select="format-number(tra:feedback/tra:offset[3]/@front, '##00.0##', 'westeuropa')"/></text:p>
									</xsl:if>
								</table:table-cell>
								<table:table-cell table:style-name="ce2">
									<xsl:if test="tra:feedback/tra:offset[3]/@rear">
										<text:p><xsl:value-of select="format-number(tra:feedback/tra:offset[3]/@rear, '##00.0##', 'westeuropa')"/></text:p>
									</xsl:if>
								</table:table-cell>
							</xsl:when>
							<xsl:otherwise>
								<!-- Melder 3 ist nicht vorhanden -->
								<!-- 2 Zellen überspringen wenn Melder 1 nicht Belegtmelder-->
								<xsl:if test="tra:feedback/tra:offset[1]/@type='occupancy'">
									<table:table-cell table:style-name="ce2">
										<text:p></text:p>
									</table:table-cell>
									<table:table-cell table:style-name="ce2">
										<text:p></text:p>
									</table:table-cell>
								</xsl:if>
							</xsl:otherwise>
						</xsl:choose>
						<!-- ############################################## -->
						<!-- Verzögerung Vorwärts -->
						<table:table-cell table:style-name="ce2">
							<xsl:choose>
								<xsl:when test="tra:delay/@value">
									<text:p><xsl:value-of select="format-number(tra:delay/@value * 1000, '##00', 'westeuropa')"/></text:p>
								</xsl:when>
								<xsl:otherwise>
									<text:p><xsl:value-of select="format-number(tra:delay/@forward * 1000, '##00', 'westeuropa')"/></text:p>
								</xsl:otherwise>
							</xsl:choose>
						</table:table-cell>
						<!-- Verzögerung Rückwärts -->
						<table:table-cell table:style-name="ce2">
							<xsl:choose>
								<xsl:when test="tra:delay/@value">
									<text:p><xsl:value-of select="format-number(tra:delay/@value * 1000, '##00', 'westeuropa')"/></text:p>
								</xsl:when>
								<xsl:otherwise>
									<text:p><xsl:value-of select="format-number(tra:delay/@backward * 1000, '##00', 'westeuropa')"/></text:p>
								</xsl:otherwise>
							</xsl:choose>
						</table:table-cell>
						<!-- Beschleunigen -->
						<table:table-cell table:style-name="ce2"><text:p><xsl:value-of select="tra:acceleration/@delay"/><xsl:if test="tra:acceleration/@delay">/</xsl:if><xsl:value-of select="tra:acceleration/@step"/></text:p></table:table-cell>
						<!-- Bremsen -->
						<table:table-cell table:style-name="ce2"><text:p><xsl:value-of select="tra:deceleration/@delay"/><xsl:if test="tra:deceleration/@delay">/</xsl:if><xsl:value-of select="tra:deceleration/@step"/></text:p></table:table-cell>
						<!-- Sichtseite -->
						<table:table-cell table:style-name="ce1">
							<xsl:if test="./@cabin = 'both'">
								<text:p>beide</text:p>
							</xsl:if>
							<xsl:if test="./@cabin = 'front'">
								<text:p>vorn</text:p>
							</xsl:if>
							<xsl:if test="./@cabin = 'rear'">
								<text:p>hinten</text:p>
							</xsl:if>
						</table:table-cell>
						<!-- Optionen -->
						<table:table-cell table:style-name="ce1">
							<xsl:if test="tra:options/tra:option = 'symmetrical'">
								<text:p>symmetrisch</text:p>
							</xsl:if>
						</table:table-cell>
						<!-- Kommentar -->
						<table:table-cell table:style-name="ce1"><text:p><xsl:value-of select="tra:comment"/></text:p></table:table-cell>
						<!-- Bild -->
						<table:table-cell table:style-name="ce1"><text:p><xsl:value-of select="tra:image/@file"/></text:p></table:table-cell>
					</table:table-row>
				</xsl:for-each>
				</table:table>
			</office:spreadsheet>
		</office:body>
		</office:document-content>
	</xsl:template>
</xsl:stylesheet>
