Dreamweaver CS4 Resources
|
Insert XSLT fragments in dynamic pages
After you have created
an XSLT fragment, you can insert it in a dynamic web page using
the XSL Transformation server behavior. When you add the server
behavior to your page and view the page in a browser, an application
server performs a transformation that displays the XML data from
the selected XSLT fragment. Dreamweaver supports
XSL transformations for ColdFusion, ASP, or PHP pages.
Note: If
you want to insert the contents of an entire XSLT page in a dynamic
page, the procedure is exactly the same. Before using the XSL Transformation
server behavior to insert the entire XSLT page, delete all HTML
code from the dynamic page.
- Open an existing ColdFusion, ASP, or PHP page.
- In Design view, place the insertion point in the location
where you want to insert the XSLT fragment.
Note: When inserting XSLT fragments, you should always click
the Show Code And Design Views button after placing the insertion
point on the page so that you can ensure that the insertion point
is in the correct location. If it isn’t, you might need to click
somewhere else in Code view to place the insertion point where you
want it.
- In the Server Behaviors panel (Window > Server
Behaviors), click the Plus (+) button and select XSL Transformation.
- In the XSL Transformation dialog box, click the Browse
button and browse to an XSLT fragment or an entire XSLT page.
Dreamweaver populates the next text
field with the file path or URL of the XML file that is attached
to the specified fragment. To change it, click the Browse button
and browse to another file.
- (Optional) Click the Plus (+) button to add an XSLT parameter.
- Click OK to insert a reference to the XSLT fragment in
the page. The fragment is not editable. You can double-click the
fragment to open the fragment’s source file and edit it.
An includes/MM_XSLTransform/ folder is also created in
the site’s root folder that contains a runtime library file. The
application server uses the functions defined in this file to perform
the transformation.
- Upload the dynamic page to your server (Site >
Put) and click Yes to include dependent files. The file containing
the XSLT fragment, the XML file containing your data, and the generated
run-time library file must all be on the server for your page to
display correctly. (If you selected a remote XML file as your data source,
that file must reside somewhere else on the Internet.)
|