beautypg.com

Delete an xslt parameter, Create and edit conditional xslt regions, Apply a conditional xslt region – Adobe Dreamweaver CC 2015 User Manual

Page 527

background image

520

XML

Last updated 6/3/2015

3

Click the Edit button.

4

Make your changes and click OK.

Delete an XSLT parameter

1

Open the XSL Transformation dialog box. You can do this by double-clicking an XSL Transformation server
behavior in the Server Behaviors panel (Window > Server Behaviors), or by adding a new XSL Transformation
server behavior.

2

Select a parameter from the XSLT parameters list.

3

Click the minus (-) button.

Create and edit conditional XSLT regions

You can create simple conditional regions or multiple conditional regions on an XSLT page. You can either select an
element in Design view and apply a conditional region to the selection, or you can insert a conditional region wherever
the insertion point is in the document.

For example, if you wanted to display the word “Unavailable” next to the price of an item when the item is unavailable,
you type the text “Unavailable” on the page, select it, and then apply a conditional region to the selected text.
Dreamweaver surrounds the selection with tags, and only displays the word “Unavailable” on the page when
the data match the conditions of the conditional expression.

Apply a conditional XSLT region

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 will be wrapped in an block. If you rcontent is not selected, 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 if 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 an expression for a
single true or false value.

1

Select Insert > XSLT Objects > Conditional Region or click the Conditional Region icon in the XLST category of the
Insert panel.

2

In the Conditional Region dialog box, enter the conditional expression to use for the region.

In the following example, you want to test to see if the context node’s @available attribute value is true.

3

Click OK.

The following code is inserted in your XSLT page:

Content goes here