blob: 788fefcceafe0d84bf1443b3197aaed2566ab41b [file] [log] [blame]
<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Conditional Expressions</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch02s03.html" title="How to use the XPath 2.0 grammar with PsychoPath"><link rel="prev" href="ch02s03s07.html" title="Comparisons"><link rel="next" href="ch02s03s09.html" title="Quantified Expressions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="Conditional_Expressions"></a>Conditional Expressions</h3></div></div></div><p>XPath 2.0 allows a conditional expression of the form <span class="italic">if ( E1 ) then E2 else E3</span>. For example,
<span class="italic">if (@discount) then @discount else
0</span> returns the value of the discount attribute if it is
present, or zero otherwise.</p></div></body></html>