lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Re: Calculation summary XML resources structure (with some example


From: Evgeniy Tarassov
Subject: [lmi] Re: Calculation summary XML resources structure (with some examples) v2
Date: Tue, 3 Oct 2006 22:59:30 +0200

'html.xsl'

An example of html formatting template. It is almost complete and
could be used to test xsl transormation using command line processor
(xslt -- binary from the official libxslt library).

<?xml version="1.0"?>
<!--
   Xsl template used to render illustration data into html.

   Copyright (C) 2002, 2003, 2004, 2005, 2006 Gregory W. Chicares.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License version 2 as
   published by the Free Software Foundation.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

   http://savannah.nongnu.org/projects/lmi
   email: <address@hidden>
   snail: Chicares, 186 Belle Woods Drive, Glastonbury CT 06033, USA

   $Id: $

   Uses format.xml - column titles, number-formatting and other information.
-->
<xsl:stylesheet version="1.0"
              xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:output method="html" encoding="iso-8859-1" indent="yes" />

<xsl:include href="common.xsl" />

<xsl:template match="/illustration">

<html>
   <head>
       <title>Let me illustrate...</title>
   </head>
   <body>
       <p>
         Calculation summary for<br />
           <xsl:if test="address@hidden'Composite']='1'">
               composite<br/>
           </xsl:if>
           <xsl:if test="address@hidden'Composite']!='1'">
               <xsl:value-of select="address@hidden'Insured1']" />
               <br />
               <xsl:value-of select="address@hidden'Gender']" />,
               <xsl:value-of select="address@hidden'Smoker']" />,
               age <xsl:value-of select="address@hidden'Age']" />
               <br />

               <!--
if(is_subject_to_ill_reg(ledger_values.GetLedgerType())) { -->
               <xsl:value-of select="address@hidden'GuarPrem']" />
               guaranteed premium<br />
               <br/>
               <!-- } -->
               <br/>

               <xsl:value-of select="address@hidden'InitGLP']" />
               initial guideline level premium<br />

               <xsl:value-of select="address@hidden'InitGSP']" />
               initial guideline single premium<br />

               <xsl:value-of
select="address@hidden'InitSevenPayPrem']" />
               initial seven-pay premium<br />
               <xsl:if test="address@hidden'IsMec']='1'">MEC</xsl:if>
               <xsl:if test="address@hidden'IsMec']='0'">Non-MEC</xsl:if>
               <br />
               <br />

               <xsl:value-of select="address@hidden'InitTgtPrem']" />
               initial target premium<br />

               <xsl:value-of select="address@hidden'InitBaseSpecAmt']" />
               initial base specified amount<br />

               <xsl:value-of select="address@hidden'InitTermSpecAmt']" />
               initial term specified amount<br />

               <xsl:value-of
select="number(address@hidden'InitBaseSpecAmt']) +
number(address@hidden'InitTermSpecAmt'])" />
               initial total specified amount<br />
               <xsl:value-of
select="address@hidden'StatePostalAbbrev']" /> state of
jurisdiction<br />
           </xsl:if>
       </p>
       <hr />
       <table width="100%">
       <tr align="right">
           <th></th>
           <th></th>
           <th>Guaranteed</th>
           <th>Guaranteed</th>
           <th>Guaranteed</th>
           <th>Current</th>
           <th>Current</th>
           <th>Current</th>
       </tr>
       <tr align="right">
           <th></th>
           <th></th>
           <th>Account</th>
           <th>Surrender</th>
           <th>Death</th>
           <th>Account</th>
           <th>Surrender</th>
           <th>Death</th>
       </tr>
       <tr align="right">
           <th>Age</th>
           <th>Outlay</th>
           <th>Value</th>
           <th>Value</th>
           <th>Benefit</th>
           <th>Value</th>
           <th>Value</th>
           <th>Benefit</th>
       </tr>
       <tr>
           <th><xsl:call-template name="title">
               <xsl:with-param name="name" select="'Outlay'" />
           </xsl:call-template></th>
           <th><xsl:call-template name="title">
               <xsl:with-param name="name" select="'AcctVal'" />
               <xsl:with-param name="basis" select="'run_guar_basis'" />
           </xsl:call-template></th>
           <th><xsl:call-template name="title">
               <xsl:with-param name="name" select="'CSVNet'" />
               <xsl:with-param name="basis" select="'run_guar_basis'" />
           </xsl:call-template></th>
           <th><xsl:call-template name="title">
               <xsl:with-param name="name" select="'EOYDeathBft'" />
               <xsl:with-param name="basis" select="'run_guar_basis'" />
           </xsl:call-template></th>
           <th><xsl:call-template name="title">
               <xsl:with-param name="name" select="'AcctVal'" />
               <xsl:with-param name="basis" select="'run_curr_basis'" />
           </xsl:call-template></th>
           <th><xsl:call-template name="title">
               <xsl:with-param name="name" select="'CSVNet'" />
               <xsl:with-param name="basis" select="'run_curr_basis'" />
           </xsl:call-template></th>
           <th><xsl:call-template name="title">
               <xsl:with-param name="name" select="'EOYDeathBft'" />
               <xsl:with-param name="basis" select="'run_curr_basis'" />
           </xsl:call-template></th>
       </tr>
       <!--
           We know that all the columns have the same length. Let's
pick one for iteration.
           TODO use 'Age' and 'EndtAge' double_scalars for that purpose
       -->
       <xsl:variable name="age" select="number(address@hidden'Age'])" />
       <xsl:variable name="loop_variable" select="'Outlay'" />
       <xsl:for-each select="address@hidden/duration">
           <xsl:variable name="number" select="number(position())" />
           <tr align="right">
               <td>
                   <xsl:value-of select="$age + $number - 1" />
               </td>
               <td>
                   <xsl:value-of
select="/illustration/address@hidden'Outlay']/duration[position()=$number]"/>
               </td>
               <td>
                   <xsl:value-of
select="/illustration/address@hidden'AcctVal'address@hidden'run_guar_basis']/duration[position()=$number]"/>
               </td>
               <td>
                   <xsl:value-of
select="/illustration/address@hidden'CSVNet'address@hidden'run_guar_basis']/duration[position()=$number]"/>
               </td>
               <td>
                   <xsl:value-of
select="/illustration/address@hidden'EOYDeathBft'address@hidden'run_guar_basis']/duration[position()=$number]"/>
               </td>
               <td>
                   <xsl:value-of
select="/illustration/address@hidden'AcctVal'address@hidden'run_curr_basis']/duration[position()=$number]"/>
               </td>
               <td>
                   <xsl:value-of
select="/illustration/address@hidden'CSVNet'address@hidden'run_curr_basis']/duration[position()=$number]"/>
               </td>
               <td>
                   <xsl:value-of
select="/illustration/address@hidden'EOYDeathBft'address@hidden'run_curr_basis']/duration[position()=$number]"/>
               </td>
           </tr>
       </xsl:for-each>
       </table>
   </body>
</html>

</xsl:template>

</xsl:stylesheet>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]