Detailed instructions for use are in the User's Guide.
[. . . ] Getting Started with Dreamweaver
Trademarks 1 Step RoboPDF, ActiveEdit, ActiveTest, Authorware, Blue Sky Software, Blue Sky, Breeze, Breezo, Captivate, Central, ColdFusion, Contribute, Database Explorer, Director, Dreamweaver, Fireworks, Flash, FlashCast, FlashHelp, Flash Lite, FlashPaper, Flex, Flex Builder, Fontographer, FreeHand, Generator, HomeSite, JRun, MacRecorder, Macromedia, MXML, RoboEngine, RoboHelp, RoboInfo, RoboPDF, Roundtrip, Roundtrip HTML, Shockwave, SoundEdit, Studio MX, UltraDev, and WebHelp are either registered trademarks or trademarks of Macromedia, Inc. and may be registered in the United States or in other jurisdictions including internationally. Other product names, logos, designs, titles, words, or phrases mentioned within this publication may be trademarks, service marks, or trade names of Macromedia, Inc. or other entities and may be registered in certain jurisdictions including internationally. [. . . ] An entire XSLT page is similar to a regular HTML page. It contains a <body> tag and a <head> tag, and lets you display a combination of HTML and XML data on the page. An XSLT fragment is a piece of code, used by a separate document, that displays formatted XML data. Unlike an entire XSLT page, it is an independent file that contains no <body> or <head> tag. If you want to display XML data on a page of its own, you would create an entire XSLT page, and bind your XML data to it. If, on the other hand, you wanted to display XML data in a particular section of an existing dynamic page--for example, a dynamic home page for a sporting goods store, with sports scores from an RSS feed displayed on one side of the page--you would create an XSLT fragment and insert a reference to it in the dynamic page. Creating XSLT fragments, and using them in conjunction with other dynamic pages to display XML data is the more common scenario when working with server-side transformations. In this tutorial, you'll create an entire XSLT page and use it to transform a sample XML file. The transformation will be a client-side transformation that uses a modern browser (Internet Explorer 6, Netscape 8, Mozilla 1. 8, or Firefox 1. 0. 2). Server-side transformations are beyond the scope of this tutorial as they require that you have an application server configured with a transformation engine. For a comprehensive overview of server-side and client-side XSL transformations, see "About server-side XSL transformations" and "About client-side XSL transformations" in Using Dreamweaver (Help > Using Dreamweaver).
178 Tutorial: Displaying XML Data
For additional resources, including tutorials that teach you more about server-side transformations, see www. macromedia. com/go/dw_xsl.
Convert an HTML page to an XSLT page
You'll begin by converting the existing specials page for Cafe Townsend-- an HTML page--into an XSLT page that can display XML data.
1.
In the Files panel (Window > Files), locate the xml_menu. html, and double-click the file to open it. The xml_menu. html file is located in the xml folder, inside the cafe_townsend root folder. For more information, see "Locate your files" on page 174. Select File > Convert > XSLT 1. 0.
2.
Dreamweaver opens a copy of the xml_menu page in the Document window. The new page is an XSL style sheet, saved with the . xsl extension.
3.
Click on the xml_menu. html page and close it so that only the new xml_menu. xsl page is displayed in the Document window.
Convert an HTML page to an XSLT page 179
Attach an XML data source to the XSLT page
Next you'll attach an XML data source to the page using the Bindings panel.
1.
In the Bindings panel (Window > Bindings), click the XML link.
You can also click the Source link at the upper-right corner of the Bindings panel to add an XML data source. 2.
180 Tutorial: Displaying XML Data
N OT E
Select Attach a Local File (it should be selected by default), click the Browse button, browse to the specials. xml file on your computer (it's also located in the cafe_townsend/xml folder), and click OK. Click OK to close the Locate XML Source dialog box. Dreamweaver populates the Bindings panel with the schema of your XML data source.
3.
For a guide to the symbols in the schema, see "Creating XSLT pages" in Using Dreamweaver (Help > Using Dreamweaver).
Alter the XSLT page layout
Now that you're going to use XML data on the page instead of static text, you won't need all the table rows. Next you'll delete all but one of the table rows, and use the one remaining row to display the data.
1.
Click once in the last table row (the New York Cheesecake row) and click the rightmost <tr> tag in the tag selector to select the row.
2. Repeat the previous steps to delete the Grilled Pacific Salmon row, and the Thai Noodle Salad row. When you're finished, you should have one row left on the page--the Summer Salad row. Select all of the text in the left table cell.
4.
Alter the XSLT page layout
181
5.
In the Property inspector (Window > Properties), select None from the Style pop-up menu.
This step removes the menu class style from the selected text. [. . . ] Click the Plus (+) button on the panel and select MySQL Connection from the pop-up menu. The MySQL Connection dialog box appears, Enter connTownsend as the connection name. In the MySQL Server text box, specify the computer hosting MySQL. If MySQL is running on the same computer as Dreamweaver, enter localhost.
3. [. . . ]