O'Reilly logo

Dreamweaver 8: The Missing Manual by David Sawyer McFarland

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

XML and XSLT Tutorial

In this tutorial, you'll learn how to create an XSLT fragment that formats news headlines from the National Exasperator. The headlines are contained in an XML file. You'll add the XSLT fragment to a dynamic page on the same site you've been working on in tutorials throughout this book. To get started, you need to grab the dynamic site files from www.sawmac.com/dw8/tutorials , and you'll have to have set up a Web server and application server as described in Chapter 20. However, you don't need to have finished any of the tutorials for Chapters 21, 22, or 23 to complete this tutorial.

Start by creating a new XSLT fragment:

  1. Choose File New.

    The New Document window appears.

  2. Make sure the Basic tab is selected. Choose Basic Page from the category list and XSLT (fragment) from the basic page list. Click Create.

    The Locate XML Source window appears (see Figure 24-1), from which you can tell Dreamweaver which XML file to use. This can be either the XML file located with the tutorial files (feed.xml) or, if you're connected to the Internet, you can try the online version of the file located on the National Exasperator Web site at http://www.nationalexasperator.com/feed.xml. Using the online file lets you simulate what it's like to access an RSS feed from a news site like CNN.com or Wired.com.

  3. To use the local XML file, click the Browse button, navigate to the news folder in the site's root folder, and then select the feed.xml file. To use an XML file from some online ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required