![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: How to convert table from column to row order? How to convert table from column to row order?To: NULL Date: 8/10/2006 9:38:00 AM I have xsl to produce an html table but the table is arranged such that columns read top to bottom. I need assistance changing this to read in rows across. I'd like four columns by however many rows similar to what I already have. Items in the first row would be B001, B002, B003 & B004. Row two would contain B016, B017, B023 & B034. Even a link to a simple example doing this would be appreciated. What I've found so far seems very complex to me and I'm having difficulty modifying it for my use. Another question would it be possible to pass just the drawing node selected by "following-sibling::Drawing[x * $NumRows]" to the template rather than individually referencing its text nodes. thanks, LJB -----------xsl------------- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:variable name="NumRows" select="ceiling(count(//Drawing) div 4)"/> <TABLE> <xsl:for-each select="//Drawing[position() <= $NumRows]"> <TR> <xsl:call-template name="TableCell"> <xsl:with-param name="Number" select="Number"/> <xsl:with-param name="Title" select="Title"/> </xsl:call-template> <xsl:call-template name="TableCell"> <xsl:with-param name="Number" select="following-sibling::Drawing[$NumRows]/Number"/> <xsl:with-param name="Title" select="following-sibling::Drawing[$NumRows]/Title"/> </xsl:call-template> <xsl:call-template name="TableCell"> <xsl:with-param name="Number" select="following-sibling::Drawing[2 * $NumRows]/Number"/> <xsl:with-param name="Title" select="following-sibling::Drawing[2 * $NumRows]/Title"/> </xsl:call-template> <xsl:call-template name="TableCell"> <xsl:with-param name="Number" select="following-sibling::Drawing[3 * $NumRows]/Number"/> <xsl:with-param name="Title" select="following-sibling::Drawing[3 * $NumRows]/Title"/> </xsl:call-template> </TR> </xsl:for-each> </TABLE> </xsl:template> <xsl:template name="TableCell"> <xsl:param name="Number"/> <xsl:param name="Title"/> <!-- simple html stuff here <TD> more stuff </TD> --> </xsl:template> </xsl:stylesheet> -----------xml------------- <?xml version="1.0"?> <Drawings> <Drawing> <Number>B001</Number><Title>TYPICAL WASHER</Title> </Drawing> <Drawing> <Number>B002</Number><Title>TYPICAL CLEVIS</Title> </Drawing> <Drawing> <Number>B003</Number><Title>TYPICAL EYEBOLT</Title> </Drawing> <Drawing> <Number>B004</Number><Title>TYP BRACING STRUT</Title> </Drawing> <Drawing> <Number>B016</Number><Title>CLEVIS CONN</Title> </Drawing> <Drawing> <Number>B017</Number><Title>CLEVIS CONN</Title> </Drawing> <Drawing> <Number>B023</Number><Title>WINDPST TOP</Title> </Drawing> <Drawing> <Number>B034</Number><Title>ROOF BRACING</Title> </Drawing> <Drawing> <Number>B060</Number><Title>PRTL COL</Title> </Drawing> <Drawing> <Number>B061</Number><Title>PRTL COL</Title> </Drawing> <Drawing> <Number>B088</Number><Title>CLEVIS CONN</Title> </Drawing> <Drawing> <Number>B099</Number><Title>LOWER CLEVIS</Title> </Drawing> <Drawing> <Number>B100</Number><Title>LOER EYEBOLT</Title> </Drawing> <Drawing> <Number>B101</Number><Title>UPPER CLEVIS</Title> </Drawing> <Drawing> <Number>B102</Number><Title>UPPER EYEBOLT</Title> </Drawing> <Drawing> <Number>B103</Number><Title>BRACE CLEVIS</Title> </Drawing> <Drawing> <Number>B104</Number><Title>BRACE EYEBOLT</Title> </Drawing> <Drawing> <Number>B105</Number><Title>EW BRAC CLIP</Title> </Drawing> <Drawing> <Number>B106</Number><Title>EW BRAC CLIP</Title> </Drawing> <Drawing> <Number>B107</Number><Title>EW BRAC CLIP</Title> </Drawing> </Drawings> | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
