Colspan problem

Discussion in 'XML' started by ceolino@libero.it, Oct 27, 2006.

  1. Guest

    Hi everybody,
    I have a problem with an xsl document. I have to generate a table from
    an xml document. This table has got a variable number of columns, but
    after last data row I'd like to add a "Total row", which colspan should
    be the number of columns less one:

    -----------------------------------------------
    | A | 1 | 2 | ....................|
    -----------------------------------------------
    | B | 1 | 2 |.....................|
    -----------------------------------------------
    |.............................................|
    -----------------------------------------------
    | Total | 3 |
    -----------------------------------------------

    I tried to put the colspan value into a variable..but then I obviously
    can't retrieve it and put it into colspan td's attribute.
    Can someone help me please?

    Thanks in advance!!

    Davide
     
    , Oct 27, 2006
    #1
    1. Advertising

  2. Andy Dingley Guest

    wrote:

    > generate a table from
    > an xml document. This table has got a variable number of columns, but
    > after last data row I'd like to add a "Total row", which colspan should
    > be the number of columns less one:


    Find some XPath expression that identifies the set of columns.
    Use count() to count this
    Use count()-1 to find the value you need. Maybe store this in a
    variable,
    Place this value into the <td colspan="..." > attribute by using either

    the <td colspan="{$my-colspan-count}" > syntax with a variable,
    or by using
    <td><xsl:attribute name="colspan" ><xsl:value-of
    select="count($my-columns) -1" /></xsl:attribute>
    [...]
    </td>
     
    Andy Dingley, Oct 27, 2006
    #2
    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. Aahz
    Replies:
    1
    Views:
    2,927
    Lucas Tam
    Sep 19, 2005
  2. Replies:
    1
    Views:
    5,051
    Lucas Tam
    Oct 10, 2005
  3. Bruce W...1

    colspan and rowspan problems

    Bruce W...1, Oct 22, 2003, in forum: HTML
    Replies:
    2
    Views:
    3,327
    Jerry Perkins
    Oct 22, 2003
  4. Klaus Wertler

    Colspan and rowspan

    Klaus Wertler, Nov 25, 2003, in forum: HTML
    Replies:
    8
    Views:
    1,456
    Sid Ismail
    Nov 27, 2003
  5. JL
    Replies:
    6
    Views:
    627
    Sid Ismail
    Dec 28, 2003
Loading...

Share This Page