“If” Expressions

XPath 2.0 also adds an “if” expression:

if ($part/@discount)
   then $part/retail * $part/@discount
   else $part/retail

Again, this is in XPath and might appear in a select attribute.

if ($drink/@virgin) then $drink/@virgin else false()

XSLT 2.0 retains the xsl:if and xsl:choose instructions.