This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: HTML table structure
- From: sara dot mitchell at ps dot ge dot com
- To: xsl-list at lists dot mulberrytech dot com
- Date: Wed, 3 Jul 2002 15:25:48 -0400
- Subject: RE: [xsl] HTML table structure
- Reply-to: xsl-list at lists dot mulberrytech dot com
Ah...I looked back at your original message and
it looks like the problem is in how you select.
Your structure has <screen> and <description>
inside following <cell> elements, but your
XSLT is selecting these as though they are
all children of the same <cell>.
So, what is happening is that the template is
matching the first cell which contains the <item-number>
descendants and generating a table with two rows,
one of which has the <item-number> content -- but the
rest is blank because there *are no <screen> or
<description>* children for the first cell. Then
it gets invoked for the next cell which has no
<item-number> descendants but does have <screen>,
and so on. So you're probably actually getting 3 separate tables
-- it just looks like three rows.
What you want (I think :), is something like this:
<xsl:template match="TASKS/GUIDE">
<table border="3">
<tr>
<td valign="top" align="left" width="200"
bgcolor="blue" rowspan="2">
<OL>
<xsl:for-each select="ROW[1]/CELL/LIST/ITEM-NUMBER">
<li><xsl:value-of select = "." /></li>
</xsl:for-each>
</OL>
</td>
<td width="400">
<xsl:for-each select="ROW[2]/CELL/SCREEN">
<li><xsl:value-of select = "." /></li>
</xsl:for-each>
</td>
</tr>
<tr>
<td width="400">
<xsl:for-each select="ROW[3]/CELL/DESCRIPTION">
> <h2><xsl:value-of select = "TITLE" /></h2>
> </xsl:for-each>
> <xsl:for-each select="ROW[3]/CELL/DESCRIPTION">
> <p><xsl:value-of select = "PARA" /></p>
> </xsl:for-each>
> </td>
> </tr>
> </table>
> </xsl:template>
Sara
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list