Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: formating repeating data >Thread Next - Re: formating repeating data Re: formating repeating dataTo: NULL Date: 1/6/2006 1:36:00 AM In the following XSL I use an xsl:for-each on each participant but using the mod operator in an xsl:if I skip every other participant. In side the xsl:if I start a TR then apply templates to the current participant then apply templates to the current nodes next sibiling by using the following-sibling axis. BTW does the XML really have two 'given' nodes or should the second 'given' node actually be 'initials'? Anthony <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" encoding="UTF-8" indent="yes" /> <xsl:template match="/participants"> <table> <xsl:for-each select="participant"> <xsl:if test="(position() mod 2)"> <tr> <xsl:apply-templates select="." /> <xsl:apply-templates select="following-sibling::*[1]" /> </tr> </xsl:if> </xsl:for-each> </table> </xsl:template> <xsl:template match="participant"> <td> <xsl:value-of select="participatingEntity/associatedPerson/name/given[1]" /> <xsl:text> </xsl:text> <xsl:value-of select="participatingEntity/associatedPerson/name/family" /> </td> </xsl:template> </xsl:stylesheet> | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
