Bug #1591
closedInternet Explorer - Ver 8 and previous: Setting a class attribute value gives '[object]' instead of the real string value
100%
Description
This only affects IE versions 8 and previous:
Dynamically setting the value of a class to any string value results in the '[object]' value being assigned instead of the real string value. For example:
<xsl:tempate match="item">
<li class="{'open'}">
<xsl:value-of select="."/>
</li>
</xsl:template>
Will result in the HTML element: <li class="[object]">First Item</li>
Cause: IE8 and previous versions treat the class attribute as a property of an element called 'className'. Saxon-CE manages this when reading attributes, but when writing, it was only setting the class attribute value. Setting the 'className' property resolves the issue.
Updated by Philip Fearon over 12 years ago
- % Done changed from 0 to 100
Further investigation showed that the align@, @colSpan@, @id@, @rowSpan@, @title
and width
attributes for Internet Explorer up to and including version 8 are similarly affected - with '[object]' being assigned as the attribute value rather than the literal string value supplied. This has been fixed for the next Saxon-CE release.
Summary list of known affected attributes so far:
align
class
colSpan
id
rowSpan
title
width
Given the number of possible attributes affected in pre-IE9 browsers: a more reliable and performant solution than a lookup-list will probably be to test for the existence (ie not "undefined") of a matching element property name for the attribute and update the property if found...
Updated by O'Neil Delpratt almost 12 years ago
- Status changed from Resolved to Closed
- Sprint/Milestone set to Release 1.1
- Fixed in version set to 1.1
Bug fixed for Saxon-CE version 1.1 release
Please register to edit this issue