Subject: RE: XSL and HTML Table
From: Ben Robb <Ben@xxxxxxxxxx>
Date: Thu, 9 Sep 1999 13:16:50 +0100
|
1) Difficult without seeing the XML structure, but at a guess it is in your
<xsl:for-each> loop. I would take the <TABLE> tag and put it before the
<xsl:for-each> call. I am assuming that you have two "DOCUMENT/PFRAME/BLOCK"
tags in your XML - so you would get two <TABLE> tags in this case.
2) I *think* you will solve the second problem with the solution to the
first.
Rgs,
Ben Robb
cScape
> -----Original Message-----
> From: Gianluca Legittimo [mailto:g_legittimo@xxxxxxxxxxx]
> Sent: 09 September 1999 12:20
> To: xsl-list@xxxxxxxxxxxxxxxx
> Subject: XSL and HTML Table
>
>
> Hi everybody,
>
> 1. I need to know why when I create a Table with the
> following XSL file
> it results in two tables and not the only one I want.
>
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl='http://www.w3.org/TR/WD-xsl'>
> <xsl:template >
> <xsl:apply-templates/>
> </xsl:template>
> <xsl:template match='/'>
> <HTML>
> <BODY STYLE="background-color=#EEEFFF">
> <xsl:for-each select="DOCUMENT/PFRAME/BLOCK">
> <TABLE WIDTH="100%" border="1" >
> <TR>
> <TD WIDTH="2%"></TD>
> <TD WIDTH="97%">
> <hr/>
> <P ALIGN="CENTER">
> <FONT SIZE="4">
> <xsl:value-of select="Title"/>
> </FONT>
> </P>
> <hr/>
> </TD>
> <TD></TD>
> </TR>
> </TABLE>
> ...
>
> 2. how can I refer to two tags with the same name but
> different attributes
> to result in a table with the two tags in two different cells
> of the same
> row. I tried:
>
> <TABLE border="1" WIDTH="100%">
> <TR>
>
> <TD border="1" WIDTH="35%" VALIGN="TOP">
> <P ALIGN="CENTER">
> <FONT SIZE="2">
> <xsl:value-of select="AUTHORS"/>
>
> <xsl:choose>
> <xsl:when test='*[@pos="zero"]'>
> <xsl:apply-templates select="text()"/>
> </xsl:when>
> </xsl:choose>
>
> </FONT>
> </P>
> </TD>
>
> <TD></TD>
> <TD border="1" WIDTH="35%" VALIGN="TOP">
> <P ALIGN="CENTER">
> <FONT SIZE="2">
> <xsl:value-of select="AUTHORS"/>
>
> <xsl:choose>
> <xsl:when test='*[@pos="uno"]'>
> <xsl:apply-templates select="text()"/>
> </xsl:when>
> </xsl:choose>
>
> </FONT>
> </P>
>
> </TD>
>
> </TR>
> </TABLE>
>
> but it doesn't work ! The result is one table with one tag in
> two cells of
> the same row and the other tag in another table in two cells
> of the same
> row.
>
> thanks everybody.
>
> Gianluca
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|