Creating XSLT Fragments for Server-Side Transformations
Comparing Client-Side and Server-Side Transformations
The client-side method is a very approachable way to get started with XML/XSL publishing because you don’t need an application server. To learn more about client-side transformations, refer to the Dreamweaver 8 Help topic, “About client-side XSL transformations” as well as the article, “Displaying XML Data.” Client-side transformations are not as flexible as a server-side solution for these reasons:
- In order to present the information contained in the XML file as something readable, client-side transformations must use XML files that include a link to an XSLT page. If you plan to use the XML file for several pages, you will need to make a copy of the XML file for each page, which is inefficient. Conversely, in the case of server-side transformations, any number of XSLT fragments on any number of server pages can reference a single XML file. As the XML file is updated, all the pages that rely on the XML file receive the updates.
- With a client-side solution, you need to have write privileges for the XML file in order to insert a link to an XSLT file. While you can copy and save the file locally, the copy will be out of date once the original XML file is updated. The server-side method works with any publicly accessible XML file because the server-side include links the XML and the XSLT files.
- The client-side solution requires the XML file to be fully downloaded. This is wasteful when the file is large and only a small portion of it is needed. With the server-side method, the server collects only the information specified by the XPath expression in the XSLT file.