Listing 1 Rule to translate coupon frequency
<xsl:variable name=²vCouponFrequency">
<xsl:choose>
<xsl:when test="number($vCouponPaymentFrequency) = 1">
<xsl:value-of select="'A'"/>
</xsl:when>
<xsl:when test="number($vCouponPaymentFrequency) = 2">
<xsl:value-of select="'S'"/>
</xsl:when>
<xsl:when test= "number($vCouponPaymentFrequency) = 4">
<xsl:value-of select="'Q'"/>
</xsl:when>
<xsl:when test="number($vCouponPaymentFrequency) = 12">
<xsl:value-of select="'M'"/>
</xsl:when>
</xsl:choose>
</xsl:variable>

Listing 2 Rule to set maturity date
<xsl:variable name="vCalMaturityDate">
<xsl:choose>
<xsl:when test="$vmarketSector='Pfd' and string
($vMaturityDate)=''">
<xsl:value-of select="'2001-01-01'"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$vMaturityDate"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>

Listing 3 Rule for par
<!-- Document containing currency conversion information. -->
<xsl:variable name="docCurrencyConv" select=
"document('./cur_conversion.xml')"/>
<!-- Lookup Currency Conversion table and get the
fx rate & the to Currency code -->
<xsl:variable name="vToCurrency" Select= "$docCurrencyConv/
Root/Conversion[@FromCurrency=$vCurrencyCode]/@ToCurrency" />
<xsl:variable name="vFXRate" select=
"$docCurrencyConv/Root/Conversion[@FromCurrency=
$vCurrencyCode]/@FXRate" />
<!-- Rule to build par value by dividing the LegacyPar with the FXRate-->
<xsl:variable name="vPar">
<xsl:choose>
<xsl:when test="string($vToCurrency) != ''">
<xsl:value-of select="($vLegacyPar div $vFXRate)" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$vLegacyPar" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>

Listing 4 Rule to obtain number of days between two dates
<xsl:templatename="GetNumberOfDays"
xmlns:Date=
"http://www.oracle.com/XSL/Transform/java/java.sql.Date"
<xsl:param name="pFromDate" />
<xsl:param name="pToDate" />
<xsl:variable name="vNumDays"
select="(Date:getTime(Date:valueOf($ToDate)) ­
Date:getTime(Date:valueOf($pFromDate)))
/(1000*60*60*24)" />
<xsl:value-of select="$vNumDays" />
</xsl:template>

Listing 5 Rule to extract time series elements
<!-Rule to get Last schedule date from a repeating element
group of certain type of schedule -->
<xsl:variable name="vLastType1ScheduleDate">
<xsl:choose>
<xsl:when test="schedule[@Type= 'Type1']">
<xsl:value-of select="schedule[@Type = 'Type1']
/scheduleEvent[last()]/scheduleDate" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'0000-00-00'" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:for-each select=
"schedule[@Type='Type2']/scheduleEvent">
<xsl:variable name="vScheduleDate" select=
"scheduleDate" />
<xsl:variable name="vSchedulePrice" select="schedulePrice" />
<!-- Ignore Type2 Schedule events before the last
schedule date for Type1 schedule date ->
<xsl:if test="$vLastType1ScheduleDate !=
'' and concat(substring($vScheduleDate,1,4),
substring($vScheduleDate,6,2), substring($vScheduleDate, 9,2)) >
concat(substring($vLastType1ScheduleDate,1,4),
substring($vLastType1ScheduleDate,6,2),
substring($vLastType1ScheduleDate, 9,2))">
<xsl:variable name="vProvPrice" select="'0'" />
<xsl:variable name="vPrice" value="$vSchedulePrice"/>
<xsl:call-template name="createScheduleElement">
<xsl:with-param name="pSourceId" select=
"$vInstrumenID" />
<xsl:with-param name="pType" select=
"'Type2 Schedule'" />
<xsl:with-param name="pScheduleDate" select=
"$vScheduleDate" />
<xsl:with-param name="pPrice" select="$vPrice" />
<xsl:with-param name="pProvPrice" select=
"$vProvPrice" />
</xsl:call-template>
</xsl:if>
</xsl:for-each>