Warning, /office/skrooge/plugins/import/skrooge_import_xml/ISO20022.xslt is written in an unsupported language. File is not indexed.

0001 <?xml version="1.0"?>
0002 <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
0003     <xsl:template match="/">
0004         <skrooge>
0005             <list_unit>
0006                 <xsl:for-each select="distinct-values(Document/BkToCstmrStmt/Stmt/Acct/@Ccy)">
0007                     <unit t_type="C">
0008                         <xsl:attribute name="id"><xsl:value-of select="." /></xsl:attribute>
0009                         <xsl:attribute name="t_name"><xsl:value-of select="." /></xsl:attribute>
0010                         <xsl:attribute name="t_symbol"><xsl:value-of select="." /></xsl:attribute>
0011                     </unit>
0012                 </xsl:for-each>            
0013                 <xsl:for-each select="distinct-values(//Amt/@Ccy)">
0014                     <unit t_type="C">
0015                         <xsl:attribute name="id"><xsl:value-of select="." /></xsl:attribute>
0016                         <xsl:attribute name="t_name"><xsl:value-of select="." /></xsl:attribute>
0017                         <xsl:attribute name="t_symbol"><xsl:value-of select="." /></xsl:attribute>
0018                     </unit>
0019                 </xsl:for-each>                    
0020             </list_unit>
0021             
0022             <list_unitvalue>
0023             </list_unitvalue>
0024 
0025             <list_bank>
0026                 <xsl:for-each select="distinct-values(//Ntry/../Acct/Id/IBAN)">
0027                     <bank>
0028                         <xsl:attribute name="id"><xsl:value-of select="current()" /></xsl:attribute>
0029                         <xsl:attribute name="t_name"><xsl:value-of select="current()" /></xsl:attribute>
0030                     </bank>
0031                 </xsl:for-each>                   
0032             </list_bank>
0033 
0034             <list_account>
0035                 <xsl:for-each select="distinct-values(//Ntry/../Acct/Id/IBAN)">
0036                     <account t_type="C">
0037                         <xsl:attribute name="id"><xsl:value-of select="current()" /></xsl:attribute>
0038                         <xsl:attribute name="t_name"><xsl:value-of select="current()" /></xsl:attribute>
0039                         <xsl:attribute name="t_number"><xsl:value-of select="current()" /></xsl:attribute>                   
0040                         <xsl:attribute name="rd_bank_id"><xsl:value-of select="current()" /></xsl:attribute>
0041                     </account>
0042                 </xsl:for-each>                
0043             </list_account>
0044             
0045             <list_operation>
0046                 <xsl:for-each select="//Ntry">
0047                     <operation t_mode="" r_payee_id="0" t_number="" i_group_id="0">
0048                         <xsl:attribute name="id"><xsl:value-of select="position()" /></xsl:attribute>
0049                         <xsl:choose>
0050                             <xsl:when test="NtryRef!=''">
0051                                 <xsl:attribute name="t_import_id"><xsl:value-of select="NtryRef" /></xsl:attribute>
0052                                 <xsl:attribute name="t_number"><xsl:value-of select="NtryRef" /></xsl:attribute>
0053                             </xsl:when>
0054                             <xsl:otherwise>
0055                                 <xsl:attribute name="t_import_id"><xsl:value-of select="AcctSvcrRef" /></xsl:attribute>
0056                                 <xsl:attribute name="t_number"><xsl:value-of select="AcctSvcrRef" /></xsl:attribute>
0057                             </xsl:otherwise>
0058                         </xsl:choose>                         
0059                         <xsl:attribute name="d_createdate"><xsl:value-of select="BookgDt/Dt" /></xsl:attribute>
0060                         <xsl:attribute name="d_date"><xsl:value-of select="ValDt/Dt" /></xsl:attribute>
0061                         <xsl:attribute name="rc_unit_id"><xsl:value-of select="Amt/@Ccy" /></xsl:attribute>
0062                         <xsl:attribute name="t_comment"><xsl:value-of select="NtryDtls/TxDtls/RmtInf/Ustrd" /></xsl:attribute> 
0063                         <xsl:if test = "CdtDbtInd='DBIT'">           
0064                             <xsl:attribute name="r_payee_id"><xsl:value-of select="NtryDtls/TxDtls/RltdPties/Cdtr/Nm" /></xsl:attribute>
0065                         </xsl:if>
0066                         <xsl:if test = "CdtDbtInd='CRDT'">                        
0067                             <xsl:attribute name="r_payee_id"><xsl:value-of select="NtryDtls/TxDtls/RltdPties/Dbtr/Nm" /></xsl:attribute>
0068                         </xsl:if>                           
0069                         <xsl:choose>
0070                             <xsl:when test="../Acct/Id/IBAN!=''">
0071                                 <xsl:attribute name="rd_account_id"><xsl:value-of select="../Acct/Id/IBAN" /></xsl:attribute>
0072                             </xsl:when>
0073                             <xsl:otherwise>
0074                                 <xsl:choose>
0075                                     <xsl:when test = "CdtDbtInd='DBIT'">                        
0076                                         <xsl:attribute name="rd_account_id"><xsl:value-of select="//DbtrAcct/Id/IBAN" /></xsl:attribute>
0077                                     </xsl:when>
0078                                     <xsl:otherwise>                        
0079                                         <xsl:attribute name="rd_account_id"><xsl:value-of select="//CdtrAcct/Id/IBAN" /></xsl:attribute>
0080                                     </xsl:otherwise>  
0081                                 </xsl:choose>  
0082                             </xsl:otherwise>
0083                         </xsl:choose>                        
0084                     </operation>
0085                 </xsl:for-each>            
0086             </list_operation>     
0087             
0088             <list_suboperation>
0089                 <xsl:for-each select="//Ntry">
0090                     <suboperation>
0091                         <xsl:attribute name="id"><xsl:value-of select="position()" /></xsl:attribute>
0092                         <xsl:attribute name="d_date"><xsl:value-of select="ValDt/Dt" /></xsl:attribute>
0093                         <xsl:attribute name="rd_operation_id"><xsl:value-of select="position()" /></xsl:attribute>
0094                         <xsl:attribute name="t_comment"><xsl:value-of select="NtryDtls/TxDtls/RmtInf/Ustrd" /></xsl:attribute> 
0095                         <xsl:if test = "CdtDbtInd='DBIT'">                        
0096                             <xsl:attribute name="f_value">-<xsl:value-of select="Amt" /></xsl:attribute>
0097                         </xsl:if>
0098                         <xsl:if test = "CdtDbtInd='CRDT'">                        
0099                             <xsl:attribute name="f_value"><xsl:value-of select="Amt" /></xsl:attribute>
0100                         </xsl:if>                    
0101                     </suboperation>
0102                 </xsl:for-each>               
0103             </list_suboperation>   
0104             
0105             <list_payee>
0106                 <xsl:for-each select="//Ntry">
0107                     <payee>
0108                         <xsl:if test = "CdtDbtInd='DBIT'">           
0109                             <xsl:attribute name="id"><xsl:value-of select="NtryDtls/TxDtls/RltdPties/Cdtr/Nm" /></xsl:attribute>
0110                             <xsl:attribute name="t_name"><xsl:value-of select="NtryDtls/TxDtls/RltdPties/Cdtr/Nm" /></xsl:attribute>
0111                         </xsl:if>
0112                         <xsl:if test = "CdtDbtInd='CRDT'">                        
0113                             <xsl:attribute name="id"><xsl:value-of select="NtryDtls/TxDtls/RltdPties/Dbtr/Nm" /></xsl:attribute>
0114                             <xsl:attribute name="t_name"><xsl:value-of select="NtryDtls/TxDtls/RltdPties/Dbtr/Nm" /></xsl:attribute>
0115                         </xsl:if>                    
0116                     </payee>
0117                 </xsl:for-each>               
0118             </list_payee>               
0119         </skrooge>
0120     </xsl:template>
0121 </xsl:stylesheet>