Xml data and repeating elements – Adobe Dreamweaver CC 2015 User Manual
Page 516
509
XML
Last updated 6/3/2015
If you don’t own the XML page to which you’re linking (for example, if you want to use XML data from an RSS feed
somewhere out on the web), the workflow is a bit more complicated. To perform client-side transformations using XML
data from an external source, you must first download the XML source file to the same directory where your XSLT page
resides. When the XML page is in your local site, you can use Dreamweaver to add the appropriate code that links it to
the XSLT page, and post both pages (the downloaded XML file and the linked XSLT page) to your web server. When
the user views the XML page in a browser, the XSLT page formats the content, just like in the previous example.
The disadvantage of performing client-side XSL transformations on XML data that comes from an external source is
that the XML data is only partially “dynamic.” The XML file that you download and alter is merely a “snapshot” of the
file that lives elsewhere on the web. If the original XML file out on the web changes, you must download the file again,
link it to the XSLT page, and repost the XML file to your web server. The browser only renders the data that it receives
from the XML file on your web server, not the data contained in the original XML source file.
XML data and repeating elements
The Repeating Region XSLT object lets you display repeating elements from an XML file within a page. Any region
containing an XML data placeholder can be turned into a repeated region. However, the most common regions are a
table, a table row, or a series of table rows.
The following example shows how the Repeating Region XSLT object is applied to a table row that displays menu
information for a restaurant. The initial row displays three different elements from the XML schema: item, description,
and price. When the Repeating Region XSLT object is applied to the table row, and the page is processed by an
application server or a browser, the table is repeated with unique data inserted in each new table row.