Stylefree Examples

  1. The Traditional Solution

    the traditional solution: generic page structure is built in the stylesheet

  2. First Step - Removing (Most of) the Presentation from the Stylesheet

    As a first step, let's focus on the XSLT sheet and see how we can separate most of the presentation from the logic.
    An easy way to do this is to isolate the template above in an XHTML document.
    In this document we'll add some control elements (possibly using a separate namespace - not an absolute requirement, but rather a matter of style) which will trigger templates in the style sheet.

  3. Second Step - Taking Care of the Main Source Document

    We repeat the same technique with the XML source file (source.xml) as we did with the style sheet: we separate the content from the presentation in this file, and obtain an XML description of the layout for this particular page, separate from the description of the content. This mirrors our separation of the general layout of the site from the logic.

    This kind of multi-level layout is very convenient when designing portal sites, where there is an aggregation of data from different sources in order to create the "body" part of the page. Using the main document source file as a layout allows us to keep most of the (normally dynamic) data in separate files or data sources where they belong.