| 
 
Subject: RE: RE: [xsl] How to implement an array From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Thu, 13 Feb 2003 18:34:41 -0500  | 
<xsl:template match="Table1/Item" mode="celldata">
  <xsl:variable name="Table1" select="."/>
  <tr>
  <xsl:for-each select="./*">
  <xsl:variable name="tval" select="text()"/>
  <xsl:for-each select="$Table1Struct">
    <xsl:variable name="ItemName" select="string(name(.))"/>
    <xsl:if test="count($Table1//*[name(.)=$ItemName]) > 0">
      <td><xsl:value-of select="$tval"/></td>
    </xsl:if>
  </xsl:for-each>
  </xsl:for-each>
  </tr>
</xsl:template>
<xsl:template match="Table1/Item" mode="celldata">
  <xsl:variable name="thisitem" select="."/>
    <tr>
      <xsl:for-each select="$Table1Struct">
        <td>
          <xsl:value-of select="$thisitem/*[name()=name(current())]"/>
          <!-- selects that child of the Item whose name is the name of
               the $Table1Struct node we're looking at -->
          <xsl:if
             test="not($thisitem/*[name()=name(current())])"> </xsl:if>
          <!-- if there is none, gives us a space -->
        </td>
      </xsl:for-each>
  </tr>
</xsl:template>Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
| Current Thread | 
|---|
  | 
| <- Previous | Index | Next -> | 
|---|---|---|
| RE: RE: [xsl] How to implement an a, Imrran Wahid | Thread | RE: RE: [xsl] How to implement an a, Imrran Wahid | 
| RE: [xsl] converting xsl-wd to xsl1, David Carlisle | Date | RE: [xsl] Reference to variable can, Michael Kay | 
| Month |