You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Sylvain MOUGENOT <SM...@sqli.com> on 2002/06/20 13:46:33 UTC

how to deal with tabulations

HI.
I've a structured document where the user can modify some of the
presentation such as alignment, indentation and tabulation.
 
CONTEXT
I use XML datas containing text and some formating infos.
My problem is that I've some text with tabulation within and I don't know
how to treat it.
The aim of that is to align several parts of text at a particular horizontal
index.
For exemple:
    In a footer, the user insert several phone numbers (on several lines)
and each token are separated by a tabulation. The user wants to have the
tokens aligned. 
 
MY ATEMPT
In order to treat it, we have position a value for each tabulation position
(refering to the begining of the line). Like we found in common text
editors, we have a defined number of tabulation (10)representing something
like columns. Each time the client insert a tab, we 'jump' to the closer
next tabulation position.
 
CONSTRAINT
    I can't use tables to do that because we don't know the length of text
entered before a tabulation.
 
PROBLEM
    I can't find the way to position my tokens in the fo file.
 
EXEMPLE
datas:
<xml>
<line>bla bla bla<tab/>00<tab/>33<tab/>472<tab/>bla bla</line> 
<line>la la la.<tab/>00<tab/>33<tab/>473<tab/>la la</line> 
<line>long long long<tab/>00<tab/>33<tab/>473<tab/>end end</line>
</xml>
 
display (needed):
bla bla bla  00  33  472 bla bal
la la la.    00  33  473 la la
long long long   00  33  472 end end
 
looking for some formating like that:
<fo:block>'text'<fo:???>token1</fo:???><fo:???>token2</fo:???>...</fo:block>
 
QUESTION
Is it possible to do?
How can I do that?

Re: how to deal with tabulations

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Sylvain MOUGENOT wrote:
> HI.
> I've a structured document where the user can modify some of the
> presentation such as alignment, indentation and tabulation.
...
> QUESTION
> Is it possible to do?

Not easily with FO builtins. You'll have to use a table,
and you'll have to calculate the table column the text
will go into, and probably column spans for the cells.
It's doable but very messy in XSLT, especially if
proportional fonts are used and even more if (gasp) fonts
are mixed. Your XML is optimized for data entry, not for
processing. That's your problem.
I've seen similar stuff before, and in each case the
problems were caused sloppy analysis of what the users
really needed. Check whether the presentation modifications
are really all necessary in the form declared, and whether
a GUI tool can be used for data entry which produces XML
more amenable to further processing.

J.Pietschmann


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org