joe
joe

Reputation: 17488

How do I tell if a variable in xslt is greater than another

Each of these variables has an integer value. But this syntax is not valid for some reason:

<xsl:when test="$nextAnswerListItemPos < $nextQuestionStemPos" >

Upvotes: 25

Views: 79417

Answers (2)

James Sulak
James Sulak

Reputation: 32447

Also, in XSLT 2.0, you can use the operators "gt" (greater than), "lt" (less than), and "eq" (equal). Using these instead of the entities makes your code a bit cleaner.

Upvotes: 11

Julien Oster
Julien Oster

Reputation: 2322

You have to use &lt; instead of < and &gt; instead of >, because those are reserved characters.

Upvotes: 55

Related Questions