Formatting a table in text-output

Discussion in 'XML' started by lemmchen, Oct 11, 2005.

  1. lemmchen

    lemmchen Guest

    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.
     
    lemmchen, Oct 11, 2005
    #1
    1. Advertising

  2. lemmchen

    Harrie Guest

    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 ..

    --
    Regards
    Harrie
     
    Harrie, Oct 11, 2005
    #2
    1. Advertising

  3. lemmchen

    lemmchen Guest

    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-list/archives/200110/msg00110.html
    >
    > I'm playing with that now ..
    >
    > --
    > Regards
    > Harrie
     
    lemmchen, Oct 12, 2005
    #3
  4. lemmchen

    Harrie Guest

    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.

    --
    Regards
    Harrie
     
    Harrie, Oct 12, 2005
    #4
  5. lemmchen

    lemmchen Guest

    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-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.
    >
    > --
    > Regards
    > Harrie
     
    lemmchen, Oct 13, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. rashmi

    formatting output in the form of table

    rashmi, Jun 21, 2005, in forum: C Programming
    Replies:
    1
    Views:
    273
    Rajan
    Jun 21, 2005
  2. Glen
    Replies:
    6
    Views:
    1,190
    Steve Holden
    Apr 24, 2007
  3. Mothra
    Replies:
    4
    Views:
    190
    Mothra
    Dec 9, 2003
  4. Mothra
    Replies:
    10
    Views:
    481
    Anno Siegel
    Mar 11, 2005
  5. Joseph L. Casale

    Formatting text in a table with reportlab

    Joseph L. Casale, Dec 12, 2013, in forum: Python
    Replies:
    0
    Views:
    87
    Joseph L. Casale
    Dec 12, 2013
Loading...

Share This Page