Subject: [xsl] Listing things in columns From: walter.crockett@xxxxxxxxxxxxxxxxxxxxx Date: Thu, 3 Apr 2003 20:04:06 -0500 |
Because I am working with database meta data (tables and columns), this question could get confusing, so I will change my objects to Crates and Oranges. I need to list all the Oranges in a Crate, and hyperlink from the name of each Orange in the list to a table that contains information that describes the Orange. 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>. Is this a ridiculous way to go about it? Any suggestions? Walter Crockett XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] RE: testing for descendants p, Mac Martine | Thread | RE: [xsl] Listing things in column, Jarno . Elovirta |
Re: [xsl] testing for descendants p, Wendell Piez | Date | Re: [xsl] FO stylesheets for xhtml, G. Ken Holman |
Month |