<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
  <xsl:param name="MyFunction"/>
  <xsl:template match="responsetpc">
    <!--<xsl:comment>Web Service parte server da sys-money verso chiamanti (da pms) </xsl:comment> -->
    <Response>
     <Status>
       <xsl:attribute name="Code">
         <xsl:value-of select="rsptpccodesito"/>
       </xsl:attribute>
       <xsl:attribute name="Description">
         <xsl:value-of select="rsptpcdesesito"/>
       </xsl:attribute>
     </Status>
     <xsl:choose>
     <xsl:when test="rsptpcdati">
			<Tipcards>
 			<xsl:for-each select="rsptpcdati">
 				<Tipcard>
      	  <CodeTpc>
        	 <xsl:value-of select="rsptpc-cod"/>
        	</CodeTpc>
       		<DescTpc>
       	   <xsl:value-of select="rsptpc-des"/>
       	  </DescTpc>
          <FlTipUti>
           <xsl:value-of select="rsptpc-uti"/>
          </FlTipUti>
          <FlGestPms>
           <xsl:value-of select="rsptpc-gestpms"/>
          </FlGestPms>
          <FlScoArt>
           <xsl:value-of select="rsptpc-scoart"/>
          </FlScoArt>
          <FlSalDeb>
           <xsl:value-of select="rsptpc-saldeb"/>
          </FlSalDeb>
          <LimTot>
           <xsl:value-of select="rsptpc-limtot"/>
          </LimTot>
          <LimMov>
           <xsl:value-of select="rsptpc-limmov"/>
          </LimMov>
          <LimDay>
           <xsl:value-of select="rsptpc-limday"/>
          </LimDay>
          <LimMonth>
           <xsl:value-of select="rsptpc-limmonth"/>
          </LimMonth>
 				</Tipcard>
       </xsl:for-each>
	    </Tipcards>
     </xsl:when>  	
     </xsl:choose>
     <xsl:choose>
     	 <xsl:when test="$MyFunction = 'get_tipcardnummov'">
     		 <Card>
           <xsl:attribute name="Code">
             <xsl:value-of select="rsptpcdati-card/rsptpc-card/text()"/>
           </xsl:attribute>
           <xsl:attribute name="Description">
             <xsl:value-of select="rsptpcdati-card/rsptpc-carddes/text()"/>
           </xsl:attribute>
           <xsl:attribute name="Account">
             <xsl:value-of select="rsptpcdati-card/rsptpc-conto/text()"/>
           </xsl:attribute>
           <MovTotPlus>
             <xsl:value-of select="rsptpcdati-card/rsptpc-movpiutot"/>
           </MovTotPlus>
           <MovDayPlus>
             <xsl:value-of select="rsptpcdati-card/rsptpc-movpiuday"/>
           </MovDayPlus>
           <MovMonthPlus>
             <xsl:value-of select="rsptpcdati-card/rsptpc-movpiumonth"/>
           </MovMonthPlus>
           <MovTotMinus>
             <xsl:value-of select="rsptpcdati-card/rsptpc-movmentot"/>
           </MovTotMinus>
           <MovDayMinus>
             <xsl:value-of select="rsptpcdati-card/rsptpc-movmenday"/>
           </MovDayMinus>
           <MovMonthMinus>
             <xsl:value-of select="rsptpcdati-card/rsptpc-movmenmonth"/>
           </MovMonthMinus>        
         </Card>
       </xsl:when>  	
     	 <xsl:when test="$MyFunction = 'get_tipcardnum'">
     		 <Card>
           <xsl:attribute name="Code">
             <xsl:value-of select="rsptpcdati-card/rsptpc-card/text()"/>
           </xsl:attribute>
           <xsl:attribute name="Description">
             <xsl:value-of select="rsptpcdati-card/rsptpc-carddes/text()"/>
           </xsl:attribute>
           <xsl:attribute name="Account">
             <xsl:value-of select="rsptpcdati-card/rsptpc-conto/text()"/>
           </xsl:attribute>
         </Card>
       </xsl:when>  	
     	 <xsl:when test="$MyFunction = 'put_tipcard'">
     		 <Card>
           <xsl:attribute name="Code">
             <xsl:value-of select="rsptpcdati-card/rsptpc-card/text()"/>
           </xsl:attribute>
           <xsl:attribute name="Description">
             <xsl:value-of select="rsptpcdati-card/rsptpc-carddes/text()"/>
           </xsl:attribute>
           <xsl:attribute name="Account">
             <xsl:value-of select="rsptpcdati-card/rsptpc-conto/text()"/>
           </xsl:attribute>
         </Card>
       </xsl:when>  	
     </xsl:choose>
    </Response>
  </xsl:template>
</xsl:stylesheet>
  	
