Designing the Layout

As soon as you have the data side of things sorted out, you must think about the layout you want to present. Using the sample data from the preceding section, you can design stylesheets that will format the news into three of the most popular formats: HTML, WML, and XSL:FO for serialization into PDF.


A news portal must be able to provide the news in an HTML format, so you need to design a stylesheet for this purpose. Listing 5.2 shows a sample stylesheet you can use in your application.

Listing 5.2. The Stylesheet for Formatting RSS into HTML
<?xml version="1.0"?> 
<xsl:stylesheet version="1.0" xmlns:xsl=""> 
<xsl:template match="*|/"><xsl:apply-templates/></xsl:template> <xsl:template ...

Get Cocoon: Building XML Applications now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.