In xpath why can I use greater-than symbol > but not less-than <

Posted by runrunraygun on Stack Overflow See other posts from Stack Overflow or by runrunraygun
Published on 2010-06-13T13:48:54Z Indexed on 2010/06/13 13:52 UTC
Read the original article Hit count: 312

Filed under:
|
|
|
|

Using c#3 compiled transforms the following seems to work just fine...

<xsl:choose>
    <xsl:when test="$valA > $valB">
        <xsl:value-of select="$maxUnder" />
    </xsl:when>
    <xsl:when test="$valA &lt; $valC">
        <xsl:value-of select="$maxOver" />
    </xsl:when>
</xsl:choose>

However if i dare use a < in place of &lt; it gives an error...

<xsl:choose>
    <xsl:when test="$valA > $valB">
        <xsl:value-of select="$maxUnder" />
    </xsl:when>
    <xsl:when test="$valA < $valC">
        <xsl:value-of select="$maxOver" />
    </xsl:when>
</xsl:choose>

System.Xml.XmlException: '<', hexadecimal value 0x3C, is an invalid attribute character.

So why is > ok and not < ?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about xslt