lmi
[Top][All Lists]
Advanced

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

Re: [lmi] calculation summary, questions about xslt


From: Greg Chicares
Subject: Re: [lmi] calculation summary, questions about xslt
Date: Tue, 10 Oct 2006 18:24:05 +0000
User-agent: Thunderbird 1.5.0.4 (Windows/20060516)

On 2006-10-10 15:36 UTC, Evgeniy Tarassov wrote:
> 
> On 10/10/06, Greg Chicares <address@hidden> wrote:
>>
>> Would you please tell me the names of the functions that do this,
>> so that I can be sure I'm looking in the right place?
[...]
> ledger_text_format.cpp:~292:
> 
>    os << "ProducerName\t\t"      << Invar.value_str("ProducerName"   )
> << '\n';
> 
> notice the double 'tab' character appended after each row label. If
> its not to insure that labels does not truncated, then it should be
> some other sort of formatting-sugar.

That is exactly its function: to make sure labels don't get truncated.

On msw, if you've set
  <spreadsheet_file_extension>.xls</spreadsheet_file_extension>
in '/etc/opt/lmi/configurable_settings.xml', then the file that this
code produces looks like an 'excel' file in 'windows explorer'. Users
double-click it, and it opens in 'excel'. As far as they're concerned,
it *is* an 'excel' file. They don't care that it's really tab-delimited
text. I imagine that any other spreadsheet can open this plain-text
file just as well.

The extra tabs make it all work nicely. Users value that. They would
be disappointed if we changed it.

> and the 'for'-loops near the line ledger_text_format.cpp:~384, where
> we break header titles into words, add '\t' after each word and align
> such a tokenized title vectors to be of the same length. I suppose it
> is also some sort of 'visual-formatting' attempts in a tab delimited
> data. Please, correct me if i'm wrong and there is a reason for such
> complications in the code and in the output data.

Interesting. I was sure I had written code that attempted to do
something like that, but couldn't easily find it yesterday. Now that
you point it out, yes, that does seem to be the intended purpose of
the code you point out. It's old code; if I were writing it today,
I'd document its purpose, and probably refactor it, too.

But...does that code actually *do* anything? IIRC, at one time we
took strings like "DeathBenefitOption" and separated them into
words, or took space-delimited strings like "Death Benefit Option"
and joined the words. But today the string in the code is
  "DeathBenefitOption"
and the string in the output is
   DeathBenefitOption
(I cut and pasted them both individually here) and they look the
same to me.

Perhaps you've discovered some dead code that should have been
removed?

> The reason for the original question is that it takes some efforts to
> express the logic from those for-loops using xslt.

If my hypothesis is correct, then it's just dead code that you
can just ignore.

> After looking at the code above could you please confirm that we have
> your benediction to simplify the tab-delimited data as much as
> possible (removing unnecessary double '\t\t' and pasting column
> headers as is, without no manipulations mentioned above)?

I think the double '\t\t' is really what our end users want.

But I think the header manipulations do nothing. Can you easily
verify that, or would you like someone over here to look at it?
It may be easier for us because we're more familiar with what
end users expect.




reply via email to

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