LSSI Guide

Overview

LSSI is a simple XML based web template language.

LSSI is fully based on XML and namespaces. This means that it's easy to efficiently use LSSI together with other XML technologies, such as XSLT (for example, you can process the output of LSSI with XSLT).

LSSI is used for simple pseudo-dynamic web content generation. For a more advanced web template language, see LSP.

LSSI basics

An LSSI page is a well-formed XML document, composed of elements from the LSSI namespace and from other namespaces (including the null namespace). The document root element may, but doesn't have to, be in the LSSI namespace.

The namespace URI for LSSI is http://staldal.nu/Lagoon/LSSI. In this document, it's assumed that this namespace is mapped to the prefix lssi, however any prefix may be used.

An LSSI page is processed by interpreting all LSSI elements, and sending all non-LSSI elements, all character data and all processing instructions to the output. Comments in the LSSI page are ignored. Any DTD in the LSSI page is not sent to the output.

It's simple to start using LSSI in a static HTML (or some XML based markup language) page. Just add a declaration for the LSSI namespace (xmlns:lssi="http://staldal.nu/Lagoon/LSSI") in the root element and add LSSI elements. However, you must ensure that the HTML page is in well-formed XML format.

LSSI elements

This section describes all elements in the LSSI namespace. An attribute name in bold means this attribute is required.

lssi:include

<lssi:include
  file = URL />

The lssi:include element includes a file when the page is executed. Any elements in the LSSI namespace in the included file are processed, and an included file may include other files in arbitrary nesting.

lssi:root

<lssi:root>
  <!-- Content: any -->
</lssi:root>

The lssi:root element simply outputs all of its content. Useful as document root element in files to be included. The lssi:root element can be nested.

lssi:date

<lssi:date
  format = format
  tz = timezone />

The lssi:date element print the date/time when Lagoon processed this page (not when the user displays the page!). The format parameter specifies the date/time format to use, the same as Java SimpleDateFormat, if not specified yyyy-MM-dd is used. The tz parameter specifies the time zone to use (e.g. "GMT"), is not specified the local time zone is used (of the machine where Lagoon runs, which may be different from the web server and from the user displaying the page).

lssi:lastmod

<lssi:lastmod
  file = URL
  format = format
  tz = timezone />

The lssi:lastmod element print the date/time when a file was last modified. The file parameter specifies the file to check, if not specified the main source file is used (not an included file). The format and tz parameters are used as in lssi:date.