Wednesday, January 28, 2009
You can create XSLT pages that let you display XML data on web pages. You can create either an entire XSLT page -- an XSLT page that contains a tag and a
tag -- or you can create an XSLT fragment. When you create an XSLT fragment, you create an independent file that contains no body or head tag -- a simple piece of code that is later inserted in a dynamic page.
NOTE |
| If you are starting with an existing XSLT page, and need to attach an XML data source to it, see Attaching XML data sources. |
To create an XSLT page:
- Select File > New
- On the General tab of the New Document dialog box, select Basic page from the Category column and do one of the following:
- Select XSLT (Entire page) from the Basics page column to create an entire XSLT page.
- Select XSLT (Fragment) from the Basics page column to create an XSLT fragment.
- Click Create.
The Locate XML Source dialog box appears, asking you to attach an XML data source.
- Do one of the following:
- Select Attach a local file, click the Browse button, browse to a local XML file on your computer, and click OK.
- Select Attach a remote file, enter the URL of an XML file on the Internet (such as one coming from an RSS feed), and click OK.
NOTE
Clicking the Cancel button will generate a new XSLT page with no attached XML data source. For information on attaching XML data sources, see Attaching XML data sources.
Dreamweaver populates the Bindings panel with the schema of your XML data source.
The following table provides an explanation of the various elements in the schema that might appear:
Element
Represents
Details
<>
Required nonrepeating XML element
An element that appears exactly once within its parent node
<>+
Repeating XML element
An element that appears one or more times within its parent node
<>?
Optional XML element
An element that appears zero or more times within its parent node
Element node in boldface type
Current context element
Normally the repeating element when the insertion point is inside a repeat region
@
XML attribute
- Save your new page (File > Save) with the .xsl or .xslt extension (.xsl is the default).
0 comments:
Post a Comment