Skip to content
This repository has been archived by the owner on Jan 16, 2019. It is now read-only.

Docs Webapp XMLXSL Stylesheets

Frank Kleine edited this page Apr 7, 2012 · 1 revision

Table of Contents

Style sheets

The XML/XSL view engine works with several style sheets. This article tries to go into detail which style sheet is used for what and how they relate together.

master.xsl

The master.xsl is provided by Stubbles itself. It contains a bunch of XSL templates as described in XSL Templates. The master.xsl is applied to the skin of the route and transforms it into a real style sheet which in turn is applied onto the XML document created by the application.

Skins

Skins are style sheets for the whole site. They make use of templates defined in the master.xsl and are created by the user. Skins reside in the pages/skins directory, and there needs to be at least one skin named default.xml. If no special skin is selected, Stubbles will fall back to this one.

A skin contains the overall frame for the site, in general this means header and footer, and probably navigation or other stuff that should be available on each site of the application.

Via the <stub:maincontent part="content" path=""/> tag the skin includes the page-specific style sheet.

Here is an example of a very basic skin:

#xml
<stub:document xmlns:stub="http://stubbles.net/stub" method="xml" omit-xml-declaration="yes" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  <html>
    <head>
      <title>Page title</title>
    </head>
    <body>
      <h1>This header will be on every site of the application.</h1>
      <stub:maincontent part="content" path=""/> 
      © 2007 Copyright notice to be present on every site of the application.
    </body>
  </html>
</stub:document>

Route specific style sheets

For each configured route in pages/conf there needs to be a route specific style sheet in page/txt called main_$pagename.xml where $pagename is the name of the file in the conf directory without the .xml ending. This means, if there is a route configuration pages/conf/imprint.xml there must be a route style sheet page/txt/main_imprint.xml. It is included into the skin and renders all data from the XML document related to this route. Within the route style sheet you can make use of every template documented in XSL Templates beside stub:document and stub:maincontent.

=== <xsl:></xsl:><ixsl: ="&#13;&#10;&#10;&#13;&#10;When"></ixsl:>means.

Clone this wiki locally