Friday, October 14, 2011

A small note on Nostro and Vostro

A bank counts a nostro account with a credit balance as a cash asset in its balance sheet. Conversely, a vostro account with a credit balance (i.e. a deposit) is a liability, and a vostro with a debit balance (a loan) is an asset. Thus in many banks a credit entry on an account ("CR") is regarded as negative movement, and a debit ("DR") is positive - the reverse of usual commercial accounting conventions.
With the advent of computerised accounting, nostros and vostros just need to have opposite signs within any one bank's accounting system; that is, if a nostro in credit has a positive sign, then a vostro in credit must have a negative sign. This allows for a reconciliation by summing all accounts to zero (a trial balance) - the basic premise of double-entry bookkeeping.
Typical usage:Nostro accounts are mostly commonly used for currency settlement, where a bank or other financial institution needs to hold balances in a currency other than its home accounting unit.
For example: First National Bank of A does some transactions (loans, foreign exchange, etc.) in USD, but banks in A will only handle payments in AUD. So FNB of A opens a USD account at foreign bank Credit Mutuel de B, and instructs all counter-parties to settle transactions in USD at "account no. 123456 in name of FNBA, at CMB, X Branch". FNBA maintains its own records of that account, for reconciliation; this is its nostro account. CMB's record of the same account is the vostro account.
Now, FNBA sells AUD1,000,000 to C (a counterparty who has an AUD account with FNBA, and a USD account with CMB) for a net consideration of USD2,000,000.

FNBA will make the following entries in its own accounting system:

(Internal) FX AUD trading account1,000,000 DRAUD Account in name of C1,000,000 CR
USD Nostro at CMB (FNBA's nostro)2,000,000 DR(Internal) FX USD trading account2,000,000 CR




Over at CMB, they record the following transaction:
USD Account in name of C2,000,000 DRUSD Account in name of FNBA (CMB's vostro)2,000,000 CR
 

Friday, June 3, 2011

Grouping tags based on Condition +XSLT

Here we are going to discus about how to group the tags under some condition in xslt. I will explain this by taking the Employer example.
        Before this we need to know some of the xslt functions and template calling .
  • generate-id()
  • key()
  • <xsl:key>
  • <xsl:template>
Suppose we have one xml which is having many number of branches in a company .Each branch has many number of employees. The xml looks like this.

<?xml version="1.0" ?>
<Employees>
<Employee>
<TeamID>1</TeamID>
<TeamName>Sales</TeamName>
<TaskID>1</TaskID>
<Hours>5</Hours>
<EmployeeID>1</EmployeeID>
<Name>Bob</Name>
<Surname>Shibob</Surname>
</Employee>
<Employee>
<TeamID>1</TeamID>
<TeamName>Sales</TeamName>
<TaskID>2</TaskID>
<Hours>4</Hours>
<EmployeeID>1</EmployeeID>
<Name>Bob</Name>
<Surname>Shibob</Surname>
</Employee>
<Employee>
<TeamID>1</TeamID>
<TeamName>Sales</TeamName>
<TaskID>4</TaskID>
<Hours>7</Hours>
<EmployeeID>2</EmployeeID>
<Name>Sara</Name>
<Surname>Lee</Surname>
</Employee>
<Employee>
<TeamID>2</TeamID>
<TeamName>Finance</TeamName>
<TaskID>5</TaskID>
<Hours>2</Hours>
<EmployeeID>3</EmployeeID>
<Name>John</Name>
<Surname>Smith</Surname>
</Employee>
<Employee>
<TeamID>2</TeamID>
<TeamName>Finance</TeamName>
<TaskID>3</TaskID>
<Hours>4</Hours>
<EmployeeID>4</EmployeeID>
<Name>Penny</Name>
<Surname>Wise</Surname>
</Employee>
<Employee>
<TeamID>2</TeamID>
<TeamName>Finance</TeamName>
<TaskID>5</TaskID>
<Hours>3</Hours>
<EmployeeID>4</EmployeeID>
<Name>Penny</Name>
<Surname>Wise</Surname>
</Employee>
</Employees>

To do this
·        First declare the one key variable
<xsl:key name=" keyEmployeeID" match="Employee" use=" EmployeeID"/>
·        Then write a for loop for iterating the Employee set
<xsl:for-each select="Employee”>
·        Then generate and id for each key value of employes
<xsl:for-each select="…………generate-id(key('keyEmployeeID', EmployeeID)[1])]">
·        Assign all this ids in to a array
<xsl:for-each select="tEmployee[generate-id(.) = generate-id(key('keyEmployeeID', EmployeeID)[1])]">


Valid XSD format values

xs:datetime
Valid xs:datetime value is 2005-05-27T14:11:00.943Z but the following values are not the valid one
  • 2005-05-27 14:11:00.943Z (missing date and time separator "T"),
  • 2005-05-27T14:11:00.943 (missing time zone)
  • 2005-05-27 14:11:00.943 (missing time separator and time zone).
xs:date
2005-05-27Z is a valid xs:date value but 2005-05-27 is not since no time zone is specified

xs:boolean
True is not a valid xs:boolean valied.It sholud be'true'.similarly 'False' is not valid value,it is 'false'

xs:decimal

value 0.12345678 but not 12E-4.to convert scientific number in to the decimal format you neet to use the following template convertSciToNumString (which is published in the previous post)