'XSLT greater than / less than working backwords...?

This is kinda driving me crazy... I have an xslt that is passing a value based on choose/when... It works, but the problem is it's working backwards. Unless I'm thinking of the equation the wrong way... Here is a section from the XML...

<LayoutIntent Class="Intent" Status="Available" ID="id00010">
         <FinishedDimensions DataType="ShapeSpan" Preferred="867.330708661417 498.897637795276 0.0"/>
</LayoutIntent>

and here is the xslt section...

<xsl:variable name="width">
    <xsl:value-of select="format-number(number(substring(ResourcePool/LayoutIntent/FinishedDimensions/@Preferred,1,16))div 72,'#.##')"/>
</xsl:variable>
<xsl:variable name="height">
    <xsl:value-of select="format-number(number(substring(ResourcePool/LayoutIntent/FinishedDimensions/@Preferred,18,16))div 72,'#.##')"/>
</xsl:variable>
<finishedWidth>
    <xsl:value-of select="$width"/>
</finishedWidth>
<finishedHeight>
    <xsl:value-of select="$height"/>
</finishedHeight>
<xsl:variable name="code">
    <xsl:choose>
        <xsl:when test="$width &gt; $height">1</xsl:when>
        <xsl:when test="$width &lt; $height">0</xsl:when>
    </xsl:choose>
</xsl:variable>
<orientation>
    <xsl:value-of select="$code"/>
</orientation>

If the width is greater than the height I would expect 1, but I get 0 and vice versa



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source