beautypg.com

Use parameters with xsl transformations, Add an xslt parameter to an xsl transformation, Edit an xslt parameter – Adobe Dreamweaver CC 2015 User Manual

Page 526

background image

519

XML

Last updated 6/3/2015

After you have completed the two previous steps, you can create new styles in your XSLT fragment using the same
style sheet that you’ve attached to your dynamic page. The HTML output will be cleaner (because the reference to
the style sheet is only valid while working in Dreamweaver), and the fragment will still display the appropriate styles
in Design view. Additionally, all of your styles will be applied to both the fragment and the dynamic page when you
view the dynamic page in Design view, or preview the dynamic page in a browser.

Note: If you preview the XSLT fragment in a browser, the browser does not display the styles. Instead you should preview
the dynamic page in the browser to see the XSLT fragment within the context of the dynamic page.

Use parameters with XSL transformations

You can define parameters for your XSL transformation when adding the XSL Transformation server behavior to a web
page. A parameter controls how XML data is processed and displayed. For example, you might use a parameter to
identify and list a specific article from a news feed. When the page loads in a browser, only the article you specified with
the parameter appears.

Add an XSLT parameter to an XSL transformation

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

In the XSL Transformation dialog box, click the Plus (+) button next to XSLT Parameters.

3

In the Add Parameters dialog box, enter a name for the parameter in the Name box. The name can only contain
alphanumeric characters. It cannot contain spaces.

4

Do one of the following:

• If you want to use a static value, enter it in the Value box.

• If you want to use a dynamic value, click the dynamic icon next to the Value box, complete the Dynamic Data

dialog box, and click OK. For more information, click the Help button in the Dynamic Data dialog box.

5

In the Default Value box, enter the value you want the parameter to use if the page receives no run-time value, and
click OK.

Edit 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.