Home RSS feed

 

XSLT Content Management

I wanted this web site to be simpler and more portable, so I threw out Wordpress, PHP, and MySQL, and wrote my own code based on one XML and one XSLT file.

Here is an excerpt of the XML file:

<post>
	<date>2012-02-18T22:20:00</date>
	<url>xslt</url>
	<title>XSLT Content Management</title>
	<css>pre{ background-color: #EEEEEE }</css>
	<excerpt>I ported my web site from PHP to XML and Java.</excerpt>
	<tags>
		<tag>xslt</tag>
		<tag nolink="true">xsl</tag>
	</tags>
	<tns:content xmlns="http://www.w3.org/1999/xhtml">
		<p>I wanted this web site to be simpler and more portable,

The XSLT file creates several (X)HTML files using the xsl:result-document instruction. Where I needed server side dynamics, I used JSPX and Java.

Features:

  1. Portable
  2. Fast (no database)
  3. Secure (static files)
  4. Separates content from style and code
  5. Tags
  6. RSS feed
  7. Links to next and previous post
  8. "Hidden"/unlisted posts (pages), etc.
  9. Support for custom CSS + JavaScript

To simplify building and error detection, I configured this XML pipeline using maven-antrun-plugin:

  1. Validate content.xml
  2. Transform with XSLT
  3. Validate HTML files (XHTML 1.1 Strict)
  4. Check well-formedness of JSPX files and feed.xml

Tags: xslt, xsl

Created on Sat, 18 Feb 2012 22:20

blog comments powered by Disqus