xsl-list
[Top] [All Lists]

[xsl] FW: Two-Column XSL question

2008-01-31 08:10:07

I recently found this post while searching for how to do an two-column list 
from one-column data with XSL:

The following would do the two column display you are after (however I have
checked it for typos etc.)

<xsl:template name="twocolumns">
  <xsl:for-each select="people[position() mod 2 = 1]">
    <tr>
    <xsl:variable name="others" select="following-sibling::option[position()
&lt; 2]" />
      <xsl:for-each select=".|$others">
        <td>
          <xsl:value-of select="person' />
        </td>
        <xsl:if test="not($others)">
          <td></td>
        </xsl:if>
      </xsl:if>
    </tr>
  </xsl:for-each>
<!-- end of sorting the currencies into two columns -->
</xsl:template>

It worked for me, but I need some help understanding what these items are 
actually doing:
1-    <xsl:variable name="others" select="following-sibling::option[position()
&lt; 2]" />
2-       <xsl:for-each select=".|$others">
3-  <xsl:if test="not($others)">

Thanks,
Josh


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>