<?xml version="1.0"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:saxon="http://saxon.sf.net/" extension-element-prefixes="saxon" xmlns:daxtor="http://nowww.com/">
	<xsl:import href="/home/webapp/applications/system/resources/xsl/daxtor.xsl"/>
	<xsl:output method="text" encoding="UTF-8" indent="no"/>
	<xsl:output method="text" encoding="UTF-8" name="index"/>

	<!-- init global variables -->
	<xsl:variable name="counter" select="0" saxon:assignable="yes"/>
	<xsl:variable name="oid_position" select="0" saxon:assignable="yes"/>

	<!-- init global constants -->
	<xsl:variable name="file_reference_index" select="fn:concat(/investment/dep_bank/param[key_name='PATH']/key_value,/investment/dep_bank/param[key_name='FILE_REFERENCE_IDX']/key_value)"/>

	<!-- start section -->
	<xsl:template match="/">

		<!-- write output file -->
	
		<!-- select all position elements -->
		<xsl:for-each select="/investment/position">
			<!-- sorting customer_dipostion_id  ascending -->
			<xsl:sort select="./detail/order_no" order="ascending"/>

			<xsl:choose>
				<!-- order -->
				<xsl:when test="./detail/object_type='CUST_DISP'">

					<xsl:call-template name="build_record_SOT"/>

					<!-- relation header -->
					<xsl:if test="./relation/header[belongs_to_1_subject_only = 'false']">
						<xsl:variable name="oid_role" select="/investment/dep_bank/mapping[key_name = 'MEMBER_ROLE' and value = 'I']/key_value"/>

					    <xsl:for-each select="./relation/member"> 
							<xsl:if test="./detail[oid_role = $oid_role]">
								<xsl:call-template name="build_record_AN0C"/>
								<xsl:call-template name="build_record_AN2"/>
							</xsl:if>
						</xsl:for-each>
					</xsl:if>

					<xsl:for-each select="./relation/member">
						<xsl:call-template name="build_record_AN0I"/>
						<xsl:call-template name="build_record_AN1"/>
						<xsl:call-template name="build_record_AN2"/>
						<xsl:call-template name="build_record_AN3"/>
					</xsl:for-each>

					<xsl:choose>
						<xsl:when test="daxtor:readArrangeRecordsCode(/investment,.) = '1T_SUBSCRIPTION'"> 
							<xsl:call-template name="build_record_MO0"/>
							<xsl:call-template name="build_record_MO7"/>
							<xsl:call-template name="build_record_MO6"/>
						</xsl:when>
						<xsl:when test="daxtor:readArrangeRecordsCode(/investment,.) = 'ADD_SUBSCRIPTION'"> 
							<xsl:call-template name="build_record_MO0"/>
							<xsl:call-template name="build_record_MO7"/>
							<xsl:call-template name="build_record_MO6"/>
						</xsl:when>
						<xsl:when test="daxtor:readArrangeRecordsCode(/investment,.) = 'SWITCH'"> 
							<xsl:call-template name="build_record_MO0"/>
			 			    <xsl:for-each select="./switch_in/position">
								<xsl:call-template name="build_record_MO0"/>
							</xsl:for-each>
			
						</xsl:when>
						<xsl:when test="daxtor:readArrangeRecordsCode(/investment,.) = 'REDEMPTION'"> 
							<xsl:call-template name="build_record_MO0"/>
							<xsl:call-template name="build_record_MO7"/>
						</xsl:when>
				
					</xsl:choose>

				</xsl:when>
			</xsl:choose>
		</xsl:for-each>


		<!-- write index file -->
		<!-- select all position elements -->
		<saxon:assign name="counter" select="0"/>
		<xsl:result-document href="{$file_reference_index}" format="index">
			<xsl:for-each select="/investment/position">
				<!-- sorting customer_dipostion_id  ascending -->
				<xsl:sort select="./detail/order_no" order="ascending"/>

				<xsl:choose>
					<!-- order -->
					<xsl:when test="./detail/object_type='CUST_DISP'">
						<saxon:assign name="oid_position" select="./detail/oid_position"/>

						<xsl:call-template name="build_record_index"/>

						<!-- relation header -->
						<xsl:if test="./relation/header[belongs_to_1_subject_only = 'false']">
							<xsl:variable name="oid_role" select="/investment/dep_bank/mapping[key_name = 'MEMBER_ROLE' and value = 'I']/key_value"/>

						    <xsl:for-each select="./relation/member"> 
								<xsl:if test="./detail[oid_role = $oid_role]">
									<xsl:call-template name="build_record_index"/>
									<xsl:call-template name="build_record_index"/>
								</xsl:if>
							</xsl:for-each>
						</xsl:if>

						<xsl:for-each select="./relation/member">
							<xsl:call-template name="build_record_index"/>
							<xsl:call-template name="build_record_index"/>
							<xsl:call-template name="build_record_index"/>
							<xsl:call-template name="build_record_index"/>
						</xsl:for-each>

						<xsl:choose>
							<xsl:when test="daxtor:readArrangeRecordsCode(/investment,.) = '1T_SUBSCRIPTION'"> 
								<xsl:call-template name="build_record_index"/>
								<xsl:call-template name="build_record_index"/>
								<xsl:call-template name="build_record_index"/>
							</xsl:when>
							<xsl:when test="daxtor:readArrangeRecordsCode(/investment,.) = 'ADD_SUBSCRIPTION'"> 
								<xsl:call-template name="build_record_index"/>
								<xsl:call-template name="build_record_index"/>
								<xsl:call-template name="build_record_index"/>
							</xsl:when>
							<xsl:when test="daxtor:readArrangeRecordsCode(/investment,.) = 'SWITCH'"> 
								<xsl:call-template name="build_record_index"/>
				 			    <xsl:for-each select="./switch_in/position">
									<xsl:call-template name="build_record_index"/>
								</xsl:for-each>
			
							</xsl:when>
							<xsl:when test="daxtor:readArrangeRecordsCode(/investment,.) = 'REDEMPTION'"> 
								<xsl:call-template name="build_record_index"/>
								<xsl:call-template name="build_record_index"/>
							</xsl:when>
				
						</xsl:choose>
						

					</xsl:when>
				</xsl:choose>
			</xsl:for-each>
		</xsl:result-document>
	</xsl:template>

	<!-- build record SOT -->
	<xsl:template name="build_record_SOT">
		<xsl:variable name="oid_prod_company" select="fn:string(./product/oid_prod_company)"/>
		<xsl:variable name="oid_product" select="fn:string(./product/oid_product)"/>
	
		<saxon:assign name="counter" select="$counter+1"/>

		<!-- 1  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/sending[1]/send_number[1]),7,'0')"/>
		<!-- 2  -->
		<xsl:value-of select="daxtor:lPad(fn:string($counter),7,'0')"/>
		<!-- 3  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/dep_bank/mapping[key_name = 'PRODUCT_EXTERNAL_KEY2' and key_value = $oid_product]/value),5,'0')"/>
		<!-- 4  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/dep_bank/param[key_name='DISTRIBUTOR_CODE']/key_value),5,'0')"/>
		<!-- 5  -->
		<xsl:value-of select="daxtor:lPad('0',11,'0')"/>
		<!-- 6  -->
		<xsl:value-of select="daxtor:rPad(fn:string(./contract/mandat_leader_reference),25)"/>
		<!-- 7  -->
		<xsl:text>SOT</xsl:text>
		<!-- 8  -->
		<xsl:value-of select="daxtor:lPad('0',11,'0')"/>
		<!-- 9  -->
		<xsl:value-of select="daxtor:lPad('0',11,'0')"/>
		<!-- 10  -->
		<xsl:value-of select="daxtor:rPad('',16)"/>
		<!-- 11  -->
		<xsl:value-of select="daxtor:lPad('0',11,'0')"/>
		<!-- 12  -->
		<xsl:value-of select="daxtor:rPad('',16)"/>
		<!-- 13  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/dep_bank/param[key_name='DISTRIBUTOR_CODE']/key_value),5,'0')"/>
		<!-- 14  -->
		<xsl:value-of select="daxtor:lPad('0',11,'0')"/>
		<!-- 15  -->
		<xsl:value-of select="daxtor:rPad('',16)"/>
		<!-- 16  -->
		<xsl:text>N</xsl:text>
		<!-- 17  -->
		<xsl:value-of select="daxtor:rPad(' ',3)"/>
		<!-- 18  -->
		<xsl:value-of select="daxtor:rPad('',1)"/>
		<!-- 19  -->
		<xsl:value-of select="daxtor:rPad(fn:string(./contract/mandat_leader_reference),25)"/>
		<!-- 20  -->
		<xsl:value-of select="daxtor:rPad('',8)"/>
		<!-- 21  -->
		<xsl:value-of select="daxtor:rPad('',1)"/>
		<!-- 22  -->
		<xsl:value-of select="daxtor:rPad('',26)"/>
		<!-- 23  -->
		<xsl:value-of select="daxtor:rPad('OA',2)"/>
		<!-- 24  -->
		<xsl:value-of select="daxtor:rPad('',1)"/>
		<!-- 25  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/dep_bank/param[key_name='DISTRIBUTOR_CODE']/key_value),7,'0')"/>
		<!-- 26  -->
		<xsl:value-of select="daxtor:rPad('',164)"/>
		<!-- 27  -->
		<xsl:text>*</xsl:text>


		<xsl:text>REPLACEMENT_NEW_LINE</xsl:text>

	</xsl:template>

	<!-- build record AN0C -->
	<xsl:template name="build_record_AN0C">
		<xsl:variable name="oid_product" select="fn:string(../../product/oid_product)"/>
		<xsl:variable name="signature" select="fn:string(../../contract/signature)"/>
		<xsl:variable name="operative_country" select="fn:string(./addresses/operative/nation_iso)"/>
		<xsl:variable name="fiscally_country" select="fn:string(./addresses/fiscally/nation_iso)"/>

		<saxon:assign name="counter" select="$counter+1"/>

		<!-- 1  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/sending[1]/send_number[1]),7,'0')"/>
		<!-- 2  -->
		<xsl:value-of select="daxtor:lPad(fn:string($counter),7,'0')"/>
		<!-- 3  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/dep_bank/mapping[key_name = 'PRODUCT_EXTERNAL_KEY2' and key_value = $oid_product]/value),5,'0')"/>
		<!-- 4  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/dep_bank/param[key_name='DISTRIBUTOR_CODE']/key_value),5,'0')"/>
		<!-- 5  -->
		<xsl:value-of select="daxtor:lPad('0',11,'0')"/>
		<!-- 6  -->
		<xsl:value-of select="daxtor:rPad(fn:string(../../contract/mandat_leader_reference),25)"/>
		<!-- 7  -->
		<xsl:text>AN0</xsl:text>
		<!-- 8 -->
		<xsl:value-of select="daxtor:rPad('',1)"/>
		<!-- 9 -->
		<xsl:value-of select="daxtor:rPad('',3)"/>
		<!-- 10 -->
		<xsl:value-of select="daxtor:rPad('N',1)"/>
		<!-- 11 -->
		<xsl:value-of select="daxtor:rPad('',15)"/>
		<!-- 12 -->
		<xsl:value-of select="daxtor:rPad(fn:upper-case(fn:string(../header/description)),60)"/>
		<!-- 13 -->
		<xsl:value-of select="daxtor:rPad('',60)"/>
		<!-- 14 -->
		<xsl:value-of select="daxtor:rPad('C',1)"/>
		<!-- 15 -->
		<xsl:value-of select="daxtor:rPad('',8)"/>
		<!-- 16 -->
		<xsl:value-of select="daxtor:rPad('',1)"/>
		<!-- 17 -->
		<xsl:value-of select="daxtor:rPad(fn:string(/investment/dep_bank/mapping[key_name = 'SIGNATURE' and key_value = $signature]/value),1)"/>
		<!-- 18 -->
		<xsl:value-of select="daxtor:rPad(fn:string(./addresses/operative/nation_iso),3)"/>
		<!-- 19 -->
		<xsl:value-of select="daxtor:rPad(daxtor:translateCRESFIS($operative_country,$fiscally_country),3)"/>
		<!-- 20 -->
		<xsl:value-of select="daxtor:lPad('',11,'0')"/>
		<!-- 21 -->
		<xsl:value-of select="daxtor:rPad('',16)"/>
		<!-- 22 -->
		<xsl:value-of select="daxtor:lPad('',3,'0')"/>
		<!-- 23 -->
		<xsl:value-of select="daxtor:lPad('',3,'0')"/>
		<!-- 24 -->
		<xsl:value-of select="daxtor:lPad('',3,'0')"/>
		<!-- 25 -->
		<xsl:value-of select="daxtor:rPad('',3)"/>
		<!-- 26 -->
		<xsl:value-of select="daxtor:rPad('',140)"/>
		<!-- 27  -->
		<xsl:text>*</xsl:text>


		<xsl:text>REPLACEMENT_NEW_LINE</xsl:text>

	</xsl:template>

	<!-- build record AN0I -->
	<xsl:template name="build_record_AN0I">
		<xsl:variable name="oid_prod_company" select="fn:string(../../product/oid_prod_company)"/>
	    <xsl:variable name="oid_role" select="fn:string(./detail/oid_role)"/>
		<xsl:variable name="belongs_to_1_subject_only" select="fn:string(../header/belongs_to_1_subject_only)"/>
		<!-- obsolete
		<xsl:variable name="member_type" select="fn:string(../header/belongs_to_1_subject_only)"/>
		-->
		<xsl:variable name="oid_product" select="fn:string(../../product/oid_product)"/>
		<xsl:variable name="signature" select="fn:string(../../contract/signature)"/>
		<xsl:variable name="subject_type" select="fn:string(./detail/subject_type)"/>
		<xsl:variable name="operative_country" select="fn:string(./addresses/operative/nation_iso)"/>
		<xsl:variable name="fiscally_country" select="fn:string(./addresses/fiscally/nation_iso)"/>

		<saxon:assign name="counter" select="$counter+1"/>

		<!-- 1  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/sending[1]/send_number[1]),7,'0')"/>
		<!-- 2  -->
		<xsl:value-of select="daxtor:lPad(fn:string($counter),7,'0')"/>
		<!-- 3  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/dep_bank/mapping[key_name = 'PRODUCT_EXTERNAL_KEY2' and key_value = $oid_product]/value),5,'0')"/>
		<!-- 4  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/dep_bank/param[key_name='DISTRIBUTOR_CODE']/key_value),5,'0')"/>
		<!-- 5  -->
		<xsl:value-of select="daxtor:lPad('0',11,'0')"/>
		<!-- 6  -->
		<xsl:value-of select="daxtor:rPad(fn:string(../../contract/mandat_leader_reference),25)"/>
		<!-- 7  -->
		<xsl:text>AN0</xsl:text>
		<!-- 8 -->
		<xsl:value-of select="daxtor:rPad(fn:string(/investment/dep_bank/mapping[key_name = 'MEMBER_ROLE' and key_value = $oid_role]/value),1)"/>
		<!-- 9 -->
		<xsl:value-of select="daxtor:rPad(daxtor:translateCLEG($belongs_to_1_subject_only,fn:string(/investment/dep_bank/mapping[key_name = 'MEMBER_TYPE' and key_value = $oid_role]/value)),3)"/>
		<!-- 10 -->
		<xsl:value-of select="daxtor:rPad('N',1)"/>
		<!-- 11 -->
		<xsl:value-of select="daxtor:rPad('',15)"/>
		<!-- 12 -->
		<xsl:value-of select="daxtor:rPad(fn:upper-case(fn:string(./detail/first_last_name)),60)"/>
		<!-- 13 -->
		<xsl:value-of select="daxtor:rPad('',60)"/>
		<!-- 14 -->
		<xsl:value-of select="daxtor:rPad(fn:string(/investment/dep_bank/mapping[key_name = 'SUBJECT_TYPE' and key_value = $subject_type]/value),1)"/>
		<!-- 15 -->
		<xsl:value-of select="daxtor:rPad('',8)"/>
		<!-- 16 -->
		<xsl:value-of select="daxtor:rPad(fn:string(./detail/sex),1)"/>
		<!-- 17 -->
		<xsl:value-of select="daxtor:rPad(fn:string(/investment/dep_bank/mapping[key_name = 'SIGNATURE' and key_value = $signature]/value),1)"/>
		<!-- 18 -->
		<xsl:value-of select="daxtor:rPad(fn:string(./addresses/operative/nation_iso),3)"/>
		<!-- 19 -->
		<xsl:value-of select="daxtor:rPad(daxtor:translateCRESFIS($operative_country,$fiscally_country),3)"/>
		<!-- 20 -->
		<xsl:value-of select="daxtor:lPad('',11,'0')"/>
		<!-- 21 -->
		<xsl:value-of select="daxtor:rPad('',16)"/>
		<!-- 22 -->
		<xsl:value-of select="daxtor:lPad('',3,'0')"/>
		<!-- 23 -->
		<xsl:value-of select="daxtor:lPad(fn:string(./detail/uic_gruppo_code),3,'0')"/>
		<!-- 24 -->
		<xsl:value-of select="daxtor:lPad(fn:string(./detail/uic_ramo_code),3,'0')"/>
		<!-- 25 -->
		<xsl:value-of select="daxtor:rPad('',3)"/>
		<!-- 26 -->
		<xsl:value-of select="daxtor:rPad('',140)"/>
		<!-- 27  -->
		<xsl:text>*</xsl:text>


		<xsl:text>REPLACEMENT_NEW_LINE</xsl:text>

	</xsl:template>


	<!-- build record AN1 -->
	<xsl:template name="build_record_AN1">
		<xsl:variable name="oid_prod_company" select="fn:string(../../product/oid_prod_company)"/>
		<xsl:variable name="oid_product" select="fn:string(../../product/oid_product)"/>

		<saxon:assign name="counter" select="$counter+1"/>

		<!-- 1  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/sending[1]/send_number[1]),7,'0')"/>
		<!-- 2  -->
		<xsl:value-of select="daxtor:lPad(fn:string($counter),7,'0')"/>
		<!-- 3  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/dep_bank/mapping[key_name = 'PRODUCT_EXTERNAL_KEY2' and key_value = $oid_product]/value),5,'0')"/>
		<!-- 4  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/dep_bank/param[key_name='DISTRIBUTOR_CODE']/key_value),5,'0')"/>
		<!-- 5  -->
		<xsl:value-of select="daxtor:lPad('0',11,'0')"/>
		<!-- 6  -->
		<xsl:value-of select="daxtor:rPad(fn:string(../../contract/mandat_leader_reference),25)"/>
		<!-- 7  -->
		<xsl:text>AN1</xsl:text>
		<!-- 8 -->
		<xsl:value-of select="daxtor:lPad(daxtor:convertDate(fn:string(./detail/dt_birth),'yyyy-mm-dd','yyyymmdd'),9,'0')"/>
		<!-- 9 -->
		<xsl:value-of select="daxtor:rPad(fn:upper-case(fn:string(./detail/birth_place)),30)"/>
		<!-- 10 -->
		<xsl:value-of select="daxtor:rPad(fn:string(./detail/birth_province_code),2)"/>
		<!-- 11 -->
		<xsl:value-of select="daxtor:rPad(fn:string(./detail/birth_nation_iso),3)"/>
		<!-- 12 -->
		<xsl:value-of select="daxtor:rPad('',292)"/>
		<!-- 13  -->
		<xsl:text>*</xsl:text>

		<xsl:text>REPLACEMENT_NEW_LINE</xsl:text>

	</xsl:template>

	<!-- build record AN2 -->
	<xsl:template name="build_record_AN2">
		<xsl:variable name="oid_prod_company" select="fn:string(../../product/oid_prod_company)"/>
		<xsl:variable name="oid_product" select="fn:string(../../product/oid_product)"/>

		<saxon:assign name="counter" select="$counter+1"/>

		<!-- 1  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/sending[1]/send_number[1]),7,'0')"/>
		<!-- 2  -->
		<xsl:value-of select="daxtor:lPad(fn:string($counter),7,'0')"/>
		<!-- 3  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/dep_bank/mapping[key_name = 'PRODUCT_EXTERNAL_KEY2' and key_value = $oid_product]/value),5,'0')"/>
		<!-- 4  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/dep_bank/param[key_name='DISTRIBUTOR_CODE']/key_value),5,'0')"/>
		<!-- 5  -->
		<xsl:value-of select="daxtor:lPad('0',11,'0')"/>
		<!-- 6  -->
		<xsl:value-of select="daxtor:rPad(fn:string(../../contract/mandat_leader_reference),25)"/>
		<!-- 7  -->
		<xsl:text>AN2</xsl:text>
		<!-- 8 -->
		<xsl:value-of select="daxtor:rPad(fn:upper-case(fn:string(./addresses/operative/address)),30)"/>
		<!-- 9 -->
		<xsl:value-of select="daxtor:rPad(fn:upper-case(fn:string(./addresses/operative/city)),30)"/>
		<!-- 10 -->
		<xsl:value-of select="daxtor:rPad(fn:string(./addresses/operative/zip_code),8)"/>
		<!-- 11 -->
		<xsl:value-of select="daxtor:rPad(fn:upper-case(fn:string(./addresses/operative/city)),30)"/>
		<!-- 12 -->
		<xsl:value-of select="daxtor:rPad(fn:string(./addresses/operative/province_code),2)"/>
		<!-- 13 -->
		<xsl:value-of select="daxtor:rPad(fn:string(./addresses/operative/nation_iso),3)"/>
		<!-- 14 -->
		<xsl:value-of select="daxtor:rPad('',233)"/>
		<!-- 15  -->
		<xsl:text>*</xsl:text>

		<xsl:text>REPLACEMENT_NEW_LINE</xsl:text>

	</xsl:template>

	<!-- build record AN3 -->
	<xsl:template name="build_record_AN3">
		<xsl:variable name="oid_prod_company" select="fn:string(../../product/oid_prod_company)"/>
        <xsl:variable name="oid_document_type" select="fn:string(./detail/oid_document_type)"/>
		<xsl:variable name="oid_document_release_authority" select="fn:string(./detail/oid_document_release_authority)"/>
		<xsl:variable name="oid_product" select="fn:string(../../product/oid_product)"/>

		<saxon:assign name="counter" select="$counter+1"/>

		<!-- 1  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/sending[1]/send_number[1]),7,'0')"/>
		<!-- 2  -->
		<xsl:value-of select="daxtor:lPad(fn:string($counter),7,'0')"/>
		<!-- 3  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/dep_bank/mapping[key_name = 'PRODUCT_EXTERNAL_KEY2' and key_value = $oid_product]/value),5,'0')"/>
		<!-- 4  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/dep_bank/param[key_name='DISTRIBUTOR_CODE']/key_value),5,'0')"/>
		<!-- 5  -->
		<xsl:value-of select="daxtor:lPad('0',11,'0')"/>
		<!-- 6  -->
		<xsl:value-of select="daxtor:rPad(fn:string(../../contract/mandat_leader_reference),25)"/>
		<!-- 7  -->
		<xsl:text>AN3</xsl:text>
		<!-- 8 -->
		<xsl:value-of select="daxtor:rPad(fn:string(./detail/fiscal_code),16)"/>
		<!-- 9 -->
		<xsl:value-of select="daxtor:lPad(fn:string(./detail/tax_code),11,'0')"/>
		<!-- 10 -->
		<xsl:value-of select="daxtor:rPad(fn:string(/investment/dep_bank/mapping[key_name = 'DOCUMENT_TYPE' and key_value = $oid_document_type]/value),30)"/>
		<!-- 11 -->
		<xsl:value-of select="daxtor:rPad(fn:string(./detail/document_no),16)"/>
		<!-- 12 -->
		<xsl:value-of select="daxtor:lPad(daxtor:convertDate(fn:string(./detail/dt_release_document),'yyyy-mm-dd','yyyymmdd'),8,'0')"/>
		<!-- 13 -->
		<xsl:value-of select="daxtor:rPad(fn:string(/investment/dep_bank/mapping[key_name = 'DOCUMENT_RELEASE_AUTHORITY' and key_value = $oid_document_release_authority]/value),30)"/>
		<!-- 14 -->
		<xsl:value-of select="daxtor:rPad(fn:upper-case(fn:string(./detail/document_release_place)),30)"/>
		<!-- 15 -->
		<xsl:value-of select="daxtor:rPad('',30)"/>
		<!-- 16 -->
		<xsl:value-of select="daxtor:rPad('',3)"/>
		<!-- 17 -->
		<xsl:value-of select="daxtor:rPad('',162)"/>
		<!-- 18  -->
		<xsl:text>*</xsl:text>

		<xsl:text>REPLACEMENT_NEW_LINE</xsl:text>

	</xsl:template>


	<!-- build record MO0 -->
	<xsl:template name="build_record_MO0">
	    <saxon:assign name="counter" select="$counter+1"/>
		<xsl:variable name="oid_prod_company" select="fn:string(./product/oid_prod_company)"/>
		<xsl:variable name="oid_product" select="fn:string(./product/oid_product)"/>
		<xsl:variable name="oid_transaction_code" select="fn:string(./transaction_code/oid_transaction_code)"/>

		<saxon:assign name="counter" select="$counter+1"/>

		<!-- 1  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/sending[1]/send_number[1]),7,'0')"/>
		<!-- 2  -->
		<xsl:value-of select="daxtor:lPad(fn:string($counter),7,'0')"/>
		<!-- 3  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/dep_bank/mapping[key_name = 'PRODUCT_EXTERNAL_KEY2' and key_value = $oid_product]/value),5,'0')"/>
		<!-- 4  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/dep_bank/param[key_name='DISTRIBUTOR_CODE']/key_value),5,'0')"/>
		<!-- 5  -->
		<xsl:value-of select="daxtor:lPad('0',11,'0')"/>
		<!-- 6  -->
		<xsl:value-of select="daxtor:rPad(fn:string(./contract/mandat_leader_reference),25)"/>
		<!-- 7  -->
		<xsl:text>MO0</xsl:text>
		<!-- 8 -->
		<xsl:value-of select="daxtor:lPad('',11,'0')"/>
		<!-- 9 -->
		<xsl:value-of select="daxtor:rPad(fn:string(./detail/order_no),25)"/>
		<!-- 10 -->
		<xsl:value-of select="daxtor:rPad('N',1)"/>
		<!-- 11 -->
		<xsl:value-of select="daxtor:rPad(fn:string(/investment/dep_bank/mapping[key_name = 'PRODUCT_EXTERNAL_KEY' and key_value = $oid_product]/value),8)"/>
		<!-- 12 -->
		<xsl:value-of select="daxtor:rPad('',1)"/>
		<!-- 13 -->
		<xsl:value-of select="daxtor:rPad(fn:string(/investment/dep_bank/mapping[key_name = 'TRANSACTION_CODE' and key_value = $oid_transaction_code]/value),3)"/>
		<!-- 14 -->
		<xsl:value-of select="daxtor:lPad(daxtor:convertDate(fn:string(./detail/dt_subscription),'yyyy-mm-dd','yyyymmdd'),8,'0')"/>
		<!-- 15 -->
		<xsl:value-of select="daxtor:lPad('',8,'0')"/>
		<!-- 16 -->
		<xsl:value-of select="daxtor:lPad('',6,'0')"/>
		<!-- 17 -->
		<xsl:value-of select="daxtor:lPad('',8,'0')"/>
		<!-- 18 -->
		<xsl:value-of select="daxtor:lPad('',8,'0')"/>
		<!-- 19 -->
		<xsl:value-of select="daxtor:lPad('',8,'0')"/>
		<!-- 20 -->
		<xsl:value-of select="daxtor:lPad('',8,'0')"/>
		<!-- 21 -->
		<xsl:value-of select="daxtor:rPad('',25)"/>
		<!-- 22 -->
		<xsl:value-of select="daxtor:lPad('',7,'0')"/>
		<!-- 23 -->
		<xsl:value-of select="daxtor:rPad(daxtor:translate-MO0-CDIV(fn:string(/investment/dep_bank/mapping[key_name = 'TRANSACTION_CODE' and key_value = $oid_transaction_code]/value),fn:string(./product/currency_code_iso), fn:string(./payments/payment/currency_code_iso), fn:string(/investment/dep_bank/mapping[key_name = 'OPERATION_SIGN' and key_value = $oid_transaction_code]/value),.),3)"/>
		<!-- 24 -->
		<xsl:value-of select="daxtor:lPad(daxtor:addDecimals(fn:string(./detail/amount),3),18,'0')"/>
		<!-- 25 -->
		<xsl:value-of select="daxtor:lPad('',11,'0')"/>
		<!-- 26 -->
		<xsl:value-of select="daxtor:lPad('',11,'0')"/>
		<!-- 27 -->
		<xsl:value-of select="daxtor:lPad('',18,'0')"/>
		<!-- 28 -->
		<xsl:value-of select="daxtor:rPad(daxtor:translate-MO0-CDIVPAG(fn:string(/investment/dep_bank/mapping[key_name = 'TRANSACTION_CODE' and key_value = $oid_transaction_code]/value),fn:string(./product/currency_code_iso), fn:string(./payments/payment/currency_code_iso)),3)"/>
		<!-- 29 -->
		<xsl:value-of select="daxtor:lPad('',18,'0')"/>
		<!-- 30 -->
		<xsl:value-of select="daxtor:lPad('',15,'0')"/>
		<!-- 31 -->
		<xsl:value-of select="daxtor:lPad(daxtor:addDecimals(fn:string(./detail/quantity),5),18,'0')"/>
		<!-- 32 -->
		<xsl:value-of select="daxtor:rPad('S',1)"/>
		<!-- 33 -->
		<xsl:value-of select="daxtor:rPad('',25)"/>
		<!-- 34 -->
		<xsl:value-of select="daxtor:lPad('',8,'0')"/>
		<!-- 35 -->
		<xsl:value-of select="daxtor:lPad('',8,'0')"/>
		<!-- 36 -->
		<xsl:value-of select="daxtor:rPad(fn:string(/investment/dep_bank/mapping[key_name = 'OPERATION_SIGN' and key_value = $oid_transaction_code]/value),1)"/>
		<!-- 37 -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/dep_bank/param[key_name='DISTRIBUTOR_CODE']/key_value),5,'0')"/>
		<!-- 38 -->
		<xsl:value-of select="daxtor:rPad('FIL',3)"/>
		<!-- 39 -->
		<xsl:value-of select="daxtor:lPad('',3,'0')"/>
		<!-- 40 -->
		<xsl:value-of select="daxtor:lPad('',3,'0')"/>
		<!-- 41 -->
		<xsl:value-of select="daxtor:rPad('',3)"/>
		<!-- 42 -->
		<xsl:value-of select="daxtor:rPad(fn:string(daxtor:translateSuspensive(./detail/suspensive)),1)"/>
		<!-- 43 -->
		<xsl:value-of select="daxtor:lPad('',9,'0')"/>
		<!-- 44 -->
		<xsl:value-of select="daxtor:lPad('',7,'0')"/>
		<!-- 45 -->
		<xsl:value-of select="daxtor:lPad('',8,'0')"/>
		<!-- 46 -->
		<xsl:value-of select="daxtor:rPad('',1)"/>
		<!-- 47  -->
		<xsl:text>*</xsl:text>

		<xsl:text>REPLACEMENT_NEW_LINE</xsl:text>

	</xsl:template>

	<!-- build record MO7 -->
	<xsl:template name="build_record_MO7">
		<xsl:variable name="oid_prod_company" select="fn:string(./product/oid_prod_company)"/>
		<xsl:variable name="oid_payment_code" select="fn:string(./payments/payment/payment_code/oid_payment_code)"/>
		<xsl:variable name="oid_product" select="fn:string(./product/oid_product)"/>
		<xsl:variable name="oid_transaction_code" select="fn:string(./transaction_code/oid_transaction_code)"/>

		<saxon:assign name="counter" select="$counter+1"/>

		<!-- 1  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/sending[1]/send_number[1]),7,'0')"/>
		<!-- 2  -->
		<xsl:value-of select="daxtor:lPad(fn:string($counter),7,'0')"/>
		<!-- 3  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/dep_bank/mapping[key_name = 'PRODUCT_EXTERNAL_KEY2' and key_value = $oid_product]/value),5,'0')"/>
		<!-- 4  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/dep_bank/param[key_name='DISTRIBUTOR_CODE']/key_value),5,'0')"/>
		<!-- 5  -->
		<xsl:value-of select="daxtor:lPad('0',11,'0')"/>
		<!-- 6  -->
		<xsl:value-of select="daxtor:rPad(fn:string(./contract/mandat_leader_reference),25)"/>
		<!-- 7  -->
		<xsl:text>MO7</xsl:text>
		<!-- 8 -->
		<xsl:value-of select="daxtor:rPad(fn:string(/investment/dep_bank/mapping[key_name = 'PAYMENT_CODE' and key_value = $oid_payment_code]/value),3)"/>
		<!-- 9 -->
		<xsl:value-of select="daxtor:lPad(daxtor:addDecimals(fn:string(./payments/payment/amount),3),18,'0')"/>
		<!-- 10 -->
		<xsl:value-of select="daxtor:rPad(daxtor:cut-part-IBAN('COUNTRY', fn:string(./payments/payment/iban)),2)"/>
		<!-- 11 -->
		<xsl:value-of select="daxtor:lPad(daxtor:cut-part-IBAN('CHECK_DIGITS', fn:string(./payments/payment/iban)),2,'0')"/>
		<!-- 12 -->
		<xsl:value-of select="daxtor:rPad(daxtor:cut-part-IBAN('DOMESTIC_1', fn:string(./payments/payment/iban)),1)"/>
		<!-- 13 -->
		<xsl:value-of select="daxtor:lPad(daxtor:cut-part-IBAN('DOMESTIC_2', fn:string(./payments/payment/iban)),5,'0')"/>
		<!-- 14 -->
		<xsl:value-of select="daxtor:lPad(daxtor:cut-part-IBAN('DOMESTIC_3', fn:string(./payments/payment/iban)),5,'0')"/>
		<!-- 15 -->
		<xsl:value-of select="daxtor:rPad(daxtor:cut-part-IBAN('DOMESTIC_4', fn:string(./payments/payment/iban)),12)"/>
		<!-- 16 -->
		<xsl:value-of select="daxtor:lPad('',5,'0')"/>
		<!-- 17 -->
		<xsl:value-of select="daxtor:lPad('',5,'0')"/>
		<!-- 18 -->
		<xsl:value-of select="daxtor:lPad('',11,'0')"/>
		<!-- 19 -->
		<xsl:value-of select="daxtor:lPad('',8,'0')"/>
		<!-- 20 -->
		<xsl:value-of select="daxtor:rPad(daxtor:translate-MO7-CDIV(fn:string(/investment/dep_bank/mapping[key_name = 'TRANSACTION_CODE' and key_value = $oid_transaction_code]/value),./product/currency_code_iso, ./payments/payment/currency_code_iso),3)"/>
		<!-- 21 -->
		<xsl:value-of select="daxtor:rPad('',256)"/>
		<!-- 22 -->
		<xsl:value-of select="daxtor:rPad('*',1)"/>

		<xsl:text>REPLACEMENT_NEW_LINE</xsl:text>

	</xsl:template>

	<!-- build record MO6 -->
	<xsl:template name="build_record_MO6">
		<xsl:variable name="oid_prod_company" select="fn:string(./product/oid_prod_company)"/>
		<xsl:variable name="oid_product" select="fn:string(./product/oid_product)"/>
		<xsl:variable name="oid_transaction_code" select="fn:string(./transaction_code/oid_transaction_code)"/>

		<saxon:assign name="counter" select="$counter+1"/>

		<!-- 1  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/sending[1]/send_number[1]),7,'0')"/>
		<!-- 2  -->
		<xsl:value-of select="daxtor:lPad(fn:string($counter),7,'0')"/>
		<!-- 3  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/dep_bank/mapping[key_name = 'PRODUCT_EXTERNAL_KEY2' and key_value = $oid_product]/value),5,'0')"/>
		<!-- 4  -->
		<xsl:value-of select="daxtor:lPad(fn:string(/investment/dep_bank/param[key_name='DISTRIBUTOR_CODE']/key_value),5,'0')"/>
		<!-- 5  -->
		<xsl:value-of select="daxtor:lPad('0',11,'0')"/>
		<!-- 6  -->
		<xsl:value-of select="daxtor:rPad(fn:string(./contract/mandat_leader_reference),25)"/>
		<!-- 7  -->
		<xsl:text>MO6</xsl:text>
		<!-- 8 -->
		<xsl:value-of select="daxtor:rPad(fn:string(/investment/dep_bank/mapping[key_name = 'FEE' and key_value = $oid_transaction_code]/value),8)"/>
		<!-- 9 -->
		<xsl:value-of select="daxtor:lPad(daxtor:addDecimals(daxtor:translatePNEG(/investment/dep_bank/mapping[key_name = 'FEE_CALC_TYPE' and key_value = $oid_prod_company]/value ,./detail/percent_subscription_fee),5),9,'0')"/>
		<!-- 10 -->
		<xsl:value-of select="daxtor:lPad(daxtor:addDecimals(daxtor:translatePSCO(/investment/dep_bank/mapping[key_name = 'FEE_CALC_TYPE' and key_value = $oid_prod_company]/value ,./detail/subscribtion_fee_discount),5),9,'0')"/>
		<!-- 11 -->
		<xsl:value-of select="daxtor:rPad('',3)"/>
		<!-- 12 -->
		<xsl:value-of select="daxtor:rPad('',3)"/>
		<!-- 13 -->
		<xsl:value-of select="daxtor:rPad('',25)"/>
		<!-- 14 -->
		<xsl:value-of select="daxtor:rPad('',279)"/>
		<!-- 15  -->
		<xsl:text>*</xsl:text>

		<xsl:text>REPLACEMENT_NEW_LINE</xsl:text>

	</xsl:template>


	<!-- build index -->
	<xsl:template name="build_record_index">
		<saxon:assign name="counter" select="$counter+1"/>
		<xsl:value-of select="daxtor:lPad($counter,20,'0')"/>
		<xsl:value-of select="daxtor:lPad($oid_position,20,'0')"/>
		<xsl:text>REPLACEMENT_NEW_LINE</xsl:text>
	</xsl:template>

	<!-- translate CLEG -->
	<xsl:function name="daxtor:translateCLEG">
		<xsl:param name="belongs_to_1_subject_only"/>
		<xsl:param name="cleg"/>
		<xsl:choose>
			<xsl:when test="$belongs_to_1_subject_only = 'true'">
				<xsl:choose>
			    	<xsl:when test="$cleg != 'COI'">
						<xsl:value-of select="$cleg"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="''"/>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="$cleg"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:function>

	<!-- translate CRESFIS -->
	<xsl:function name="daxtor:translateCRESFIS">
		<xsl:param name="operative_country"/>
		<xsl:param name="fiscally_country"/>
		<xsl:choose>
			<xsl:when test="fn:string-length($fiscally_country) > 0">
				<xsl:value-of select="$fiscally_country"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="$operative_country"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:function>


	<!-- translate MO0 CDIV -->
	<xsl:function name="daxtor:translate-MO0-CDIV">
		<xsl:param name="transaction_code"/>
		<xsl:param name="product_currency_iso"/>
		<xsl:param name="customer_currency_iso"/>
		<xsl:param name="operation_sign"/>
		<xsl:param name="node"/>
		<xsl:choose>
			<!-- subscription -->
			<xsl:when test="$transaction_code = 'S01'">
				<xsl:value-of select="$customer_currency_iso"/>
			</xsl:when>
			<!-- rendemption -->
			<xsl:when test="$transaction_code = 'R01'">
				<xsl:value-of select="$product_currency_iso"/>
			</xsl:when>
			<!-- switch -->
			<xsl:when test="$transaction_code = 'GS3'">
				<xsl:choose>
				    <!-- switch out -->
					<xsl:when test="$operation_sign  = '-'">
						<xsl:value-of select="$product_currency_iso"/>
					</xsl:when>
					<!-- switch in -->
					<xsl:when test="$operation_sign  = '+'">
					    <!-- currency product of switch out -->
						<xsl:value-of select="fn:string($node/../../product/currency_code_iso)"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="''"/>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="''"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:function>


	<!-- translate MO7 CDIV -->
	<xsl:function name="daxtor:translate-MO7-CDIV">
		<xsl:param name="transaction_code"/>
		<xsl:param name="product_currency_iso"/>
		<xsl:param name="customer_currency_iso"/>

		<xsl:value-of select="$customer_currency_iso"/>

		<!--
		<xsl:choose>
			 subscription 
			<xsl:when test="$transaction_code = 'S01'">
				<xsl:value-of select="$customer_currency_iso"/>
			</xsl:when>
			 rendemption 
			<xsl:when test="$transaction_code = 'R01'">
				<xsl:value-of select="$product_currency_iso"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="''"/>
			</xsl:otherwise>
		</xsl:choose>
		-->
	</xsl:function>

	<!-- extract part of IBAN -->
	<xsl:function name="daxtor:cut-part-IBAN">
		<xsl:param name="cut_name"/>
		<xsl:param name="iban"/>
		<xsl:choose>
			<!-- Italy -->
			<xsl:when test="substring($iban,1,2)='IT'">
				<xsl:choose>
					<xsl:when test="$cut_name = 'COUNTRY'">
						<xsl:value-of select="substring($iban,1,2)"/>
					</xsl:when>
					<xsl:when test="$cut_name = 'CHECK_DIGITS'">
						<xsl:value-of select="substring($iban,3,2)"/>
					</xsl:when>
					<xsl:when test="$cut_name = 'DOMESTIC_1'">
						<xsl:value-of select="substring($iban,5,1)"/>
					</xsl:when>
					<xsl:when test="$cut_name = 'DOMESTIC_2'">
						<xsl:value-of select="substring($iban,6,5)"/>
					</xsl:when>
					<xsl:when test="$cut_name = 'DOMESTIC_3'">
						<xsl:value-of select="substring($iban,11,5)"/>
					</xsl:when>
					<xsl:when test="$cut_name = 'DOMESTIC_4'">
						<xsl:value-of select="substring($iban,16,12)"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="''"/>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="''"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:function>


	<!-- translate MO0 CDIVPAG -->
	<xsl:function name="daxtor:translate-MO0-CDIVPAG">
		<xsl:param name="transaction_code"/>
		<xsl:param name="product_currency_iso"/>
		<xsl:param name="customer_currency_iso"/>
		<xsl:choose>
			<!-- subscription -->
			<xsl:when test="$transaction_code = 'S01'">
				<xsl:value-of select="$product_currency_iso"/>
			</xsl:when>
			<!-- rendemption -->
			<xsl:when test="$transaction_code = 'R01'">
				<xsl:value-of select="$customer_currency_iso"/>
			</xsl:when>
			<!-- switch -->
			<xsl:when test="$transaction_code = 'GS3'">
				<xsl:value-of select="$product_currency_iso"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="''"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:function>

	<!-- read transaction code -->
	<xsl:function name="daxtor:readArrangeRecordsCode">
	    <xsl:param name="root"/>
		<xsl:param name="node"/>
		<xsl:variable name="oid_transaction_code" select="fn:string($node/transaction_code/oid_transaction_code)"/>
		<xsl:value-of select="fn:string($root/dep_bank/mapping[key_name = 'ARRANGE_RECORDS' and key_value = $oid_transaction_code]/value)"/>
	</xsl:function>

	<!-- translate boolean -->
	<xsl:function name="daxtor:translateBoolean">
		<xsl:param name="val"/>
		<xsl:choose>
			<xsl:when test="$val = 'true'">
				<xsl:value-of select="'S'"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="'N'"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:function>		

	<!-- read suspensice code -->
	<xsl:function name="daxtor:translateSuspensive">
	    <xsl:param name="val"/>
		<xsl:choose>
			<xsl:when test="$val = 'true'">
				<xsl:value-of select="'N'"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="'S'"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:function>

	<!-- translate PNEG  -->
	<xsl:function name="daxtor:translatePNEG">
	    <xsl:param name="fee_calc_type"/>
		<xsl:param name="percent_subscription_fee"/>
		<xsl:choose>
			<xsl:when test="$fee_calc_type = 'PERCENT'">
				<xsl:value-of select="$fee_calc_type"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="'0'"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:function>

	<!-- translate PSCO  -->
	<xsl:function name="daxtor:translatePSCO">
	    <xsl:param name="fee_calc_type"/>
		<xsl:param name="subscribtion_fee_discount"/>
		<xsl:choose>
			<xsl:when test="$fee_calc_type = 'DISCOUNT'">
				<xsl:value-of select="$subscribtion_fee_discount"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="'0'"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:function>

</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2007. Progress Software Corporation. All rights reserved.

<metaInformation>
	<scenarios>
		<scenario default="yes" name="Saxon" userelativepaths="yes" externalpreview="no" url="..\..\import\dev\ubibanca_40.xml" htmlbaseurl="" outputurl="..\..\import\dev\ubibanca_40.txt" processortype="saxon8" useresolver="yes" profilemode="0"
		          profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no"
		          validator="internal" customvalidator="">
			<advancedProp name="sInitialMode" value=""/>
			<advancedProp name="bXsltOneIsOkay" value="true"/>
			<advancedProp name="bSchemaAware" value="true"/>
			<advancedProp name="bXml11" value="false"/>
			<advancedProp name="iValidation" value="0"/>
			<advancedProp name="bExtensions" value="true"/>
			<advancedProp name="iWhitespace" value="0"/>
			<advancedProp name="sInitialTemplate" value=""/>
			<advancedProp name="bTinyTree" value="true"/>
			<advancedProp name="bWarnings" value="true"/>
			<advancedProp name="bUseDTD" value="false"/>
			<advancedProp name="iErrorHandling" value="fatal"/>
		</scenario>
	</scenarios>
	<MapperMetaTag>
		<MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no">
			<SourceSchema srcSchemaPath="..\..\import\dev\ubibanca_6.xml" srcSchemaRoot="investment" AssociatedInstance="" loaderFunction="document" loaderFunctionUsesURI="no"/>
		</MapperInfo>
		<MapperBlockPosition>
			<template match="/">
				<block path="xsl:for-each" x="238" y="0"/>
				<block path="xsl:for-each/xsl:choose" x="348" y="0"/>
				<block path="xsl:for-each/xsl:choose/=[0]" x="302" y="0"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:call-template" x="298" y="0"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:if" x="191" y="40"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:if/xsl:for-each" x="21" y="0"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:if/xsl:for-each/xsl:if" x="91" y="0"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:if/xsl:for-each/xsl:if/xsl:call-template" x="161" y="0"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:if/xsl:for-each/xsl:if/xsl:call-template[1]" x="281" y="40"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:for-each" x="131" y="40"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:for-each/xsl:call-template" x="321" y="40"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:for-each/xsl:call-template[1]" x="241" y="40"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:for-each/xsl:call-template[2]" x="81" y="40"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:for-each/xsl:call-template[3]" x="41" y="40"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:choose" x="331" y="80"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:choose/=[0]" x="285" y="74"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:choose/xsl:when/xsl:call-template" x="281" y="80"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:choose/xsl:when/xsl:call-template[1]" x="241" y="80"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:choose/xsl:when/xsl:call-template[2]" x="201" y="80"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:choose/=[1]" x="285" y="102"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:choose/xsl:when[1]/xsl:call-template" x="161" y="80"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:choose/xsl:when[1]/xsl:call-template[1]" x="121" y="80"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:choose/xsl:when[1]/xsl:call-template[2]" x="81" y="80"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:choose/=[2]" x="285" y="110"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:choose/xsl:when[2]/xsl:call-template" x="41" y="80"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:choose/xsl:when[2]/xsl:for-each" x="211" y="120"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:choose/xsl:when[2]/xsl:for-each/xsl:call-template" x="281" y="120"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:choose/=[3]" x="285" y="118"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:choose/xsl:when[3]/xsl:call-template" x="161" y="120"/>
				<block path="xsl:for-each/xsl:choose/xsl:when/xsl:choose/xsl:when[3]/xsl:call-template[1]" x="121" y="120"/>
			</template>
			<template match="/ALBUM"></template>
			<template match="ALBUM"></template>
			<template name="build_record_40">
				<block path="xsl:value-of" x="265" y="0"/>
				<block path="xsl:value-of[1]" x="305" y="0"/>
				<block path="xsl:value-of[2]" x="225" y="0"/>
				<block path="xsl:value-of[3]" x="185" y="0"/>
				<block path="xsl:value-of[4]" x="145" y="0"/>
				<block path="xsl:value-of[5]" x="105" y="0"/>
				<block path="xsl:value-of[6]" x="65" y="0"/>
				<block path="xsl:value-of[7]" x="25" y="0"/>
				<block path="xsl:value-of[8]" x="265" y="40"/>
				<block path="xsl:value-of[9]" x="305" y="40"/>
				<block path="xsl:value-of[10]" x="225" y="40"/>
				<block path="xsl:value-of[11]" x="185" y="40"/>
				<block path="xsl:value-of[12]" x="145" y="40"/>
				<block path="xsl:value-of[13]" x="105" y="40"/>
				<block path="xsl:value-of[14]" x="65" y="40"/>
				<block path="xsl:value-of[15]" x="25" y="40"/>
				<block path="xsl:value-of[16]" x="265" y="80"/>
				<block path="xsl:value-of[17]" x="305" y="80"/>
				<block path="xsl:value-of[18]" x="225" y="80"/>
				<block path="xsl:value-of[19]" x="185" y="80"/>
				<block path="xsl:value-of[20]" x="145" y="80"/>
				<block path="xsl:value-of[21]" x="105" y="80"/>
				<block path="xsl:value-of[22]" x="65" y="80"/>
				<block path="xsl:value-of[23]" x="25" y="80"/>
				<block path="xsl:value-of[24]" x="265" y="120"/>
				<block path="xsl:value-of[25]" x="305" y="120"/>
				<block path="xsl:value-of[26]" x="225" y="120"/>
				<block path="xsl:value-of[27]" x="185" y="120"/>
				<block path="xsl:value-of[28]" x="145" y="120"/>
				<block path="xsl:value-of[29]" x="105" y="120"/>
				<block path="xsl:value-of[30]" x="65" y="120"/>
				<block path="xsl:value-of[31]" x="25" y="120"/>
				<block path="xsl:value-of[32]" x="265" y="160"/>
				<block path="xsl:value-of[33]" x="305" y="160"/>
				<block path="xsl:value-of[34]" x="225" y="160"/>
				<block path="xsl:value-of[35]" x="185" y="160"/>
				<block path="xsl:value-of[36]" x="145" y="160"/>
				<block path="xsl:value-of[37]" x="105" y="160"/>
				<block path="xsl:value-of[38]" x="65" y="160"/>
				<block path="xsl:value-of[39]" x="25" y="160"/>
				<block path="xsl:value-of[40]" x="265" y="200"/>
				<block path="xsl:value-of[41]" x="305" y="200"/>
				<block path="xsl:value-of[42]" x="225" y="200"/>
				<block path="xsl:value-of[43]" x="185" y="200"/>
				<block path="xsl:value-of[44]" x="145" y="200"/>
				<block path="xsl:value-of[45]" x="105" y="200"/>
				<block path="xsl:value-of[46]" x="65" y="200"/>
				<block path="xsl:value-of[47]" x="25" y="200"/>
				<block path="xsl:value-of[48]" x="265" y="0"/>
				<block path="xsl:value-of[49]" x="265" y="0"/>
				<block path="xsl:value-of[50]" x="265" y="0"/>
				<block path="xsl:value-of[51]" x="265" y="0"/>
				<block path="xsl:value-of[52]" x="265" y="0"/>
				<block path="xsl:value-of[53]" x="265" y="0"/>
				<block path="xsl:value-of[54]" x="265" y="0"/>
				<block path="xsl:value-of[55]" x="265" y="0"/>
				<block path="xsl:value-of[56]" x="265" y="0"/>
				<block path="xsl:value-of[57]" x="265" y="0"/>
				<block path="xsl:value-of[58]" x="265" y="0"/>
				<block path="xsl:value-of[59]" x="265" y="0"/>
				<block path="xsl:value-of[60]" x="265" y="0"/>
				<block path="xsl:value-of[61]" x="265" y="0"/>
				<block path="xsl:value-of[62]" x="265" y="0"/>
				<block path="xsl:value-of[63]" x="265" y="0"/>
				<block path="xsl:value-of[64]" x="265" y="0"/>
				<block path="xsl:value-of[65]" x="265" y="0"/>
				<block path="xsl:value-of[66]" x="265" y="0"/>
				<block path="xsl:value-of[67]" x="265" y="0"/>
				<block path="xsl:value-of[68]" x="265" y="0"/>
				<block path="xsl:value-of[69]" x="265" y="0"/>
			</template>
		</MapperBlockPosition>
		<TemplateContext></TemplateContext>
		<MapperFilter side="source"></MapperFilter>
	</MapperMetaTag>
</metaInformation>
-->