XSL: how to expand, not replace attribute
Posted on 2003-02-27
I can reach the result that I want, but I want to know if there is a better way.
There is an XML datafile, with different records, and different selection criteria.
I want records that are "selected" to have a special fontcolor.
I want records that are "found" to have a special backgroundcolor.
<xsl:if test="selected = 'True'">
Both attributes are done through the style.
The last style replaces the first style completely, although they can go together very well.
What I want is that the styles add up to each other, so that records that are both "selected" and "found" get both style attributes.
Of course I can expand the possible condition, or use <xsl:when>.
In further development there might be more criteria, and the number of possible combinations grows very rapidly then.
- Is there a way that an attribute will not replace an earlier attribute, but expand it.
- Or is there another way i can avoid to mention explicitely all possible combinations of conditions.