beautypg.com

Adobe Dreamweaver CS3 User Manual

Page 446

background image

DREAMWEAVER CS3

User Guide

439

For more information and examples on writing conditional expressions, see the

section in the Reference

panel (Help > Reference).

Apply multiple conditional XSLT regions

You can write a simple conditional expression to insert into your XSLT page. If content is selected when you open
the Conditional Region dialog box, the content is wrapped in an

block. If you do not select content,

the

block is added at the insertion point on the page. It’s a good idea to use the dialog box to get

started and then customize the expression in Code view.

The

element is similar to the

case

statement in other languages. The element provides a way for you

to test a condition and take a course of action based on the result. The

element allows you to test for

multiple conditions.

1

Select Insert > XSLT Objects > Multiple Conditional Region or click the Multiple Conditional Region icon in the

XLST category of the Insert bar.

2

In the Multiple Conditional Region dialog box, enter the first condition.

In the following example, you want to test to see if the context node’s

price

subelement is less than 5.

3

Click OK.

In the example, the following code is inserted in your XSLT page:

Content goes here

Content goes here

4

To insert another condition, place the insertion point in Code view between

tag pairs or just before

the

tag, and then insert a conditional region (Insert > XSLT Objects > Conditional Region).

After you specify the condition and click OK, another

tag is inserted in the

block.

For more information and examples on writing conditional expressions, see the

sections in the

Reference panel (Help > Reference).

Set conditional region (If) properties

The purpose of the Set Conditional Region Property inspector is to change the condition used in a conditional region
in your XSL page. The conditional region tests the condition and takes a course of action based on the result.

In the Test box, enter a new condition, and then press Enter.

September 4, 2007