<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- V. 18.10.2011 19:20 -->
<xsl:stylesheet version="1.0" xmlns:d="urn:iso:std:iso:20022:tech:xsd:camt.053.001.02" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" version="4.01" doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
	<!-- Tekstit alkavat -->
	<xsl:variable name="txtOtsikko">TILIOTE</xsl:variable>
	<xsl:variable name="txtKausi">Kausi</xsl:variable>
	<xsl:variable name="txtPaivamaara">Päivämäärä</xsl:variable>
	<xsl:variable name="txtTulostettu">TULOSTETTU ASIAKKAALLA</xsl:variable>
	<xsl:variable name="txtSijaintimaa">SIJAINTIMAAKOODI</xsl:variable>
	<xsl:variable name="txtMaakoodi">Maakoodi</xsl:variable>
	<xsl:variable name="txtArkistointitunnus">Arkistointitunnus</xsl:variable>
	<xsl:variable name="txtSaajanTilinumero">Saajan tilinumero</xsl:variable>
	<xsl:variable name="txtMaksupvmOsa1">Mak-</xsl:variable>
	<xsl:variable name="txtMaksupvmOsa2">supvm</xsl:variable>
	<xsl:variable name="txtArvopvmOsa1">Ar-</xsl:variable>
	<xsl:variable name="txtArvopvmOsa2">vopvm</xsl:variable>
	<xsl:variable name="txtSaajaMaksaja">Saaja/Maksaja</xsl:variable>
	<xsl:variable name="txtViesti">Viesti</xsl:variable>
	<xsl:variable name="txtTapNroOsa1">Tap</xsl:variable>
	<xsl:variable name="txtTapNroOsa2">N:o</xsl:variable>
	<xsl:variable name="txtTiliointi">Tiliöinti</xsl:variable>
	<xsl:variable name="txtMaara">Määrä</xsl:variable>
	<xsl:variable name="txtSaldo">SALDO</xsl:variable>
	<xsl:variable name="txtLimiitti">LIMIITTI</xsl:variable>
	<xsl:variable name="txtKirjauspaiva">KIRJAUSPÄIVÄ</xsl:variable>
	<xsl:variable name="txtPanotYhtKpl">PANOT YHTEENSÄ KPL</xsl:variable>
	<xsl:variable name="txtOtotYhtKpl">OTOT YHTEENSÄ KPL</xsl:variable>
	<xsl:variable name="txtKpl">KPL</xsl:variable>
	<xsl:variable name="txtViite">VIITE</xsl:variable>
	<xsl:variable name="txtLaskuttajanAsnro">Laskuttajan/Myyjän asiakasnro</xsl:variable>
	<xsl:variable name="txtLaskutettavanAsnro">Laskutettavan/Ostajan asiakasnro</xsl:variable>
	<xsl:variable name="txtLaskunNro">Laskun nro</xsl:variable>
	<xsl:variable name="txtLaskunPvm">Laskun päiväys</xsl:variable>
	<xsl:variable name="txtKortinNro">Kortin nro</xsl:variable>
	<xsl:variable name="txtKaupanViite">Kaupan viite</xsl:variable>
	<xsl:variable name="txtAlkupArktun">Alkuperäinen arkistointitunnus</xsl:variable>
	<xsl:variable name="txtSaajanTiliMuuttunut">Saajan tili muuttunut</xsl:variable>
	<xsl:variable name="txtVastaarvo">Vasta-arvo</xsl:variable>
	<xsl:variable name="txtValuuttakurssi">Valuuttakurssi</xsl:variable>
	<xsl:variable name="txtKurssiviite">Kurssiviite</xsl:variable>
	<xsl:variable name="txtKurssimuunnoshetki">Kurssimuunnos</xsl:variable>
	<xsl:variable name="txtToimeksiantajanTieto">Toimeksiantajan tieto</xsl:variable>
	<xsl:variable name="txtMaksunaihekoodi">Maksunaihekoodi</xsl:variable>
	<xsl:variable name="txtMaksunaihe">Maksunaihe</xsl:variable>
	<xsl:variable name="txtKayttovara">KÄYTTÖVARA</xsl:variable>
	<xsl:variable name="txtKulutPalkkiot">Kulut tai palkkiot</xsl:variable>
	<!-- Tekstit loppuivat -->
	<xsl:decimal-format name="rahasummat" decimal-separator="," grouping-separator=" "/>
	<xsl:variable name="patternRahasummat">### ###,00###</xsl:variable>
	<xsl:template match="d:Document/d:BkToCstmrStmt">
		<html>
			<head>
				<title><xsl:value-of select="$txtOtsikko"/></title>
				<style type="text/css">
				   body { background-color:#ffffff; color:#000000;}
				   table.Perustiedot {width:695px;}
				   table.Perustiedot td {font-weight:bold; font-size:12px;}
				   tr.PerustiedotR1 td {padding-bottom:12px;}
				   tr.PerustiedotR2 td {padding-bottom:12px;}
				   tr.PerustiedotR3 td {padding-bottom:12px;}
				   table.Tapahtumat {width:695px; border-collapse:collapse; padding-left:2px; padding-right:2px;}
				   table.Tapahtumat td.eka {padding-left:3px;}
				   table.Tapahtumat td {font-size:12px;}
				   table.Tapahtumat td.poistaOikeaKehys {border-right:none;}
				   table.Tapahtumat td.plusMiinus {border-left:none; text-align:center;}
				   tr.Sarakeotsikot td {border:1px solid black; font-weight:bold; padding-left:2px;}
				   div.StmtSeparator {border-top:2px dashed black; margin-top:12px; margin-bottom:12px;}
				   span.pvmJaSumma {margin-left:12px;}
				   span.sisennaSaajanTili {margin-left:12px;}
				   span.valuuttaJaSumma {margin-left:8px;}
				   td.lihavoitu {font-weight:bold;}
				   tr.erittely {font-style:italic;}
				   td.erittely {padding-right:12px;}
				   tr.parillinen {background-color:#f0f0f0;}
				   table.Lisatiedot {width:695px; border-collapse:collapse; padding-left:2px; padding-right:2px; margin-top:12px;}
				   table.Lisatiedot td {font-size:12px;}
				</style>
			</head>
			<body>
				<xsl:for-each select="d:Stmt">
					<xsl:if test="position() != 1">
						<xsl:call-template name="outputStmtSeparator"/>
					</xsl:if>
					<xsl:call-template name="outputStmt"/>
				</xsl:for-each>
				<xsl:element name="script">
					<xsl:attribute name="type">text/javascript</xsl:attribute>
					var d = new Date();
					var s = "" + d.getDate() + "." + (d.getMonth() + 1) + "." + d.getFullYear();
					var e;
					for (i = 1; i &lt; 10000; i++) {
						e = document.getElementById("tulostuspvm" + i);
						if (e) {
							e.innerHTML = s
						} else {
							break;
						}
					}
				</xsl:element>
			</body>
		</html>
	</xsl:template>

	<xsl:template name="outputStmt">
		<xsl:call-template name="outputStmtPerustiedot"/>
		<xsl:call-template name="outputStmtTapahtumat"/>
		<xsl:for-each select="d:AddtlStmtInf">
			<xsl:call-template name="outputAddtlStmtInf"/>
		</xsl:for-each>
	</xsl:template>

	<xsl:template name="outputStmtPerustiedot">
		<table class="Perustiedot" cellpadding="0" cellspacing="0">
			<col width="36%"/><col width="27%"/><col width="37%"/>
			<tbody>
				<tr class="PerustiedotR1">
					<td>
						<xsl:value-of select="d:Acct/d:Svcr/d:FinInstnId/d:Nm"/>
					</td>
					<td>
						<xsl:value-of select="$txtOtsikko"/>
					</td>
					<td>
						<xsl:value-of select="d:LglSeqNb"/>
					</td>
				</tr>
				<tr class="PerustiedotR2">
					<td>
						<xsl:for-each select="d:Acct/d:Svcr/d:FinInstnId/d:PstlAdr[1]">
							<xsl:call-template name="outputPostalAddress6"/>
						</xsl:for-each>
					</td>
					<td>
						<xsl:value-of select="$txtKausi"/><br/>
						<xsl:call-template name="outputISODate">
							<xsl:with-param name="theDate" select="d:FrToDt/d:FrDtTm"/>
						</xsl:call-template>
						<xsl:if test="substring(d:FrToDt/d:FrDtTm, 1, 10) != substring(d:FrToDt/d:ToDtTm, 1, 10)">
							<xsl:text> - </xsl:text>
							<xsl:call-template name="outputISODate">
								<xsl:with-param name="theDate" select="d:FrToDt/d:ToDtTm"/>
							</xsl:call-template>
						</xsl:if>
					</td>
					<td>
						<xsl:value-of select="$txtPaivamaara"/><br/>
						<xsl:call-template name="outputISODate">
							<xsl:with-param name="theDate" select="d:CreDtTm"/>
						</xsl:call-template>
					</td>
				</tr>
				<tr class="PerustiedotR3" valign="bottom">
					<td>
						<xsl:value-of select="d:Acct/d:Ownr/d:Nm"/><br/>
						<xsl:for-each select="d:Acct/d:Ownr/d:PstlAdr[1]">
							<xsl:call-template name="outputPostalAddress6">
								<xsl:with-param name="countryTitle" select="$txtSijaintimaa"/>
							</xsl:call-template>
						</xsl:for-each>
					</td>
					<td>
						<xsl:text>IBAN: </xsl:text>
						<xsl:call-template name="outputGrouped">
							<xsl:with-param name="theStr" select="d:Acct/d:Id/d:IBAN"/>
							<xsl:with-param name="lenGroup" select="'4'"/>
						</xsl:call-template>
						<br/><xsl:text>BIC: </xsl:text><xsl:value-of select="d:Acct/d:Svcr/d:FinInstnId/d:BIC"/>
					</td>
					<td>
						<xsl:value-of select="$txtTulostettu"/><xsl:text> </xsl:text>
						<span>
							<xsl:attribute name="id">tulostuspvm<xsl:value-of select="position()"/></xsl:attribute>
						</span>
					</td>
				</tr>
			</tbody>
		</table>
	</xsl:template>
	
	<xsl:template name="outputStmtTapahtumat">
		<xsl:variable name="defaultCurrency" select="d:Acct/d:Ccy"/>
		<table class="Tapahtumat" cellpadding="0" cellspacing="0">
			<tbody>
				<tr class="Sarakeotsikot" valign="top">
					<td>
						<xsl:value-of select="$txtArkistointitunnus"/><br/>
						<xsl:value-of select="$txtSaajanTilinumero"/><br/>
						<xsl:text>ACWC = </xsl:text><xsl:value-of select="$txtSaajanTiliMuuttunut"/>
					</td>
					<td>
						<xsl:value-of select="$txtMaksupvmOsa1"/><br/>
						<xsl:value-of select="$txtMaksupvmOsa2"/><br/>
						<xsl:value-of select="$txtArvopvmOsa1"/><br/>
						<xsl:value-of select="$txtArvopvmOsa2"/>
					</td>
					<td colspan="2">
						<xsl:value-of select="$txtSaajaMaksaja"/><br/>
						<xsl:value-of select="$txtViesti"/>
					</td>
					<td>
						<xsl:value-of select="$txtTapNroOsa1"/><br/>
						<xsl:value-of select="$txtTapNroOsa2"/>
					</td>
					<td>
						<xsl:value-of select="$txtTiliointi"/>
					</td>
					<td class="poistaOikeaKehys">
						<xsl:value-of select="$txtMaara"/><br/>
						<xsl:value-of select="$defaultCurrency"/>
					</td>
					<td class="plusMiinus">
					</td>
				</tr>
				<xsl:for-each select="d:Bal[d:Tp/d:CdOrPrtry/d:Cd='OPBD'][1]">
					<xsl:call-template name="outputSaldorivi">
						<xsl:with-param name="theTitle" select="$txtSaldo"/>
					</xsl:call-template>
				</xsl:for-each>
				<xsl:for-each select="d:Ntry[d:Sts='BOOK']">
					<xsl:variable name="btchNbOfTxs" select="d:NtryDtls/d:Btch/d:NbOfTxs"/>
					<xsl:variable name="theCdtDbtInd" select="d:CdtDbtInd"/>
					<xsl:variable name="onKorjaus">
						<xsl:choose>
							<xsl:when test="(d:RvslInd = 'true') or (d:RvslInd = '1')">1</xsl:when>
							<xsl:otherwise>0</xsl:otherwise>
						</xsl:choose>
					</xsl:variable>
					<xsl:variable name="yksiTapahtuma">
						<xsl:choose>
							<xsl:when test="d:NtryDtls/d:TxDtls[2]">0</xsl:when>
							<xsl:otherwise>1</xsl:otherwise>
						</xsl:choose>
					</xsl:variable>
					<xsl:if test="(position() = 1) or (preceding-sibling::d:Ntry[position()=1]/d:BookgDt/d:Dt != d:BookgDt/d:Dt)">
						<xsl:if test="position() != 1">
							<xsl:call-template name="outputBookgDtTotals">
								<xsl:with-param name="theDate" select="preceding-sibling::d:Ntry[position()=1]/d:BookgDt/d:Dt"/>
							</xsl:call-template>
						</xsl:if>
						<tr>
							<td class="eka" colspan="8">
								<xsl:value-of select="$txtKirjauspaiva"/><xsl:text> </xsl:text>
								<xsl:call-template name="outputISODate">
									<xsl:with-param name="theDate" select="d:BookgDt/d:Dt"/>
								</xsl:call-template>
							</td>
						</tr>
					</xsl:if>
					<tr valign="top">
						<xsl:if test="position() mod 2 = 0">
							<xsl:attribute name="class">parillinen</xsl:attribute>
						</xsl:if>
						<td class="eka">
							<xsl:call-template name="outputGrouped">
								<xsl:with-param name="theStr" select="d:AcctSvcrRef"/>
								<xsl:with-param name="lenGroup" select="'5'"/>
							</xsl:call-template>
							<xsl:if test="(string-length($btchNbOfTxs) = 0) and ($yksiTapahtuma = 1)">
								<xsl:for-each select="d:NtryDtls/d:TxDtls[1]/d:RltdPties/d:CdtrAcct[1]">
									<br/>
									<xsl:call-template name="outputCashAccount16">
										<xsl:with-param name="tilinTyyppi" select="'st'"/>
									</xsl:call-template>
								</xsl:for-each>
							</xsl:if>
						</td>
						<td>
							<xsl:variable name="sAccptncDtTm" select="d:NtryDtls/d:TxDtls[1]/d:RltdDts/d:AccptncDtTm"/>
							<xsl:call-template name="outputISODateDDMM">
								<xsl:with-param name="theDate">
									<xsl:choose>
										<xsl:when test="string-length($sAccptncDtTm) != 0">
											<xsl:value-of select="$sAccptncDtTm"/>
										</xsl:when>
										<xsl:otherwise>
											<xsl:value-of select="d:BookgDt/d:Dt"/>
										</xsl:otherwise>
									</xsl:choose>
								</xsl:with-param>
							</xsl:call-template>
							<br/>
							<xsl:call-template name="outputISODateDDMM">
								<xsl:with-param name="theDate" select="d:ValDt/d:Dt"/>
							</xsl:call-template>
						</td>
						<td colspan="2">
							<xsl:for-each select="d:BkTxCd/d:Prtry[1]">
								<xsl:call-template name="outputBkTxCdPrtry"/><br/>
							</xsl:for-each>
							<xsl:for-each select="d:BkTxCd/d:Domn[1]">
								<xsl:call-template name="outputBkTxCdDomn"/><br/>
							</xsl:for-each>
							<xsl:if test="(string-length($btchNbOfTxs) = 0) and ($yksiTapahtuma = 1)">
								<xsl:for-each select="d:NtryDtls/d:TxDtls[1]/d:RltdPties[1]">
									<xsl:call-template name="outputRltdPtiesDbtrOrCdtr"/>
								</xsl:for-each>
							</xsl:if>
							<xsl:if test="string-length($btchNbOfTxs) != 0">
								<xsl:value-of select="$txtKpl"/><xsl:text> </xsl:text><xsl:value-of select="$btchNbOfTxs"/><br/>
							</xsl:if>
						</td>
						<td align="right">
							<xsl:value-of select="position()"/>
						</td>
						<td><br/></td>
						<td align="right">
							<xsl:value-of select="format-number(d:Amt,$patternRahasummat, 'rahasummat')" />
						</td>
						<td class="plusMiinus">
							<xsl:call-template name="outputCdtDbtInd">
								<xsl:with-param name="theCdtDbtInd" select="$theCdtDbtInd"/>
							</xsl:call-template>
						</td>
					</tr>
					<xsl:variable name="sContents">
						<xsl:if test="(string-length($btchNbOfTxs) = 0) and ($yksiTapahtuma = 1)">
							<xsl:for-each select="d:NtryDtls/d:TxDtls[1]">
								<xsl:call-template name="outputTxDtls_col3">
									<xsl:with-param name="onKorjaus" select="$onKorjaus"/>
								</xsl:call-template>
							</xsl:for-each>
						</xsl:if>
						<xsl:for-each select="d:AmtDtls/d:CntrValAmt[1]">
							<xsl:call-template name="outputCntrValAmt"/><br/>
						</xsl:for-each>
						<xsl:for-each select="d:Chrgs">
							<xsl:call-template name="outputChargesInformation6"/>
						</xsl:for-each>
						<xsl:if test="d:AddtlNtryInf">
							<xsl:value-of select="d:AddtlNtryInf"/>
						</xsl:if>
					</xsl:variable>
					<xsl:if test="string-length(normalize-space($sContents)) != 0">
						<tr>
							<td colspan="2"></td>
							<td colspan="4">
								<xsl:copy-of select="$sContents"/>
							</td>
							<td colspan="2"></td>
						</tr>
					</xsl:if>
					<xsl:if test="(string-length($btchNbOfTxs) != 0) or ($yksiTapahtuma = 0)">
						<xsl:for-each select="d:NtryDtls/d:TxDtls">
							<xsl:if test="d:AmtDtls">
								<xsl:call-template name="outputTxDtls">
									<xsl:with-param name="defaultCurrency" select="$defaultCurrency"/>
									<xsl:with-param name="theCdtDbtInd" select="$theCdtDbtInd"/>
									<xsl:with-param name="onKorjaus" select="$onKorjaus"/>
								</xsl:call-template>
							</xsl:if>
						</xsl:for-each>
					</xsl:if>
					<xsl:if test="position() = last()">
						<xsl:call-template name="outputBookgDtTotals">
							<xsl:with-param name="theDate" select="d:BookgDt/d:Dt"/>
						</xsl:call-template>
						<xsl:call-template name="outputTyhjaTapahtumarivi"/>
						<xsl:for-each select="preceding-sibling::d:Bal[d:Tp/d:CdOrPrtry/d:Cd='CLAV'][1]">
							<xsl:call-template name="outputSaldorivi">
								<xsl:with-param name="theTitle" select="$txtKayttovara"/>
							</xsl:call-template>
						</xsl:for-each>
						<xsl:call-template name="outputTyhjaTapahtumarivi"/>
						<xsl:for-each select="preceding-sibling::d:TxsSummry[1]">
							<xsl:call-template name="outputOtotPanotKplSummat">
								<xsl:with-param name="korosta" select="'K'"/>
							</xsl:call-template>
						</xsl:for-each>
					</xsl:if>
				</xsl:for-each>
			</tbody>
		</table>
	</xsl:template>
	
	<xsl:template name="outputAddtlStmtInf">
		<table class="Lisatiedot" cellpadding="0" cellspacing="0">
			<tbody>
				<tr>
					<td>
						<xsl:value-of select="."/>
					</td>
				</tr>
			</tbody>
		</table>
	</xsl:template>
	
	<xsl:template name="outputTyhjaTapahtumarivi">
		<tr>
			<td colspan="8"><br/></td>
		</tr>
	</xsl:template>
	
	<xsl:template name="outputChargesInformation6">
		<xsl:value-of select="$txtKulutPalkkiot"/>
		<xsl:if test="d:Tp/d:Cd">
			<xsl:text> (</xsl:text><xsl:value-of select="d:Tp/d:Cd"/><xsl:text>)</xsl:text>
		</xsl:if>
		<xsl:text>: </xsl:text>
		<xsl:call-template name="outputAmount">
			<xsl:with-param name="theAmount" select="d:Amt"/>
			<xsl:with-param name="theCurrency" select="d:Amt/@Ccy"/>
		</xsl:call-template>
		<br/>
	</xsl:template>
	
	<xsl:template name="outputCntrValAmt">
		<xsl:value-of select="$txtVastaarvo"/><xsl:text>: </xsl:text>
		<xsl:call-template name="outputAmount">
			<xsl:with-param name="theAmount" select="d:Amt"/>
			<xsl:with-param name="theCurrency" select="d:Amt/@Ccy"/>
		</xsl:call-template>
		<xsl:if test="d:CcyXchg">
			<br/><xsl:value-of select="$txtValuuttakurssi"/><xsl:text>: </xsl:text><xsl:value-of select="d:CcyXchg/d:XchgRate"/>
			<xsl:if test="d:CcyXchg/d:CtrctId">
				<br/><xsl:value-of select="$txtKurssiviite"/><xsl:text>: </xsl:text><xsl:value-of select="d:CcyXchg/d:CtrctId"/>
			</xsl:if>
			<xsl:variable name="sQtnDt" select="d:CcyXchg/d:QtnDt"/>
			<xsl:if test="string-length($sQtnDt) != 0">
				<br/><xsl:value-of select="$txtKurssimuunnoshetki"/><xsl:text>: </xsl:text>
				<xsl:call-template name="outputISODate">
					<xsl:with-param name="theDate" select="$sQtnDt"/>
				</xsl:call-template>
				<xsl:text> </xsl:text>
				<xsl:call-template name="outputISODateHhMm">
					<xsl:with-param name="theDate" select="$sQtnDt"/>
				</xsl:call-template>
			</xsl:if>
		</xsl:if>
	</xsl:template>

	<xsl:template name="outputTxDtls">
		<xsl:param name="defaultCurrency"/>
		<xsl:param name="theCdtDbtInd"/>
		<xsl:param name="onKorjaus"/>
		<tr class="erittely" valign="top">
			<td class="eka" colspan="2">
				<xsl:for-each select="d:RltdPties/d:CdtrAcct[1]">
					<xsl:call-template name="outputCashAccount16">
						<xsl:with-param name="tilinTyyppi" select="'st'"/>
					</xsl:call-template>
				</xsl:for-each>
			</td>
			<td colspan="2">
				<xsl:for-each select="d:BkTxCd/d:Prtry[1]">
					<xsl:call-template name="outputBkTxCdPrtry"/><br/>
				</xsl:for-each>
				<xsl:for-each select="d:BkTxCd/d:Domn[1]">
					<xsl:call-template name="outputBkTxCdDomn"/><br/>
				</xsl:for-each>
				<xsl:for-each select="d:RltdPties[1]">
					<xsl:call-template name="outputRltdPtiesDbtrOrCdtr"/>
				</xsl:for-each>
			</td>
			<td colspan="3" align="right" class="erittely">
				<xsl:for-each select="d:AmtDtls[1]">
					<xsl:call-template name="outputAmountFromAmtDtls">
						<xsl:with-param name="defaultCurrency" select="$defaultCurrency"/>
					</xsl:call-template>
				</xsl:for-each>
				<xsl:text> </xsl:text>
				<xsl:call-template name="outputCdtDbtInd">
					<xsl:with-param name="theCdtDbtInd" select="$theCdtDbtInd"/>
				</xsl:call-template>
			</td>
			<td></td>
		</tr>
		<xsl:variable name="sContents">
			<xsl:call-template name="outputTxDtls_col3">
				<xsl:with-param name="onKorjaus" select="$onKorjaus"/>
			</xsl:call-template>
		</xsl:variable>
		<xsl:if test="string-length(normalize-space($sContents)) != 0">
			<tr class="erittely" valign="top">
				<td colspan="2"></td>
				<td colspan="4">
					<xsl:copy-of select="$sContents"/>
				</td>
				<td colspan="2"></td>
			</tr>
		</xsl:if>
	</xsl:template>

	<xsl:template name="outputTxDtls_col3">
		<xsl:param name="onKorjaus"/>
		<xsl:for-each select="d:RltdQties/d:Qty/d:Unit[1]">
			<xsl:value-of select="$txtKpl"/><xsl:text> </xsl:text><xsl:value-of select="."/><br/>
		</xsl:for-each>
		<xsl:for-each select="d:RmtInf/d:Strd/d:CdtrRefInf[1]">
			<xsl:call-template name="outputCdtrRefInf_br"/>
		</xsl:for-each>
		<xsl:for-each select="d:RmtInf/d:Ustrd">
			<xsl:value-of select="."/><br/>
		</xsl:for-each>
		<xsl:for-each select="d:RmtInf/d:Strd">
			<xsl:call-template name="outputLaskunTiedot"/>
		</xsl:for-each>
		<xsl:for-each select="d:Refs">
			<xsl:call-template name="outputTxDtls_Refs_KortinTiedot"/>
		</xsl:for-each>
		<xsl:variable name="sEndToEndId" select="d:Refs/d:EndToEndId"/>
		<xsl:if test="string-length($sEndToEndId) != 0">
			<xsl:choose>
				<xsl:when test="$onKorjaus = 1">
					<xsl:value-of select="$txtAlkupArktun"/><xsl:text>:</xsl:text><br/>
					<xsl:call-template name="outputGrouped">
						<xsl:with-param name="theStr" select="$sEndToEndId"/>
						<xsl:with-param name="lenGroup" select="'5'"/>
					</xsl:call-template>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="$txtToimeksiantajanTieto"/><xsl:text>:</xsl:text><br/>
					<xsl:value-of select="$sEndToEndId"/>
				</xsl:otherwise>
			</xsl:choose>
			<br/>
		</xsl:if>
		<xsl:variable name="sInstrId" select="d:Refs/d:InstrId"/>
		<xsl:if test="string-length($sInstrId) != 0">
			<xsl:choose>
				<xsl:when test="$onKorjaus = 1">
					<xsl:value-of select="$txtAlkupArktun"/><xsl:text>:</xsl:text><br/>
					<xsl:call-template name="outputGrouped">
						<xsl:with-param name="theStr" select="$sInstrId"/>
						<xsl:with-param name="lenGroup" select="'5'"/>
					</xsl:call-template>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="$txtToimeksiantajanTieto"/><xsl:text>:</xsl:text><br/>
					<xsl:value-of select="$sInstrId"/>
				</xsl:otherwise>
			</xsl:choose>
			<br/>
		</xsl:if>
		<xsl:variable name="sPurpCd" select="d:Purp/d:Cd"/>
		<xsl:if test="string-length($sPurpCd) != 0">
			<xsl:value-of select="$txtMaksunaihekoodi"/><xsl:text>: </xsl:text><xsl:value-of select="$sPurpCd"/><br/>
		</xsl:if>
		<xsl:variable name="sPurpPrtry" select="d:Purp/d:Prtry"/>
		<xsl:if test="string-length($sPurpPrtry) != 0">
			<xsl:value-of select="$txtMaksunaihe"/><xsl:text>: </xsl:text><xsl:value-of select="$sPurpPrtry"/><br/>
		</xsl:if>
		<xsl:for-each select="d:Chrgs">
			<xsl:call-template name="outputChargesInformation6"/>
		</xsl:for-each>
		<xsl:if test="d:AddtlTxInf">
			<xsl:value-of select="d:AddtlTxInf"/>
		</xsl:if>
	</xsl:template>
	
	<xsl:template name="outputTxDtls_Refs_KortinTiedot">
		<xsl:variable name="sKortti" select="d:Prtry/d:Tp"/>
		<xsl:if test="string-length($sKortti) != 0">
			<xsl:value-of select="$txtKortinNro"/><xsl:text>: </xsl:text><xsl:value-of select="$sKortti"/><br/>
		</xsl:if>
		<xsl:variable name="sViite" select="d:Prtry/d:Ref"/>
		<xsl:if test="string-length($sViite) != 0">
			<xsl:value-of select="$txtKaupanViite"/><xsl:text>: </xsl:text><xsl:value-of select="$sViite"/><br/>
		</xsl:if>
	</xsl:template>
	
	<xsl:template name="outputLaskunTiedot">
		<xsl:variable name="sLaskuttaja" select="d:Invcr/d:Id/d:OrgId/d:Othr/d:SchmeNm/d:Prtry"/>
		<xsl:if test="string-length($sLaskuttaja) != 0">
			<xsl:value-of select="$txtLaskuttajanAsnro"/><xsl:text>: </xsl:text><xsl:value-of select="$sLaskuttaja"/><br/>
		</xsl:if>
		<xsl:variable name="sLaskutettava" select="d:Invcee/d:Id/d:OrgId/d:Othr/d:Id"/>
		<xsl:if test="string-length($sLaskutettava) != 0">
			<xsl:value-of select="$txtLaskutettavanAsnro"/><xsl:text>: </xsl:text><xsl:value-of select="$sLaskutettava"/><br/>
		</xsl:if>
		<xsl:variable name="sLaskunro" select="d:RfrdDocInf/d:Nb"/>
		<xsl:if test="string-length($sLaskunro) != 0">
			<xsl:value-of select="$txtLaskunNro"/><xsl:text>: </xsl:text><xsl:value-of select="$sLaskunro"/><br/>
		</xsl:if>
		<xsl:variable name="sLaskupvm" select="d:RfrdDocInf/d:RltdDt"/>
		<xsl:if test="string-length($sLaskupvm) != 0">
			<xsl:value-of select="$txtLaskunPvm"/><xsl:text>: </xsl:text>
			<xsl:call-template name="outputISODate">
				<xsl:with-param name="theDate" select="$sLaskupvm"/>
			</xsl:call-template>
			<br/>
		</xsl:if>
	</xsl:template>
	
	<xsl:template name="outputAmountFromAmtDtls">
		<xsl:param name="defaultCurrency"/>
		<xsl:choose>
			<xsl:when test="d:TxAmt">
				<xsl:call-template name="outputAmount">
					<xsl:with-param name="theAmount" select="d:TxAmt/d:Amt"/>
					<xsl:with-param name="theCurrency" select="d:TxAmt/d:Amt/@Ccy"/>
					<xsl:with-param name="defaultCurrency" select="$defaultCurrency"/>
				</xsl:call-template>
			</xsl:when>
			<xsl:when test="d:InstdAmt">
				<xsl:call-template name="outputAmount">
					<xsl:with-param name="theAmount" select="d:InstdAmt/d:Amt"/>
					<xsl:with-param name="theCurrency" select="d:InstdAmt/d:Amt/@Ccy"/>
					<xsl:with-param name="defaultCurrency" select="$defaultCurrency"/>
				</xsl:call-template>
			</xsl:when>
		</xsl:choose>
	</xsl:template>

	<xsl:template name="outputAmount">
		<xsl:param name="theAmount"/>
		<xsl:param name="theCurrency"/>
		<xsl:param name="defaultCurrency"/>
		<xsl:if test="string-length($theAmount) != 0">
			<xsl:if test="$theCurrency != $defaultCurrency">
				<xsl:value-of select="$theCurrency"/><span class="valuuttaJaSumma"></span>
			</xsl:if>
			<xsl:value-of select="format-number($theAmount, $patternRahasummat, 'rahasummat')" />
		</xsl:if>
	</xsl:template>

	<xsl:template name="outputCdtrRefInf_br">
		<xsl:variable name="strRef" select="d:Ref"/>
		<xsl:if test="string-length($strRef) != 0">
			<xsl:value-of select="$txtViite"/><xsl:text>: </xsl:text><xsl:value-of select="$strRef"/><br/>
		</xsl:if>
	</xsl:template>

	<xsl:template name="outputRltdPtiesDbtrOrCdtr">
		<xsl:choose>
			<xsl:when test="string-length(d:Dbtr/d:Nm) != 0">
				<xsl:for-each select="d:Dbtr[1]">
					<xsl:call-template name="outputPartyIdentification32"/>
				</xsl:for-each>
				<xsl:for-each select="d:UltmtDbtr[1]">
					<xsl:call-template name="outputPartyIdentification32"/>
				</xsl:for-each>
			</xsl:when>
			<xsl:when test="string-length(d:Cdtr/d:Nm) != 0">
				<xsl:for-each select="d:Cdtr[1]">
					<xsl:call-template name="outputPartyIdentification32"/>
				</xsl:for-each>
				<xsl:for-each select="d:UltmtCdtr[1]">
					<xsl:call-template name="outputPartyIdentification32"/>
				</xsl:for-each>
			</xsl:when>
		</xsl:choose>
	</xsl:template>

	<xsl:template name="outputPartyIdentification32">
		<xsl:value-of select="d:Nm"/><br/>
		<xsl:for-each select="d:PstlAdr[1]">
			<xsl:call-template name="outputPostalAddress6">
				<xsl:with-param name="countryTitle" select="$txtMaakoodi"/>
			</xsl:call-template>
		</xsl:for-each>
	</xsl:template>

	<xsl:template name="outputBkTxCdPrtry">
		<xsl:variable name="sCd" select="d:Cd"/>
		<xsl:if test="string-length($sCd) &gt; 0">
			<xsl:variable name="chr1" select="substring($sCd,1,1)"/>
			<xsl:choose>
				<xsl:when test="(string-length($sCd) &gt; 3) and ($chr1 &gt;= '0') and ($chr1 &lt;= '9')">
					<!-- 999TEXT-->
					<xsl:value-of select="substring($sCd,1,3)"/><xsl:text> </xsl:text><xsl:value-of select="substring($sCd, 4)"/>
				</xsl:when>
				<xsl:when test="(string-length($sCd) &gt; 7) and ($chr1='N') and (substring($sCd,5,1)='+')">
					<!-- Nyyy+999TEXT -->
					<xsl:value-of select="substring($sCd,6,3)"/><xsl:text> </xsl:text><xsl:value-of select="substring($sCd, 9)"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="$sCd"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
	</xsl:template>

	<xsl:template name="outputBkTxCdDomn">
		<xsl:value-of select="d:Cd"/><xsl:text>-</xsl:text><xsl:value-of select="d:Fmly/d:Cd"/><xsl:text>-</xsl:text><xsl:value-of select="d:Fmly/d:SubFmlyCd"/>
	</xsl:template>

	<xsl:template name="outputCashAccount16">
		<xsl:param name="tilinTyyppi"/>
		<xsl:variable name="strIBAN" select="d:Id/d:IBAN"/>
		<xsl:variable name="strBBAN" select="d:Id/d:Othr/d:Id"/>
		<xsl:variable name="tulostetaan" select="string-length($strIBAN) + string-length($strBBAN)"/>
		<xsl:if test="($tulostetaan != 0) and ($tilinTyyppi = 'st')">
			<span class="sisennaSaajanTili"></span>
		</xsl:if>
		<xsl:choose>
			<xsl:when test="string-length($strIBAN) != 0">
				<xsl:call-template name="outputGrouped">
					<xsl:with-param name="theStr" select="$strIBAN"/>
					<xsl:with-param name="lenGroup" select="'4'"/>
				</xsl:call-template>
			</xsl:when>
			<xsl:when test="string-length($strBBAN) = 14">
				<xsl:value-of select="substring($strBBAN, 1, 6)"/><xsl:text>-</xsl:text><xsl:value-of select="substring($strBBAN, 7)"/>
			</xsl:when>
			<xsl:when test="string-length($strBBAN) != 0">
				<xsl:value-of select="$strBBAN"/>
			</xsl:when>
		</xsl:choose>
		<xsl:if test="($tulostetaan != 0) and ($tilinTyyppi = 'st') and (d:Tp/d:Prtry = 'ACWC')">
			<xsl:text> (ACWC)</xsl:text>
		</xsl:if>
	</xsl:template>

	<xsl:template name="outputBookgDtTotals">
		<xsl:param name="theDate"/>
		<xsl:for-each select="preceding-sibling::d:Bal[d:Tp/d:CdOrPrtry/d:Cd='CLBD' and d:Dt/d:Dt=$theDate][1]">
			<xsl:call-template name="outputSaldorivi">
				<xsl:with-param name="theTitle" select="$txtSaldo"/>
			</xsl:call-template>
		</xsl:for-each>
	</xsl:template>

	<xsl:template name="outputOtotPanotKplSummat">
		<xsl:param name="korosta"/>
		<xsl:call-template name="outputKplSumma">
			<xsl:with-param name="otsikko"  select="$txtPanotYhtKpl"/>
			<xsl:with-param name="kpl"  select="d:TtlCdtNtries/d:NbOfNtries"/>
			<xsl:with-param name="summa"  select="d:TtlCdtNtries/d:Sum"/>
			<xsl:with-param name="plusMiinus"  select="'+'"/>
			<xsl:with-param name="korosta"  select="$korosta"/>
		</xsl:call-template>
		<xsl:call-template name="outputKplSumma">
			<xsl:with-param name="otsikko"  select="$txtOtotYhtKpl"/>
			<xsl:with-param name="kpl"  select="d:TtlDbtNtries/d:NbOfNtries"/>
			<xsl:with-param name="summa"  select="d:TtlDbtNtries/d:Sum"/>
			<xsl:with-param name="plusMiinus"  select="'-'"/>
			<xsl:with-param name="korosta"  select="$korosta"/>
		</xsl:call-template>
	</xsl:template>

	<xsl:template name="outputKplSumma">
		<xsl:param name="otsikko"/>
		<xsl:param name="kpl"/>
		<xsl:param name="summa"/>
		<xsl:param name="plusMiinus"/>
		<xsl:param name="korosta"/>
		<xsl:if test="$kpl != '0'">
			<tr>
				<td class="eka" colspan="2"><br/></td>
				<td>
					<xsl:if test="string-length($korosta) != 0">
						<xsl:attribute name="class">lihavoitu</xsl:attribute>
					</xsl:if>
					<xsl:value-of select="$otsikko"/>
				</td>
				<td align="right">
					<xsl:if test="string-length($korosta) != 0">
						<xsl:attribute name="class">lihavoitu</xsl:attribute>
					</xsl:if>
					<xsl:value-of select="$kpl"/>
				</td>
				<td colspan="3" align="right">
					<xsl:if test="string-length($korosta) != 0">
						<xsl:attribute name="class">lihavoitu</xsl:attribute>
					</xsl:if>
					<xsl:value-of select="format-number($summa,$patternRahasummat, 'rahasummat')" />
				</td>
				<td class="plusMiinus">
					<xsl:if test="string-length($korosta) != 0">
						<xsl:attribute name="class">plusMiinus lihavoitu</xsl:attribute>
					</xsl:if>
					<xsl:value-of select="$plusMiinus"/>
				</td>
			</tr>
		</xsl:if>
	</xsl:template>

	<xsl:template name="outputSaldorivi">
		<xsl:param name="theTitle"/>
		<tr>
			<td class="eka lihavoitu" colspan="7" align="right">
				<xsl:call-template name="outputBal">
					<xsl:with-param name="theTitle" select="$theTitle"/>
				</xsl:call-template>
			</td>
			<td class="plusMiinus lihavoitu">
				<xsl:call-template name="outputCdtDbtInd">
					<xsl:with-param name="theCdtDbtInd" select="d:CdtDbtInd"/>
				</xsl:call-template>
			</td>
		</tr>
		<xsl:variable name="cdtLineIncl" select="d:CdtLine/d:Incl"/>
		<xsl:if test="($cdtLineIncl = 'true') or ($cdtLineIncl = '1')">
			<tr>
				<td class="eka lihavoitu" colspan="7" align="right">
					<xsl:value-of select="$txtLimiitti"/>
					<span class="pvmJaSumma"></span>
					<xsl:value-of select="format-number(d:CdtLine/d:Amt,$patternRahasummat, 'rahasummat')" />
				</td>
				<td class="plusMiinus lihavoitu">
					<xsl:call-template name="outputCdtDbtInd">
						<xsl:with-param name="theCdtDbtInd" select="d:CdtDbtInd"/>
					</xsl:call-template>
				</td>
			</tr>
		</xsl:if>
	</xsl:template>

	<xsl:template name="outputBal">
		<xsl:param name="theTitle"/>
		<xsl:value-of select="$theTitle"/><xsl:text> </xsl:text>
		<xsl:call-template name="outputISODate">
			<xsl:with-param name="theDate" select="d:Dt/d:Dt"/>
		</xsl:call-template>
		<span class="pvmJaSumma"></span>
		<xsl:value-of select="format-number(d:Amt,$patternRahasummat, 'rahasummat')" />
	</xsl:template>

	<xsl:template name="outputCdtDbtInd">
		<xsl:param name="theCdtDbtInd"/>
		<xsl:choose>
			<xsl:when test="$theCdtDbtInd = 'CRDT'">
				<xsl:text>+</xsl:text>
			</xsl:when>
			<xsl:when test="$theCdtDbtInd = 'DBIT'">
				<xsl:text>-</xsl:text>
			</xsl:when>
		</xsl:choose>
	</xsl:template>

	<xsl:template name="outputStmtSeparator">
		<div class="StmtSeparator"></div>
	</xsl:template>

	<xsl:template name="outputPostalAddress6">
		<xsl:param name="countryTitle"/>
		<xsl:for-each select="d:Dept">
			<xsl:value-of select="."/><br/>
		</xsl:for-each>
		<xsl:for-each select="d:SubDept">
			<xsl:value-of select="."/><br/>
		</xsl:for-each>
		<xsl:if test="string-length(d:StrtNm) != 0">
			<xsl:value-of select="d:StrtNm"/><xsl:text> </xsl:text><xsl:value-of select="d:BldgNb"/><br/>
		</xsl:if>
		<xsl:if test="(string-length(d:PstCd) != 0) or (string-length(d:TwnNm) != 0)">
			<xsl:choose>
				<xsl:when test="string-length(d:PstCd) = 0">
					<xsl:value-of select="d:TwnNm"/>
				</xsl:when>
				<xsl:when test="string-length(d:TwnNm) = 0">
					<xsl:value-of select="d:PstCd"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="d:PstCd"/><xsl:text> </xsl:text><xsl:value-of select="d:TwnNm"/>
				</xsl:otherwise>
			</xsl:choose>
			<br/>
		</xsl:if>
		<xsl:for-each select="d:AdrLine">
			<xsl:value-of select="."/><br/>
		</xsl:for-each>
		<xsl:if test="(string-length($countryTitle) != 0) and (string-length(d:Ctry) != 0) and (d:Ctry != 'FI') and (d:Ctry != 'fi')">
			<xsl:value-of select="$countryTitle"/><xsl:text>: </xsl:text><xsl:value-of select="d:Ctry"/><br/>
		</xsl:if>
	</xsl:template>

	<xsl:template name="outputISODate">
		<xsl:param name="theDate"/>
		<xsl:if test="string-length($theDate) &gt; 9">
			<xsl:call-template name="outputInt2">
				<xsl:with-param name="theInt" select="substring($theDate,9,2)"/>
			</xsl:call-template>
			<xsl:text>.</xsl:text>
			<xsl:call-template name="outputInt2">
				<xsl:with-param name="theInt" select="substring($theDate,6,2)"/>
			</xsl:call-template>
			<xsl:text>.</xsl:text>
			<xsl:value-of select="substring($theDate,1,4)"/>
		</xsl:if>
	</xsl:template>

	<xsl:template name="outputISODateDDMM">
		<xsl:param name="theDate"/>
		<xsl:if test="string-length($theDate) &gt; 9">
			<xsl:value-of select="substring($theDate,9,2)"/><xsl:value-of select="substring($theDate,6,2)"/>
		</xsl:if>
	</xsl:template>

	<xsl:template name="outputISODateHhMm">
		<xsl:param name="theDate"/>
		<xsl:if test="string-length($theDate) &gt; 15">
			<xsl:value-of select="substring($theDate,12,5)"/>
		</xsl:if>
	</xsl:template>

	<xsl:template name="outputInt2">
		<xsl:param name="theInt"/>
		<xsl:choose>
			<xsl:when test="substring($theInt,1,1) = '0'">
				<xsl:value-of select="substring($theInt,2,1)"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="substring($theInt,1,2)"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<xsl:template name="outputGrouped">
		<xsl:param name="theStr"/>
		<xsl:param name="lenGroup"/>
		<xsl:variable name="lenStr" select="string-length($theStr)"/>
		<xsl:choose>
			<xsl:when test="$lenStr &lt; ($lenGroup + 1)">
				<xsl:value-of select="$theStr"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="substring($theStr, 1, $lenGroup)"/>
				<xsl:text> </xsl:text>
				<xsl:call-template name="outputGrouped">
					<xsl:with-param name="theStr" select="substring($theStr,$lenGroup+1)"/>
					<xsl:with-param name="lenGroup" select="$lenGroup"/>
				</xsl:call-template>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
</xsl:stylesheet>

