Dreamweaver CS4 Resources
|
Display XML data in XSLT pages
After you’ve created an XSLT page and attached
an XML data source, you can bind data to the page. To do this, you
add an XML data placeholder to your page and then use the XPath
Expression Builder or the Property inspector to format selected
data that will be displayed on the page.
- Open an XSLT page with an attached XML data source.
- (Optional) Select Insert > Table to add a
table to the page. A table helps you organize your XML data.
Note: In most cases, you use the Repeating Region XSLT object
to display repeating XML elements on a page. In this case, you might
want to create a single-row table with one or more columns, or a
two-row table if you want to include a table header.
- In the Bindings panel, select an XML element and drag
it to the place on the page where you want to insert data.
An XML data
placeholder appears on the page. The placeholder is highlighted and
in curly brackets. It uses the XPath (XML Path language) syntax
to describe the hierarchical structure of the XML schema. For example,
if you drag the child element title to the page, and that
element has the parent elements rss, channel, and item,
then the syntax for the dynamic content placeholder will be {rss/channel/item/title}.
Double-click
the XML data placeholder on the page to open the XPath Expression
Builder. The XPath Expression Builder lets you format selected data,
or select other items from the XML schema.
- (Optional) Apply styles to your XML data by selecting
an XML data placeholder and applying styles to it like any other
piece of content using the Property inspector or the CSS Styles
panel. Alternatively, you can use Design-time style sheets to apply
styles to XSLT fragments. Each of these methods has its own set of
benefits and limitations.
- Preview your work in a browser (File > Preview
in Browser).
Note: When you preview your work using Preview in Browser, Dreamweaver performs an internal XSL transformation
without the use of an application server.
|