Noocyte’s Weblog

October 26, 2009

Paying the IE6 tax

Filed under: Work — Tags: , , — noocyte @ 10:28

Lately I’ve done some work on XSLT and search results from FAST. One of the features of FAST are navigators, they basically make it possible to do faceted searches. And the default XSLT that we were working on did not include counters for the navigators, making it harder for the user to guess/understand the impact of adding a new search term. So I had to add the counters (actually I’m working with a collegue on this). The navigators were outputted like this in the XSLT:

<xsl:element name=”option”>
<xsl:attribute name=”value”>
<xsl:value-of select=”@VALUE”/>
</xsl:attribute>
<xsl:attribute name=”title”>
<xsl:value-of select=”@NAME”/>
</xsl:attribute>
<xsl:attribute name=”label”>
<xsl:value-of select=”@NAME”/>
</xsl:attribute>
<xsl:call-template name=”trunctext”>
<xsl:with-param name=”param”><xsl:value-of select=”@NAME”/></xsl:with-param>
<xsl:with-param name=”length”>45</xsl:with-param>
</xsl:call-template>
</xsl:element>

So we changed it like this:

<xsl:element name=”option”>
<xsl:attribute name=”value”>
<xsl:value-of select=”@VALUE”/>
</xsl:attribute>
<xsl:attribute name=”title”>
<xsl:value-of select=”@NAME”/>
</xsl:attribute>
<xsl:attribute name=”label”>
<xsl:value-of select=”@NAME”/> (<xsl:value-of select=”@COUNT”/>)
</xsl:attribute>
<xsl:call-template name=”trunctext”>
<xsl:with-param name=”param”><xsl:value-of select=”@NAME”/></xsl:with-param>
<xsl:with-param name=”length”>45</xsl:with-param>
</xsl:call-template>
</xsl:element>

This would indicate to the user that at 12 documents should remain if that navigator was selected. And on our VPCs this worked as expected. It would ouput a listbox with the navigators and the counters would show up. So we commited the change and went home.

The very next day we checked our daily build, expecting the counters to show up. To to our surprise they did not! At first we figured it was just a deployment issue; maybe an old XSLT was causing problems for us? We navigated directly to the .xsl file and inspected it. Imagine our surprise when the XSLT file was the correct file. We fired up our VPCs and tried again; success on the VPC! Now we’re basically kicking into debugmode; look att differences! There might be a minor difference in the source Xml! We run diff tools but no difference is detected, the source is the same! A lot of head scratching and and ohing and uhing later I realize what the difference is (remember kids; when it looks the same, but behave differently; something is different!); on our physical machines we’re running Windows XP and IE6, but on the VPCs we’re running Windows Server 2003 and IE7/8… Our problem isn’t serverside, but a browser compatability issue! OMG! The problem is, IE6 ignores the label attribute! And IE7/8 will display the label value, but not the actual value (if label attribute is present). Once we realized this the solution was easy enough; we just added the counter after the “xsl:call-template” (trunctext) and removed the label attribute all together. Happy days!

Sorry about hte bad formatting…

Blog at WordPress.com.