This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: changing table column to row


> i have a xml file with data in columns,
> Is there an easy (and efficient) way to change this into the 
> html row model.

<xsl:template name="one-row">
  <xsl:param name="row-num" select="1">
  <tr>
  <xsl:for-each select="column">
     <td><value-of select="*[$row-num]"></td>
  </xsl:for-each>
  </tr>
  <xsl:if test="column/*[$row-num+1]">
    <xsl:call-template name="one-row"/>
      <xsl:with-param name="row-num" select="$row-num+1"/>
    </xsl:call-template>
  </xsl:if>
</xsl:template>

Needs a little more care if the columns could be different lengths.

MHK


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]