Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xsl attributes

Status
Not open for further replies.

mplbm

Programmer
Feb 9, 2006
24
GB
If this piece of code sets the bgcolor to the value of @StatusColor,

<xsl:attribute name="bgcolor">
<xsl:value-of select="@StatusColor" />
</xsl:attribute>

why doesn't replacing 'bgcolor' with 'color' or 'forecolor' set the forecolor to the value of @StatusColor?


 
That looks more like a question for the folks over in forum-426 (XML forum).

- George
 
The element is a <td>, which doesn't have an attribute for color or forecolor.
 
Mike,

I imagine that the attribute was being created, but was being ignored by your rendering engine. (It is possible, but not probable, that an overzealous XSLT processor would refuse to create attributes it 'knows' are bad in html output mode.) You would have to look at the source (i.e. the serialized output of the translation) to see.

Tom Morrison
 
Furthering my guess...

from memory (and I've not used this style of HTML for some time).
There is a valid attribute "bgcolor" for a table cell element but there isn't a valid attribute "color" nor "forecolor".

So you can assign the bgcolor attribute a value because it exists within the html spec.
You cannot set the "color" or "forecolor" attribute because neither of those attributes exist within the html spec for a <td> tag.

<honk>*:O)</honk>
Foamcow Heavy Industries - Web site design in Cheltenham and Gloucester
Ham and Jam - British & Commonwealth forces mod for Half Life 2
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top