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]
Other format: [Raw text]

RE: Reformatting tables


> How can I write some xsl to reformat this into proper rows?  Eg:

<xsl:template match="tr[count(td[1]/p) &gt; 1]">
 <xsl:for-each select="td[1]/p">
  <tr>
   <td><p><xsl:value-of select="."/></p></td>
   <xsl:variable name="n" select="position()"/>
   <td><p><xsl:value-of select="../../td[2]/p[position()=$n]"/></p></td>
  </tr>
 </xsl:for-each>
</xsl:template>

<xsl:template match="tr">
 <xsl:copy-of select="." />
</xsl:template>

J

 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]