Formatting a table in text-output

L

lemmchen

Hi folks,

I have a to display a number of tables but not in html, that would be
not a big problem, no I need the tables in text-output. I know, that
the most of cell-data can displayd in one row, but some cells will have
linebreaks.

Maybe someone know a stylesheet doing this formatting work.

As example my xml:
<table>
<col1>hallo</col1>
<col2>world</col2>
<col3>nice to meet you, hope you are fine</col3>
</table>

Has to be formatted in this way :
MyCol1 MyCol2 MyCol3
hallo world nice to meet
you, hope
you are fine

Any ideas ? Thanks a lot for help.
 
H

Harrie

lemmchen said the following on 10/11/2005 13:45 +0200:
I have a to display a number of tables but not in html, that would be
not a big problem, no I need the tables in text-output. I know, that
the most of cell-data can displayd in one row, but some cells will have
linebreaks.

I don't know a solution to the last sentence, maybe some regular of this list has a solution.
Any ideas ? Thanks a lot for help.

I'm currently trying to do the same thing (ASCII tables) and found this:

http://www.biglist.com/lists/xsl-list/archives/200110/msg00110.html

I'm playing with that now ..
 
L

lemmchen

Yes, this is interesting, this stylesheet doesnt look bad. But when you
modify data and make values longer, then data is cut to fit it in
column. The next step is to make linebreaks in one column and consider
it in neighbour column.

Regards
 
H

Harrie

lemmchen said the following on 10/12/2005 08:19 +0200:
Yes, this is interesting, this stylesheet doesnt look bad. But when you
modify data and make values longer, then data is cut to fit it in
column. [..]

That's configurable. Take a look at this page, which I find easier to understand:

http://www.dpawson.co.uk/xsl/sect2/padding.html

I had some success with padding at different width's.
[..] The next step is to make linebreaks in one column and consider
it in neighbour column.

Have you looked at the post two mails further in the thread?

http://www.biglist.com/lists/xsl-list/archives/200110/msg00193.html

I think that stylesheet also accounts for wrapping the text in the cells, but it's is to complex for me, so I'm not sure. I tried to change some of the code given there and now xsltproc gives a segmentation fault (how rude!), so I must be doing something wrong.
 
L

lemmchen

Hi Harrie,

I have tried this table-stylesheet with the test-xml described
somewhere in this thread. It makes a nice table. But when I changes
data in that way, that value is too long for then defined column-width,
I would need a linebreak inside of a column, and this has to lead to
consideration in neighbour-columns.


lemmchen said the following on 10/12/2005 08:19 +0200:
Yes, this is interesting, this stylesheet doesnt look bad. But when you
modify data and make values longer, then data is cut to fit it in
column. [..]

That's configurable. Take a look at this page, which I find easier to understand:

http://www.dpawson.co.uk/xsl/sect2/padding.html

I had some success with padding at different width's.
[..] The next step is to make linebreaks in one column and consider
it in neighbour column.

Have you looked at the post two mails further in the thread?

http://www.biglist.com/lists/xsl-list/archives/200110/msg00193.html

I think that stylesheet also accounts for wrapping the text in the cells, but it's is to complex for me, so I'm not sure. I tried to change some of the code given there and now xsltproc gives a segmentation fault (how rude!), so I must be doing something wrong.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top