XSLT empty table header

Discussion in 'XML' started by marianowic, Mar 19, 2007.

  1. marianowic

    marianowic Guest

    Hello.
    I fighting with xsl transforamtions and I have the following problem:

    I'm building dynamic table and everything works beautiful when the are
    some date in the xml file. But when the table supose to be empty, I
    want it(table) to disapear (visible = false). But I get the header of
    the table.
    Is there any property or something that can fix it (make everything
    disapear??
    Thanks a lot for help... marianowic
    marianowic, Mar 19, 2007
    #1
    1. Advertising

  2. marianowic

    Simon Brooke Guest

    in message <>,
    marianowic ('') wrote:

    > Hello.
    > I fighting with xsl transforamtions and I have the following problem:
    >
    > I'm building dynamic table and everything works beautiful when the are
    > some date in the xml file. But when the table supose to be empty, I
    > want it(table) to disapear (visible = false). But I get the header of
    > the table.
    > Is there any property or something that can fix it (make everything
    > disapear??
    > Thanks a lot for help... marianowic


    Are you outputting HTML?

    Are you using XSL of the general structure:

    <table>
    <xsl:apply-templates select="row"/>
    </table>

    If so you probably want something of the form

    <xsl:if test="row">
    <table>
    <xsl:apply-templates select="row"/>
    </table>
    </xsl:if>


    --
    (Simon Brooke) http://www.jasmine.org.uk/~simon/

    ;; IE 3 is dead, but Netscape 4 still shambles about the earth,
    ;; wreaking a horrific vengeance upon the living
    ;; anonymous
    Simon Brooke, Mar 20, 2007
    #2
    1. Advertising

  3. marianowic

    swami Guest

    <xsl:variable name="kount" select="count( name)" />
    <xsl:if test="kount<>0>
    <table>
    </table>
    </xsl:if>


    I think this code might do for you.

    Swami.






    On Mar 20, 2:02 pm, Simon Brooke <> wrote:
    > in message <>,
    >
    > marianowic ('') wrote:
    > > Hello.
    > > I fighting with xsl transforamtions and I have the following problem:

    >
    > > I'm building dynamic table and everything works beautiful when the are
    > > some date in the xml file. But when the table supose to be empty, I
    > > want it(table) to disapear (visible = false). But I get the header of
    > > the table.
    > > Is there any property or something that can fix it (make everything
    > > disapear??
    > > Thanks a lot for help... marianowic

    >
    > Are you outputting HTML?
    >
    > Are you using XSL of the general structure:
    >
    > <table>
    > <xsl:apply-templates select="row"/>
    > </table>
    >
    > If so you probably want something of the form
    >
    > <xsl:if test="row">
    > <table>
    > <xsl:apply-templates select="row"/>
    > </table>
    > </xsl:if>
    >
    > --
    > (Simon Brooke)http://www.jasmine.org.uk/~simon/
    >
    > ;; IE 3 is dead, but Netscape 4 still shambles about the earth,
    > ;; wreaking a horrific vengeance upon the living
    > ;; anonymous
    swami, Mar 21, 2007
    #3
    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. John

    empty/non-empty element

    John, Jul 15, 2003, in forum: XML
    Replies:
    1
    Views:
    1,012
    Klaus Johannes Rusch
    Jul 16, 2003
  2. Lukas
    Replies:
    3
    Views:
    787
    spiff
    Nov 10, 2005
  3. Marcia Hon

    Check if a directory is empty and empty it

    Marcia Hon, Feb 8, 2004, in forum: C Programming
    Replies:
    8
    Views:
    564
    Dave Thompson
    Feb 14, 2004
  4. Brian Roberts

    empty lists vs empty generators

    Brian Roberts, May 3, 2005, in forum: Python
    Replies:
    12
    Views:
    644
    Jeremy Bowers
    May 4, 2005
  5. mlt
    Replies:
    2
    Views:
    819
    Jean-Marc Bourguet
    Jan 31, 2009
Loading...

Share This Page