Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Formatting a table in text-output

Reply
Thread Tools

Formatting a table in text-output

 
 
lemmchen
Guest
Posts: n/a
 
      10-11-2005
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.

 
Reply With Quote
 
 
 
 
Harrie
Guest
Posts: n/a
 
      10-11-2005
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-lis.../msg00110.html

I'm playing with that now ..

--
Regards
Harrie
 
Reply With Quote
 
 
 
 
lemmchen
Guest
Posts: n/a
 
      10-12-2005
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

Harrie schrieb:

> 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-lis.../msg00110.html
>
> I'm playing with that now ..
>
> --
> Regards
> Harrie


 
Reply With Quote
 
Harrie
Guest
Posts: n/a
 
      10-12-2005
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-lis.../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.

--
Regards
Harrie
 
Reply With Quote
 
lemmchen
Guest
Posts: n/a
 
      10-13-2005
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.



Harrie schrieb:

> 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-lis.../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.
>
> --
> Regards
> Harrie


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting a single line without effecting the entire table with the Text::Table module Mothra Perl Misc 10 03-11-2005 03:56 PM
Table/table rows/table data tag question? Rio HTML 4 11-05-2004 08:11 AM
Need formatting options menu for formatting hard drive Mark T. Computer Support 3 11-24-2003 11:50 PM
Complex DataList formatting with a <table> Leo Duran ASP .Net 2 10-31-2003 08:12 AM
Could not load type VTFixup Table from assembly Invalid token in v-table fix-up table. David Williams ASP .Net 2 08-12-2003 07:55 AM



Advertisments