You need to set the xsl:output's method attribute to html.
Joe
From: "Mlachak, Michael (SAIC)" <Michael(_dot_)Mlachak(_at_)bp(_dot_)com>
Reply-To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject: [xsl] DIV tag with class attributes in XSL
Date: Tue, 1 Nov 2005 08:39:30 -0600
I am trying to mimic the HTML <div class="Padding"></div> in an XSL
style sheet. The class attribute "Padding" comes from an XML file. I am
using MSXML (2,3,4) and Internet explorer 6 as my browser. Pertinent
parts of both files are below:
XML File
<?xml version="1.0" encoding="UTF-8"?>
<Menubar>
<SelectedClass>button1</SelectedClass>
<NonSelectedClass>button</NonSelectedClass>
<SeperatorClass>Padding</SeperatorClass>
</Menubar>
XSL File
<xsl:template name="Padding">
<div>
<xsl:attribute name="class"><xsl:value-of
select="//Menubar/SeperatorClass"/></xsl:attribute>
</div>
</xsl:template>
Every time the "Padding" template in the XSL file is called, the code
that gets produced by this translation creates the following:
<div class="Padding" />
Which does not render properly in the HTML page in Internet explorer.
That is to say the padding class does not seem to work.
I can hard code the padding to <div class="Padding"></div> in the style
sheet and everything seems to work fine.
Any help or guidance would greatly be appreciated.
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--