[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

displaying results in 2 columns

Subject: displaying results in 2 columns
From: Stan Ozier <stan@xxxxxxxxxxxxxxxx>
Date: Fri, 07 Jul 2000 14:51:37 +0200
stan ozier
ok folks, got a situation here...

What I want to do is displaying my results in a table which has two columns

that means, in html:

<table>

  <tr>

   <td>result 1</td>

   <td>result 2</td>

  </tr>

  <tr>

    <td>result 3</td>

    <td>result 4</td>

  </tr>

  ...

</table>

my XML file looks like this:

<thinglist>

  <thing value="result 1"/>

  <thing value="result 2"/>

  <thing value="result 3"/>

  <thing value="result 4"/>

   ...

</thinglist>

my XSL file should be something like this:

<table>

  <tr>

  <xsl:for-each select="thinglist/thing">

   <td><xsl:value-of select="@value"/></td>

   <xsl:if test="position() mod 2 = 1">

      </tr><tr>

   </xsl>

  </xsl:for-each>

  </tr>

</table>

but of course this is impossible because of the </tr><tr> couple of tags in the xsl:if statement.

I couldn't find a solution for this.

Anybody got an idea ?

PS: please don't answer that I have to change my XML file like so:

<thinglist>

  <thingline>

    <thing value="result1"/>

    <thing value="result2"/>

  </thingline>

  <thingline>

     ...

</thinglist>

cause I don't think it's the purpose of XML to solve this kind of problems.

Thank's in advance.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.