This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Problems passing attributes
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] Problems passing attributes
- From: "Hewko, Doug" <Doug dot Hewko at ccra-adrc dot gc dot ca>
- Date: Fri, 28 Sep 2001 09:01:43 -0400
- Reply-To: xsl-list at lists dot mulberrytech dot com
Can someone please tell me what am I doing wrong? I need to create tables,
so I am mimicing HTML's tables. I am having problems passing the value of
the "border" attribute to the HTML equiivalent. In my HTML code, I see
"<table border="$border"> "
Thanks.
XML:
<table border="1">
<tr>
<td>Column</td>
</tr>
</table>
XSL:
<xsl:template match="table">
<xsl:if test="@border=''">
<xsl:variable name="border">
"0"
</xsl:variable>
</xsl:if>
<xsl:if test="@border!=''">
<xsl:variable name="border">
<xsl:value-of select="@border"/>
</xsl:variable>
</xsl:if>
<table border="$border;" cellspacing="0" cellpadding="0">
<xsl:apply-templates />
</table>
</xsl:template>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list