-
Conditional attribute in xsl:element
Hi,
I'm trying to generate a <body> tag that will have a couple of attributes that will only be needed based on the presence of a variable.
This is what I have:
<xsl:element name="body">
<xsl:variable name="jsString" select="$sourcingInsertJavascriptString"/>
<xsl:attribute name="class">body</xsl:attribute>
<xsl:if test="$jsString">
<xsl:attribute name="onclick">dynOutline()</xsl:attribute>
<xsl:attribute name="language">Javascript1.2</xsl:attribute>
</xsl:if>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<xsl:apply-templates select="@*|node()" />
</table>
</xsl:element>
This is not working for me. I am using $sourcingInsertJavascriptString variable elsewhere and it works correctly. Is this conditional adding of attributes to the body tag possible like this? I only want the onclick attribute added to the body tag if that variable is present.
Thanks!
Gordie
Similar Threads
-
Replies: 1
Last Post: 02-06-2008, 10:18 AM
-
Replies: 1
Last Post: 10-31-2005, 02:57 PM
-
Replies: 1
Last Post: 04-26-2001, 03:20 AM
-
By Noga Atsil in forum XML
Replies: 1
Last Post: 11-21-2000, 01:04 PM
-
By Larry Rebich in forum vb.announcements
Replies: 0
Last Post: 05-22-2000, 12:49 AM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|