Avatar of bob_mechler
Flag for United States of America asked on

xsl:attribute-set name <STYLE>

I want to know how I can keep from repeating the styling code for a <td> in an xsl stylesheet.

Current code:
								     <td Style="
									font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
									font-weight: bold;
									font-size: 10pt;
									font-style: normal;
									font-variant: small caps;
									text-align: center;
									text-decoration: none;
									background-color: #000099;
									padding-top: 5px;
									padding-bottom: 5px;
									padding-left; 2px;
									padding-right: 2px">View</td>

Open in new window

The above works but must be repeated for each element in the row. I think it can be done in one line using xsl:use-attribute-sets . Below is my first attempt:
[<td  colspan="2" xsl:use-attribute-sets="rowheader">Market Value</td>

Open in new window

based on this code at the top of the stylesheet
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:auto="http://www.w3.org/TR/WD-xsl">
    <xsl:attribute-set name ="rowheader">
        <xsl:attribute name ="font-family">Verdana, Geneva, Arial, Helvetica, sans-serif</xsl:attribute>
        <xsl:attribute name ="font-weight"> bold</xsl:attribute>
        <xsl:attribute name ="font-size">10pt</xsl:attribute>
        <xsl:attribute name ="font-variant">small caps</xsl:attribute>
        <xsl:attribute name ="text-align">center</xsl:attribute>
        <xsl:attribute name ="color">#ffffff</xsl:attribute>
        <xsl:attribute name ="background-color">#000099</xsl:attribute>
        <xsl:attribute name ="padding-top">5px</xsl:attribute>
        <xsl:attribute name ="padding-bottom">5px</xsl:attribute>
        <xsl:attribute name ="padding-left">2px</xsl:attribute>
        <xsl:attribute name ="padding-right">2px</xsl:attribute>

Open in new window

I'm working with someone else's code and their call-template doesn't find the stylesheet so I'm trying this approach.

I've searched stackoverflow and others but they don't have complete examples of the basics.

It's very early in my self-education on xsl.  I'm hoping all I've done is mess up some syntax.
Web ApplicationsXMLCSS

Avatar of undefined
Last Comment

8/22/2022 - Mon
Gertone (Geert Bormans)

<tr xsl:use-attribute-sets="rowheader">
Gertone (Geert Bormans)

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

I gave up trying to make asp.net 1.1 work. I also discovered that the CSS was not working because of the directory it was in. ASP.NET 1.1 didn't have an issue with it being in a sub folder. When I placed the STYLE.CSS in the root folder of the website, everything started working. I had also loaded the project into Visual Studio 2010 with everything set to 2.0 Classic application pool. I even made sure that on II7 no other application pool was even started besides the 2.0 Classic. Visual Studio 2010 did not convert on previous tries when other application pools were available. The web site now works.

Please, no need for furth responses. I did however learn a great deal about css elements in xsl so I'll give credit to the person who helped the most.

I received useful insight although I solved the issue by moving in a different direction. Thanks!
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck