Accessibility
John Skidgel

John Skidgel

www.skidgel.com

Table of Contents

Created:
12 September 2005
User Level:
Intermediate
Products:
Dreamweaver

Creating XSLT Fragments for Server-Side Transformations

Extensible Markup Language (XML) is a language for structuring and exchanging information. Typical applications for XML include syndicating blog postings, publishing news feeds, and sharing product specifications. As more schools, government agencies, and businesses adopt XML, incorporating XML is rapidly becoming a common task for web developers.

You can place information from an XML file on a web page in two ways: locally, using a web browser or remotely, using a server technology such as ColdFusion, PHP, ASP, or ASP.NET. Both methods use Extensible Stylesheet Language (XSL) and the XPath query language to transform information in the XML file into content that a web browser can display. Macromedia Dreamweaver 8 facilitates both client-side and server-side workflows by offering developers and designers the ability to bind XML data to entire XSLT pages and XSLT fragments. It also provides server behaviors that transform the data. Each method, however, has its own set of advantages and disadvantages, which I discuss later in this tutorial.

In this tutorial, you’ll create an XSLT fragment and add it to a Macromedia ColdFusion or PHP page. You will use a modified version of the Café Townsend site, the tutorial files that ship with Dreamweaver 8. The new page uses accessible markup, the CSS is now semantic, and I have added a print style sheet. Lastly I have altered the original XML file to include courses: appetizers, entrées, and desserts.

The final page you will create

Figure 1. The final page you will create

(+) View larger

Requirements

To complete this tutorial you will need to install the following software and files:

Dreamweaver 8

Additional Items:

  • A server running one of the following dynamic languages: Macromedia ColdFusion 6.1 or above, PHP 4 and above, ASP or ASP.NET. The application server should also have XSL extensions installed. In either case, the server must also have the correct scripts installed that can process XML and XSL. Please see the TechNote, “Visual Authoring with XML Data FAQ” for more information on how to configure your server correctly to work with XSLT.
  • A Dreamweaver site with an ASP, ASP.NET, ColdFusion, or PHP server defined as the remote server.

Tutorials and sample files:

Prerequisite Knowledge

Experience with creating dynamic server pages and server-side includes (SSI).

About the author

John Skidgel is the senior product designer for Macromedia Dreamweaver. A traditionally trained graphic designer with over 10 years of experience, his interface and information design has won two PC Magazine's Editor's Choice awards, an AIGA award of distinction, and recognition in the book Information Architects. When he’s not designing features for Dreamweaver, he does production design and visual effects for independent films and cooks for his wife Allison and daughter Beatriz.