color value from xml to backgroundcolor div in xhtml
Posted: Wed Dec 23, 2009 7:40 pm
Hi,
I have RGB value's in my XML file, they look like this:
I want a square in my html file with those RGB value's as color.
I've tried this:
But I can't put an xslt element in an attribute of a div element.
Is there an other way to do this?
I have RGB value's in my XML file, they look like this:
Code: Select all
<egInk:r>.3218039274</egInk:r>
<egInk:g>.4258823395</egInk:g>
<egInk:b>.4894117713</egInk:b>
I've tried this:
Code: Select all
<div class="kleurvak" style="background-color:rgb(<xsl:value-of select="round(egInk:r*256)"/>,<xsl:value-of select="round(egInk:g*256)"/>,<xsl:value-of select="round(egInk:b*256)"/>);">
</div>
Is there an other way to do this?