lmi
[Top][All Lists]
Advanced

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

[lmi] Calculation summary XML resources structure (with some examples) v


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

Hello,

This message is about the second version of lmi calculation summary
illustration xml data structure.

Here comes some XML data snippets to illustrate the changes we made
compaired to the previous version. It contain mostly topics discussed
in the previous message thread.

A snippet of XML data produced:

<illustration>
  <string_scalar name="AvName">Account</string_scalar>
  <string_scalar name="PrepDay">2</string_scalar>
  <string_scalar name="PrepMonth">October</string_scalar>
  <string_scalar name="PrepYear">2006</string_scalar>

  <double_scalar name="Age">45</double_scalar>
  <double_scalar name="MaleProportion">100%</double_scalar>
  <double_scalar name="LapseMonth" basis="run_curr_basis">11</double_scalar>
  <double_scalar name="LapseMonth" basis="run_guar_basis">2</double_scalar>
  <double_scalar name="LapseMonth" basis="run_mdpt_basis">11</double_scalar>
  <string_vector name="EeMode">
      <duration>Annual</duration>
      <duration>Annual</duration>
      <duration>Annual</duration>
  </string_vector>
  <double_vector name="AcctVal" basis="run_curr_basis">
      <duration>17,696</duration>
      <duration>36,348</duration>
      <duration>56,009</duration>
  </double_vector>
  <double_vector name="AcctVal" basis="run_guar_basis">
      <duration>14,997</duration>
      <duration>30,221</duration>
      <duration>45,670</duration>
  </double_vector>
  <double_vector name="EeGrossPmt">
      <duration>20,000</duration>
      <duration>20,000</duration>
      <duration>20,000</duration>
  </double_vector>
  <supplemental_report>
      <title>Supplemental Report</title>
      <column name="EeGrossPmt" />
      <spacer />
      <column name="AcctVal" basis="run_guar_basis" />
      <spacer />
  </supplemental_report>
</illustration>

Values are represented by one of scalar_string, double_string,
scalar_vector, double_vector. Every node has a 'name' atribute and an
optional 'basis' attribute, that combination is unique inside given
xml snippet.

One important question is why do we need a string/double separation
while all the formatting is done in C++, which means that all double
values already come as string. So why have
string/double_scalar/vector, while we could simply have scalar/vector?
As it was stated during the previous discussion, it allows us to
introduce one extra-validation check type into XMLSchema restricting
the value range for doubles to the values that could be produced by
our formatting rules (f1, f2, f3, f4, bp) (use regular expressions for
that?). That is a question to discuss.

XXX_vector nodes has an ordered set of 'duration' nodes. The position
of each 'duration' node determines by its index ([position()] in XPath
terms).

Number formatting is done in C++. Xml code above already contains
string representation of doubles (formatted using one of allowed rules
'f0', 'f1', 'f2', 'f3', 'f4', 'bp'?).

Number-formatting information (the rule to apply for a particular
value) is stored in 'format.xml' file. This file also contains title
strings for values.

A snippet from 'format.xml':
<columns>
  <column name="EeMode">
      <title>EE Payment Mode</title>
  </column>
  <column name="Age">
      <format>f1</format>
  </column>
  <column name="MaleProportion">
      <format>f3</format>
  </column>
  <column name="LapseMonth">
      <format>f1</format>
  </column>
  <column name="AcctVal">
      <title basis="run_curr_basis">Curr Account Value</title>
      <title basis="run_guar_basis">Guar Account Value</title>
      <format>f1</format>
  </column>
  <column name="EeGrossPmt">
      <title>EE Gross Payment</title>
      <format>f1</format>
  </column>
</columns>

A column can have multiple 'title' nodes (or no 'title' at all) and an
optional 'format' node if the value is a double scalar or vector.

When it comes to producing xml data for an illustration C++ code reads
'format.xml': number-formatting rules for columns and produces xml
nodes formatting doubles accordingly. That allows us to change column
formatting without needless recompilations.

I will post the full versions of correspoding files as a replies to
this message. So if you have any comment/question about a file, please
reply to the corresponding message. That way we could discuss things
separatly.

Eugene




reply via email to

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