Re: Dynamic Table Generation

Subject: Re: Dynamic Table Generation
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 7 Mar 2000 13:47:00 GMT
> (2) use it when producing each table row.  however, this involves using a
> node-set()

you wouldn't have to use node-set if you'd have grabbed a node-set
rather than a result tree fragment

so rather than 

<xsl:variable name="content-types">
  <!-- list of (unique) content-types: -->
  <xsl:for-each select="//content-type[not(.=following::content-type)]">
    <th><xsl:value-of select="."/></th>
  </xsl:for-each>
</xsl:variable>


you could do

<xsl:variable name="content-types"
  <xsl:for-each select="//content-type[not(.=following::content-type)]">
  />


and instead of

<xsl:copy-of select="$content-types"/>


do
 <xsl:for-each select="$content-types">
  <th><xsl:value-of select="."/></th>
 </xsl:for-each>

and instead of

 <xsl:for-each select="xt:node-set($content-types)/th">
      <td>
        <xsl:if test=".=$s/content-type">X</xsl:if>
      </td>

do

 <xsl:for-each select="$content-types/content-type">
      <td>
        <xsl:if test=".=$s/content-type">X</xsl:if>
      </td>


David

(untested:-)


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


Current Thread