This one has left me completely confused. I have a multi text color cell. Most of the data is shared in one way or another so I wanted to use templates to do most of work. To do that I sought to pass the text color as a parameter to the template. A super simple example:
<xsl:variable name="textColor">
<xsl:choose>
<xsl:when test="$cellColor = 's73'">
<xsl:text>#FFFFFF</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>#000000</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="detailLines">
<xsl:with-param name="textColor" select="$textColor"/>
</xsl:call-template>
<xsl:template name="detailLines">
<xsl:param name="textColor"/>
<!-- Start new line -->
<xsl:text disable-output-escaping="yes">&#10;</xsl:text>
<!-- Bunch of stuff after this -->
<Font html:Color="{$textColor}">
<xsl:text>[</xsl:text>
</Font>
Usually I have no issues out of this, but I was floored when the text color didn't seem to pass. However, when I debug the text color is passing. Further investigation showed that the XML created has the text color as well, but Excel does not display it, but instead defaults to black.
I've got the Excel namespaces in their usual location and even attempting to move them around doesn't help resolve the issue.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40">
<xsl:output method="xml" encoding="UTF-8"/>
Any ideas would be great! I've not had an issue quite like this where the variable is acting as expected, but Excel is not.
EDIT TO ADD ADDITIONAL INFORMATION:
I've found a difference, but I'm not sure how to interpret it.
<Font html:Color="#FFFFFF">Two Box</Font>
<Font html:Color="#FFFFFF">]</Font>
<Font html:Color="#FFFFFF" xmlns="urn:schemas-microsoft-com:office:spreadsheet">[</Font>
The first two lines are from code that does not enter the detailLines template and so it calls the cellColor variable directly. The last line is from the template where the variable is passed. The namespace seems to be causing my issue, but I can't understand 1) why it is there, and 2) how to make it go away.
EDIT - Addressing cellColor comment
I cannot put the actual code here for multiple reasons, but the cellColor variable is calculated just prior to the textColor. At it's most redacted it is:
<xsl:variable name="cellColor">
<xsl:choose>
<xsl:when test="A">
<xsl:text>s216</xsl:text>
</xsl:when>
<xsl:when test="B'">
<xsl:text>s73</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>s210</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>