Operation Manual
477
USING DREAMWEAVER
Displaying XML data with XSLT
Last updated 3/28/2012
Previewing pages for client-side transformations
In the case of client-side transformations, the content the site visitor ultimately sees is transformed by a browser. You
accomplish this by adding a link from the XML file to the XSLT page. If you open the XML file in Dreamweaver and
preview it in a browser, you force the browser to load the XML file and perform the transformation. This provides you
with the same experience as that of your site visitor.
Using this approach, however, makes it more difficult to debug your page because the browser transforms the XML
and generates the HTML internally. If you select the browser’s View Source option to debug the generated HTML, you
will only see the original XML that the browser received, not the full HTML (tags, styles, and so forth) responsible for
the rendering of the page. To see the full HTML when viewing source code, you must preview the XSLT page in a
browser instead.
Previewing entire XSLT pages and XSLT fragments
When creating entire XSLT pages and XSLT fragments, you’ll want to preview your work to make sure that your data
is being displayed correctly. If you use Preview in Browser to display an entire XSLT page or an XSLT fragment,
Dreamweaver performs the transformation using a built-in transformation engine. This method gives you quick
results, and makes it easier for you to incrementally build and debug your page. It also provides a way for you to view
the full HTML (tags, styles, and so forth) by selecting the View Source option in the browser.
Note: This previewing method is commonly used when you begin building XSLT pages, regardless of whether you use the
client or the server to transform your data.
Performing XSL transformations on the server
Workflow for performing server-side XSL transformations
You can perform server-side XSL transformations on the server. Read about server-side and client-side XSL
transformations and about using XML and XSL with web pages before building pages that display XML data.
Note: Your server must be correctly configured to perform server-side transformations. For more information, contact
your server administrator.
The general workflow for performing server-side XSL transformations is as follows (each step is described in other
topics):
1. Set up a Dreamweaver site.
2. Choose a server technology and set up an application server.
3. Test the application server.
For example, create a page that requires processing, and make sure that the application server processes the page.
4. Create an XSLT fragment or page, or convert an HTML page to an XSLT page.
• In your Dreamweaver site, create an XSLT fragment or an entire XSLT page.
• Convert an existing HTML page to an entire XSLT page.