[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

DIV tag with class attributes in XSL

Subject: DIV tag with class attributes in XSL
From: "Mlachak, Michael \(SAIC\)" <Michael.Mlachak@xxxxxx>
Date: Tue, 1 Nov 2005 08:39:30 -0600
div class
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.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.