This document debscribes some technologies leveraged by Lenya and their purpose in the content management and publishing environment. These are the key technologies you need to know to develop a site with Lenya.


XSL - the eXtensible Stylesheet Language - comprises

  • XSLT (XSL Transformations)
  • XPath (for specifying parts of XML documents)
  • XSL-FO (XSL Formatting Objects)


XSLT has a much bigger scope than just presentation issues. It is not a layout language, it's a processing (transformation) programming language. XSLT itself cannot express any layout information.

Why shouldn't XSLT be used for web-based presentation?

A key issue is the separation between semantics and presentation, which should even be available at the client side (browser), for instance for accessibility reasons. To the user agent, a clean, semantic form of the content must exist to allow custom presentation options (like screen readers - JAWS - , a print version, ...). Otherwise, all these presentation options would have to be provided by the server (CMS) and wouldn't be customizable and extensible on the client side.

In your XML-based application, you usually have other structures which are based on your domain (medicine, mathematics, music, ...). These structures are necessary to hold all semantic information of your domain. But on the client side, we need a standardized structure which can be understood by all user agents (browsers). That's what XHTML is about - it's a standardized language to express sequential, structured content.

XSLT is the technology to transform your domain oriented content into the standardized XHTML content.

XSLT could also be used for different client-side presentation options (like print views, multiple or single column layouts, ...), but this has some drawbacks:

  • not all browsers support client-side XSLT
  • XSLT is much more complex than CSS (more flexibility is necessary)
  • XSLT is much harder to learn
  • another complex standardized presentation format would be required, which would be the target format of the XSLT transformation (at the moment this is HTML with style markup in most cases)


XSL-FO is a page layout description language, comparable perhaps to postscript. XSL-FO is the weapon of choice when printable pages are required. It is extremely powerful, especially in combination with SVG you can implement amazingly complex designs. It is much more flexible than CSS for print views, but also much harder to learn and much more verbose.

Sitemaps & Pipelines

Lenya uses Cocoon's sitemap (*.xmap) language and Cocoon pipelines (generators, matchers, selectors, actions, transformers, and serializers) for defining the sequence of events that happens with each request to the server. It is critical to have a good understanding of the Cocoon sitemap syntax when developing any site using Lenya.

For an introduction to Cocoon sitemaps and pipelines, see the Supersonic Tour of Cocoon, found in Cocoon's "tour" block, or online at . Note that XMAP is not a common word among Cocoon project members, they tend to simply speak of "Pipelines and Sitemaps".


CSS is the weapon of choice for styling XML (e.g., XHTML) and SVG for simple, flexible applications (like web pages).

See also

Apache Ant

Ant is a tool used most commonly to compile/build Java applications. But Lenya 1.2.x also uses Ant Tasks to do file system operations (particulary file moves & copies – see list of Lenya ant tasks) in an platform-independent way. Note: Ant tasks are gradually being replaced by Java code in Lenya 2.0.

Server-side JavaScript

Lenya uses Javascript on the server side to define workflow logic. It uses a version of Mozilla Rhino, an implementation of the JavaScript language in Java, that has been modified to support Continuations. If you will be developing a custom workflow you will need a good grasp of this technology.


XSP is considered a legacy technology by most Cocoon developers. It continues to be supported, and parts of Lenya 2.0 still use it, but it should be avoided for new projects if possible. – JörnNettingsmeier <<DateTime(2007-07-30T12:47:53Z)>>

XSP, or eXtensible Server Pages, is a Cocoon technology roughly analogous to Java Server Pages, but with a number of key differences. Lenya uses XSP's to generate an XML stream dynamically rather than by reading an xml file.


The Java Content Repository (JCR) API (JSR 170) defines a standard to access content repositories from Java code, and promises to greatly simplify Java database programming. A nice overview is given at

  • No labels