|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: creating html tables from cells
Dan,
At 04:45 PM 10/15/2003, you wrote: <xsl:key name="ri-types" match="RI" use="@col" /> Allows you to retrieve RI elements by their @col values: okay. Binds a node-set to the variable "ri-types". The nodes are the collected @col attributes of RI elements that are the first RIs with their @col value. iterates over $ri-types for every first RI. But $ri-types will be the same every time. This is a problem. writes the string value of the first node in $content (all your RI elements) whose @col is the same as this RI/@col (which is always 1). This accounts for why your output is so ... regular. :-> Instead, try <xsl:key name="RIs-by-first-RI" match="RI" use="generate-id(preceding-sibling::RI[@col=1][1])"/> <!-- retrieves RI elements by the generated ID of the first preceding RI with @col = 1 --> <xsl:template match="RS">
<table>
<xsl:for-each select="RI[@col=1]">
<!-- create a row -->
<tr>
<!-- create a cell for this RI -->
<td>
<xsl:apply-templates/>
</td>
<!-- now, create cells for all the RIs that come after this one
but not after another RI[@col=1] -->
<xsl:for-each select="key('RIs-by-first-RI',generate-id())">
<td>
<xsl:apply-templates"/>
</td>
</xsl:for-each>
</tr>
</xsl:for-each>
</table>
</xsl:template>Does that help? There are many ways to achieve this, but you started using keys, so I kept on.... 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 ====================================================================== XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








