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

RE: Listing things in columns

Subject: RE: Listing things in columns
From: "Lars Huttar" <lars_huttar@xxxxxxx>
Date: Mon, 7 Apr 2003 12:15:05 -0500
lars walter
Walter,
At this URL: http://www.dpawson.co.uk/xsl/sect2/N4486.html#d3975e94
there are a few answers to this specific question, i.e. putting things
in tables, three-to-a-row.
One of them includes putting your </tr><tr> in a CDATA section.   :-p

Lars

Walter Crockett wrote:
> Each Crate may have from 1 to more than 100 Oranges. When I list them
> alphabetically, in paragraph form, the code looks like this:
> 
> <xsl:for-each
> select="//Object[@id=$CrateID]/Relationships/Relationship[Name
> ='Has_Orange']
> /ValueList/Value/Reference">
> 	<xsl:sort select="." data-type="text" order="ascending"/>
> 	<xsl:variable name="OrangeName" select="."/>
> 	<xsl:variable name="OrangeID" select="./@Id"/>
> 	<a href="{$OrangeID}"><xsl:value-of select="$OrangeName"/></a>	
> 	<xsl:if test="position() != last()">, </xsl:if>
> </xsl:for-each>
> 
> But this is messy. Instead, I would like to list them in 
> three columns side
> by side. 
> 
> I tried the following:
> <table>
>  <tr>
>   <xsl:for-each
> select="//Object[@id=$CrateID]/Relationships/Relationship[Name
> ='Has_Orange']
> /ValueList/Value/Reference">
>     <xsl:variable name="OrangeName" select="."/>
>     <xsl:variable name="OrangeID" select="./@Id"/>
>     <td>
> 	<a href="{$OrangeID}"><xsl:value-of select="$OrangeName"/></a>
>     </td>
>     <xsl:if test="position() mod 3 = 0"> [something here to 
> end a row and
> start a new row]</xsl:if>
>   </xsl:for-each>
>  </tr>
> </table>
> 
> But I couldn't make anything work inside the if test, because 
> it doesn't
> like to see </tr><tr>.


 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.