<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jakob Külzer</title>
	<atom:link href="http://www.jakusys.de/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jakusys.de/blog</link>
	<description>Ninja Coding Monkey goes Canada</description>
	<lastBuildDate>Sun, 03 Jan 2010 19:38:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Building a CMS using XML, XSLT, Ant and ImageMagick</title>
		<link>http://www.jakusys.de/blog/2010/01/building-a-cms-using-xml-xslt-ant-and-imagemagik/</link>
		<comments>http://www.jakusys.de/blog/2010/01/building-a-cms-using-xml-xslt-ant-and-imagemagik/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 12:17:28 +0000</pubDate>
		<dc:creator>Jakob Külzer</dc:creator>
				<category><![CDATA[Cool Tech]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Ant]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[Grails]]></category>
		<category><![CDATA[ImageMagik]]></category>
		<category><![CDATA[Saxon]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[XSLT]]></category>
		<category><![CDATA[XSLT2.0]]></category>

		<guid isPermaLink="false">http://www.jakusys.de/blog/?p=1051</guid>
		<description><![CDATA[Not so long ago a freelance client approached me with some updates for their website. The site has been growing organically since 2000 and therefore was a big mess. Several attempts to port the site to a CMS driven system failed largely because those CMS systems are usually to complex for our needs (Typo3) or [...]]]></description>
			<content:encoded><![CDATA[<p>Not so long ago a freelance client approached me with some updates for their website. The site has been growing organically since 2000 and therefore was a big mess. Several attempts to port the site to a CMS driven system failed largely because those CMS systems are usually to complex for our needs (Typo3) or not flexible enough (Joomla, Wordpress). So as I was faced with updates to all the updates including image updates which in turn needed thumbnails to be generated. The same day I stumbled randomly over the <a href="http://www.w3.org/TR/xslt20/" target="_blank">xsl:result-document</a> function in XSLT 2.0 which allows you to transform a single XML file into several output files. That sparked an idea with me: why not use that to build a CMS system using XML technologies? I've toyed around with <a title="Apache Cocoon" href="http://cocoon.apache.org/" target="_blank">Cocoon</a> a couple of years ago but that was not what I was looking for. So I looked for other technologies...</p>
<p>This post is a write-down of my experiences building a XML/XSLT driven simple CMS system. In it I will show you the required technologies, my approaches and my solutions to problems I've encountered. You'll need a solid understanding of XML at least, understanding of Ant and XSLT helps a lot, too.</p>
<p>This post contains tons of XML and I tried my best to format it in a readable way — in fact I've spent hours to get everything nicely on the screen.<br />
<span id="more-1051"></span></p>
<h2>Requirements to the CMS</h2>
<p>I had several objectives when I built my system:</p>
<ul>
<li>All mundane and repetitive tasks should be automated, including thumbnail generation, creation of a global navigation, synchronizing with a live site</li>
<li>Flexible enough to support new "content types" and new views</li>
<li>Versionable with Git, Subversion or other SCMs</li>
<li>Creation of output artifacts should be a single command</li>
</ul>
<h2>Technologies</h2>
<p>The most prominent and important technology I used is XSLT 2.0. If you don't know what XSLT is, here is XSLT in a nutshell.</p>
<p>XSLT stands for eXtensible Stylesheet Language Transformations. What it does is surprisingly simple. It takes a piece of XML as input (aka source tree or input tree), applies some transformations on it and outputs a new piece of XML. Sounds simple in theory, however in practice it is usually somewhat more complicated because XSLT is a functional language and sometimes requires you to solve problems backwards and don't even get me started on <a href="http://www.w3.org/TR/xml-names11/" target="_blank">XML namespaces</a>...</p>
<p>Traditionally you'd have one input XML file, one XSL stylesheet and accordingly one single XML output file. However with the new xsl:result-document I can suddenly output into several files.</p>
<p>As I'm using XSLT the next technology used is XML of course. Not much to say about this except that it is involved in pretty much every step. To bind everything together I'm using <a title="Apache Ant" href="http://ant.apache.org/" target="_blank">Apache Ant</a>, an incredibly flexible tool. Interestingly enough Ant uses XML files for its build files which comes in handy later on. Also it solves one of my requirements: it is just plain text and therefor versionable.</p>
<p>Last there is image manipulation. I've experimented a bit with the Ant image tasks that use JAI to perform manipulation but quickly dropped that approach as this task won't even let you specify a quality parameter for image manipulations. I've ended up using an old friend: <a title="ImageMagick" href="http://www.imagemagick.org/script/index.php" target="_blank">ImageMagick</a>. ImageMagick is an amazing toolkit of versatile command line tools to modify images. It allows to modify images in many different ways from resizing to color correction or combining them.</p>
<h2>Basic Structure</h2>
<p>The basic structure of an XML/XSLT driven CMS contains one or more XML files that contain the "raw" data for the website, XSLT to transform it into XHTML and assets. More on assets later.</p>
<h3>The XML Part</h3>
<p>The XML file used in my project is a very simple one. It defines "pages" that get translated into real HTML pages. Each page has a section called contents which in turn contain the actual page contents. Let's have a look at a short sample:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:site</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;My XSLT Generated website&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">xmlns:s</span>=<span style="color: #ff0000;">&quot;http://www.jakusys.de/xslt-cms&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:page</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Home&quot;</span> <span style="color: #000066;">filename</span>=<span style="color: #ff0000;">&quot;index.html&quot;</span> <span style="color: #000066;">showTitle</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:contents<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Welcome to my XSLT generated page!<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Bla bla bla <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:contents<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:page<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:page</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Contact Me&quot;</span> <span style="color: #000066;">filename</span>=<span style="color: #ff0000;">&quot;contactme.html&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:contents<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Contact Me<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Send me an <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>email<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>!<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:contents<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:page<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:site<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>Well, so far nothing impressive. Actually it looks like more work compared to typing out the actual pages themselves. But behold, here comes the stylesheet to actually turn the above XML into nice websites (XHTML):</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:stylesheet</span> <span style="color: #000066;">xmlns:xsl</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/XSL/Transform&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;2.0&quot;</span> <span style="color: #000066;">exclude-result-prefixes</span>=<span style="color: #ff0000;">&quot;#all&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">xpath-default-namespace</span>=<span style="color: #ff0000;">&quot;http://www.jakusys.de/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:output</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;html&quot;</span> <span style="color: #000066;">indent</span>=<span style="color: #ff0000;">&quot;yes&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;html&quot;</span> </span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">omit-xml-declaration</span>=<span style="color: #ff0000;">&quot;yes&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:template</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:apply-templates</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;site&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:template</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;site&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:apply-templates</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;page&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:template</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;page&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:variable</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;filename&quot;</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;@filename&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:result-document</span> <span style="color: #000066;">omit-xml-declaration</span>=<span style="color: #ff0000;">&quot;yes&quot;</span> <span style="color: #000066;">indent</span>=<span style="color: #ff0000;">&quot;yes&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;{$filename}&quot;</span> <span style="color: #000066;">format</span>=<span style="color: #ff0000;">&quot;html&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">doctype-public</span>=<span style="color: #ff0000;">&quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">doctype-system</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;html</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;meta</span> <span style="color: #000066;">http-equiv</span>=<span style="color: #ff0000;">&quot;Content-Type&quot;</span> </span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">content</span>=<span style="color: #ff0000;">&quot;text/html; charset=utf-8&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:value-of</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;@title&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;container&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:apply-templates</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;contents/*&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:result-document<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:template</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;*&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;html&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:copy</span> <span style="color: #000066;">copy-namespaces</span>=<span style="color: #ff0000;">&quot;no&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:copy-of</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;@*&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:apply-templates</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;html&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:copy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:stylesheet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>Now it get's more interesting. Let's dissect what the above XSLT does. The blocks in line 10 to 12 are a template that matches the root level element in the source XML tree. All it does is to call the next matching stylesheets which are in lines 14 to 19. This template does exactly the same and passes on. Then we reach line 18 with the template matching page elements.</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>18<br />19<br />20<br />21<br />22<br />23<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:variable</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;filename&quot;</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;@filename&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:result-document</span> <span style="color: #000066;">omit-xml-declaration</span>=<span style="color: #ff0000;">&quot;yes&quot;</span> </span><br />
<span style="color: #009900;"> &nbsp; <span style="color: #000066;">indent</span>=<span style="color: #ff0000;">&quot;yes&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;{$filename}&quot;</span> <span style="color: #000066;">format</span>=<span style="color: #ff0000;">&quot;html&quot;</span> </span><br />
<span style="color: #009900;"> &nbsp; <span style="color: #000066;">doctype-public</span>=<span style="color: #ff0000;">&quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;</span> </span><br />
<span style="color: #009900;"> &nbsp; <span style="color: #000066;">doctype-system</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;</span> </span><br />
<span style="color: #009900;"> &nbsp; <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></div></td></tr></tbody></table></div>
<p>Line 18 defines a variable called filename which is prefilled with with the filename attribute from the XML page element. The next line sports the so much praised (at least by me) xsl:result-document element. If you read the line it gets clear very fast that it should output a new HTML file (format="html" href="$filename"), nicely formatted (indent="yes") and with the appropriate DOCTYPE declaration. The  next lines are just an HTML boilerplate with head and content type. Please note that this is a very minimalistic example. Usually you would include stylesheets, JavaScript includes and other additional headers there. For simplicity they are omitted.</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>28<br />29<br />30<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:value-of</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;@title&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span> - <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:value-of</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;/site/@title&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>Lines 28 to 31 output a new title tag populated with the title attribute from our source attribute. Convenient. The CMS is starting to take shape.</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>33<br />34<br />35<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;container&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:apply-templates</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;contents/*&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>And finally lines 33 to 35 will call another template lines 41 to 46 which just copies the HTML into the output document.</p>
<p>So far so good. What have we achieved? The stylesheet creates a new page based on boilerplate HTML - which can be arbitrarily complex with CSS stylesheets, JavaScript and more - and pre-fills the title and the actual body. Now let's add more functionality. Every good website needs a navigation. We can achieve that easily by adding another template that matches all page elements. We add a few new lines to the boilerplate HTML:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;navigation&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ul<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:apply-templates</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;/site/page&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;navigation&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ul<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>Looks simple enough. This will output a new DIV, fill it with a unordered list and calls another template.  The interesting part is the select attribute: it tells the XSLT processor to select all root level page elements. Now let's have a look at how the called template looks like:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:template</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;page&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;navigation&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;li<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;{@filename}&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;{@title}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:value-of</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;@title&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/li<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>The XSLT processor will translate this into global navigation of our site. All top level pages will be listed with the correct title and the correct filename.</p>
<h3>The Ant Part</h3>
<p>Now that we have the stylesheets and the input XML files in place, we'll need an elegant way to transform the whole site with on simple command. As discussed earlier Ant is a good choice for this. I won't delve into the actual ANT buildfile as it is pretty straightforward. What I want to show is how to use XSLT to generate ANT buildfiles from other XML. This is actually a pretty powerful technique as I can custom tailor ANT files to whatever need I have. In this particular example I want to show how to create image thumbnails.</p>
<p>Here is what we have. In our input XML file, we reference images. For those images, let's say, product shots, we have the originals lying in some location in the filesystem. Those images need to be scaled down to a high res view (800×600) and to a thumbnail (128×128). We could do that with an ANT pathmatcher, but that would just take all the images it can find, not just the referenced ones. Bad and slow. And how do we keep the build directory free of old and unused pictures then?</p>
<p>What we'll do instead is we'll take the input XML file, create a XSLT stylesheet that will grab all the image references and put them into a custom ANT build file which in turn calls an image manipulation program (ImageMagick) to scale down the pictures. There's a few other goodies in here too, e.g. automatic file name cleanup. Here is the images.xsl:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:stylesheet</span> <span style="color: #000066;">xmlns:xsl</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/XSL/Transform&quot;</span> </span><br />
<span style="color: #009900;"> &nbsp; <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;2.0&quot;</span> <span style="color: #000066;">xpath-default-namespace</span>=<span style="color: #ff0000;">&quot;http://www.jakusys.de/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:output</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;xml&quot;</span> <span style="color: #000066;">indent</span>=<span style="color: #ff0000;">&quot;yes&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:template</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Image Processing&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;prepare-images&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;prepare-images&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;copy-originals,scale&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;copy-originals&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;copy&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:attribute</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;todir&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:text<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>${build.dir}/images<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:text<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:attribute<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;fileset&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:attribute</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;dir&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:text<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>${assets.dir}/images<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:text<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:attribute<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:apply-templates</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;//image&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;copy-original&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:element<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:element<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;scale&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:apply-templates</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;//image&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;thumbnail&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:template</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;image&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;thumbnail&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;/opt/local/bin/convert&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-thumbnail 128x128 -quality 0.85 assets/images/{@src}.jpg build/images/{lower-case(@src)}_thumb.jpg&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:template</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;image&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;copy-original&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;{lower-case(@src)}.jpg&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:stylesheet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<h2>Google Sitemaps</h2>
<p>Most people that have used Google's Webmaster Tools know about the sitemap. No need to write them manually any more, you can easily use the XML representation and a XSLT stylesheet to generate it for you:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:stylesheet</span> <span style="color: #000066;">xmlns:xsl</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/XSL/Transform&quot;</span> </span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;2.0&quot;</span> <span style="color: #000066;">xpath-default-namespace</span>=<span style="color: #ff0000;">&quot;http://www.jakusys.de/&quot;</span> </span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:output</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;xml&quot;</span> <span style="color: #000066;">indent</span>=<span style="color: #ff0000;">&quot;yes&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:template</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;urlset</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:apply-templates</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;site/page&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/urlset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:template</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;page&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;loc<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://www.my-website.com/<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:value-of</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;@filename&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/loc<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;lastmod<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2009-09-10<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/lastmod<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;changefreq<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>monthly<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/changefreq<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:stylesheet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<h2>Issues</h2>
<p>So with all the technologies in place, I ran into some issues but all of them could be solved quickly. I'm listing them here hoping they'll help other people.</p>
<h3>XSLT 2.0 with Ant</h3>
<p>This one was most annoying. Per default Ant has an <a title="Apache Ant XSLT" href="http://ant.apache.org/manual/CoreTasks/style.html" target="_blank">xslt-task</a> which allows you to transform XML but it is limited to XSLT 1.0. If you read the documentation you'll find out that you can plug in different XSLT processors but you are still quite limited. If you want to use XSLT 2.0 with Ant get the amazing <a title="Saxon XML Processor" href="http://saxon.sourceforge.net/" target="_blank">Saxon processor</a> and use their Ant task which is a bit hidden on their page. Get it from the Sourceforge <a title="Saxon Ant Task" href="http://sourceforge.net/projects/saxon/files/saxon%20ant%20task/" target="_blank">download site</a>. This task lets you leverage the full functionality of XSLT 2.0 including the xsl:result-document.</p>
<p>All you have to do to get it working is to copy the required JARs into the classpath, declare the custom task and use it:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;saxon-xslt&quot;</span> <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;net.sf.saxon.ant.AntTransform&quot;</span> </span><br />
<span style="color: #009900;"> &nbsp; <span style="color: #000066;">classpath</span>=<span style="color: #ff0000;">&quot;lib/saxon9he.jar;lib/saxon9-ant.jar&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></td></tr></tbody></table></div>
<p>Now you can use the saxon-xslt task:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;transform&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;init&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;saxon-xslt</span> <span style="color: #000066;">in</span>=<span style="color: #ff0000;">&quot;${xml}&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;${xsl}&quot;</span> <span style="color: #000066;">out</span>=<span style="color: #ff0000;">&quot;${build.dir}/output.html&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<h3>XML Namespaces in HTML</h3>
<p>This was a tricky one. The problem was that in my custom XML I had snippets of HTML which I wanted to mirror into the output documents. I used the xsl:copy-of function which basically did what it was supposed to. It copied the (X)HTML over but by doing so, it had to adjust the namespaces for the XML. The input document had no namespace declarations at all and the output document was bound to the XHTML namespace. So the processor did exactly what it is supposed to: it added null namespace  declarations to the copied elements which looked like this:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;null&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Bla bla bla<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>Not a problem per se but unfortunately invalid XHTML. The solution to this problem is surprisingly simple: Add namespace declarations to the input document:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:site</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;My XSLT Generated website&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">xmlns:s</span>=<span style="color: #ff0000;">&quot;http://www.jakusys.de/xslt-cms&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></div></td></tr></tbody></table></div>
<p>The above lines will put the input document per default into the XHTML namespace and everything else in my own, personal namespace. Regular (X)HTML markup however does not get any namespace prefixes, so it will be put into the XHTML namespace:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:page</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Home&quot;</span> <span style="color: #000066;">filename</span>=<span style="color: #ff0000;">&quot;index.html&quot;</span> <span style="color: #000066;">showTitle</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:contents<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s:html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Welcome to my XSLT generated page!<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:contents<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s:page<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<h2>Conclusion</h2>
<p>The one big problem I still have with this system is that it does not support hierarchical pages yet. But if the need arises it could be added without too much effort. Another moose with the system is that it still requires editing XML which is neither user-friendly nor easy for non technical users. But one could easily create a Flex or AIR app to modify and edit those files. Thanks to Flex' really good XML support it should not be hard to do that. I could even think of a Grails Webapp generating the XML for this (using the brilliant XML markup builder).</p>
<p>In general it is a really powerful and flexible system. As I am running this on a UNIX system I can harness all the tools and goodies that are there. Ant and Java give me whatever power and libraries I need. So I can steer this thing in whichever direction I want.</p>
<p>If you have any questions feel free to comment below or drop me an email.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jakusys.de/blog/2010/01/building-a-cms-using-xml-xslt-ant-and-imagemagik/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Liquibase Incremental DB Diff</title>
		<link>http://www.jakusys.de/blog/2009/12/liquibase-incremental-db-diff/</link>
		<comments>http://www.jakusys.de/blog/2009/12/liquibase-incremental-db-diff/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 15:14:24 +0000</pubDate>
		<dc:creator>Jakob Külzer</dc:creator>
				<category><![CDATA[Grails]]></category>
		<category><![CDATA[#ggx]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Groovy & Grails Exchange]]></category>
		<category><![CDATA[LiquiBase]]></category>
		<category><![CDATA[Migration]]></category>
		<category><![CDATA[Schema]]></category>

		<guid isPermaLink="false">http://www.jakusys.de/blog/?p=1112</guid>
		<description><![CDATA[After discussing this on the Groovy and Grails Exchange, I finally put together a new version of the db diff script that I've mentioned in an earlier post. I couldn't find the original version that I've written a couple of months ago, so I hacked together a new one. It's far from perfect, efficient or [...]]]></description>
			<content:encoded><![CDATA[<p>After discussing this on the Groovy and Grails Exchange, I finally put together a new version of the db diff script that I've mentioned in an earlier post. I couldn't find the original version that I've written a couple of months ago, so I hacked together a new one. It's far from perfect, efficient or beautiful, but it does what it is supposed to.</p>
<p>So, what's the idea behind this script? Everybody that uses Liquibase (if you are not, check out my blog post about <a title="Liqiubase and Grails - How to use it" href="http://www.jakusys.de/blog/2008/09/grails-and-liquibase-how-to-use/" target="_blank">what Liquibase is and how to use it</a>) knows how painful it is to update your changelog.xml. Liquibase already gives you a great tool to start with, the db-diff command. However, it is hardcoded to diff the current environment's database against the test database. This is annoying as you'll have to modify your datasources and keep the database schema updated manually. But fear not, here is my (surprisingly) easy solution.</p>
<p>I've created a simple script (or rather, I took the db-diff script and hacked it), which I've called incremental DB diff (all the other cool names are already taken...) and what it does is the following:</p>
<ol>
<li> update the schema in the db-diff (or whatever you call it) database using the changelog.xml</li>
<li>diff the database of the current environment against this database and output the diff as Liquibase XML</li>
</ol>
<p>So, how is this a good thing? Easy: this little script will automatically create a target database to diff against using the changelog.xml which is good, as the changelog.xml represents your last migration status. And as it uses a separate database it doesn't influence the test database.</p>
<p>After running the script just put the output in the changelog.xml and you're done.</p>
<p>All you have to do to use this is to drop the file into your /scripts/ directory, create a new database and an according datasource entry for the environment "dbdiff" like this:</p>
<pre>	dbdiff {
		dataSource {
			driverClassName = "com.mysql.jdbc.Driver"
			dbCreate = "create-drop"
			url = "jdbc:mysql://localhost/foo_dbdiff"
			username = "foo"
			password = "bar"
		}
	}</pre>
<p>Download <a href="http://www.jakusys.de/files/DbDiffIncremental.groovy" target="_blank">DbDiffIncremental.groovy</a>. Drop me a mail or a comment if you have questions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jakusys.de/blog/2009/12/liquibase-incremental-db-diff/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Grails GraniteDS Plugin and Flex Modules &#8211; Could not resolve ? to a component implementation</title>
		<link>http://www.jakusys.de/blog/2009/10/grails-graniteds-plugin-and-flex-modules-could-not-resolve-to-a-component-implementation/</link>
		<comments>http://www.jakusys.de/blog/2009/10/grails-graniteds-plugin-and-flex-modules-could-not-resolve-to-a-component-implementation/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 19:30:00 +0000</pubDate>
		<dc:creator>Jakob Külzer</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Grails]]></category>
		<category><![CDATA[Flex Modules]]></category>
		<category><![CDATA[Gotcha]]></category>
		<category><![CDATA[GraniteDS]]></category>

		<guid isPermaLink="false">http://www.jakusys.de/blog/?p=1107</guid>
		<description><![CDATA[I'm currently working a lot with the Grails GraniteDS plugin. Just recently I've started to separate my application into modules and ran into a really nasty error.
It took me some time to figure it out, hopefully I can save you from going through all this.
The Flex web tier compiler usually gives me this error:
Error: Could [...]]]></description>
			<content:encoded><![CDATA[<p>I'm currently working a lot with the Grails GraniteDS plugin. Just recently I've started to separate my application into modules and ran into a really nasty error.</p>
<p>It took me some time to figure it out, hopefully I can save you from going through all this.</p>
<p>The Flex web tier compiler usually gives me this error:</p>
<pre>Error: Could not resolve &lt;namespace:Component&gt; to a component implementation.

 &lt;namespace:Component/&gt;

error during compilation Could not resolve &lt;namespace:Component&gt; to a component implementation.</pre>
<p>Initial research confirmed what I thought, this error is caused by a mismatch between a XML namespace declaration and the actual location of a component. However the location and the namespace declaration looked right and the issue occurred only <strong>after</strong> I had moved the questionable component into a separate module.</p>
<p>After two painful hours I realized that the Flex webtier compiler, as configured with GraniteDS, <strong>resolves namespaces relative to modules, not relative to the source folder</strong>. D'oh!</p>
<p>The solution I came up with was simple, might be naïve though. I figured that if resolution is relative to the Module and not to the source folder, there might be no such source folder as I would expect it. A quick look into the flex-config.xml found in &lt;GRAILS_PROJ&gt;/web-app/WEB-INF/flex/flex-config.xml confirmed this:</p>
<pre>&lt;!-- List of path elements that form the roots of ActionScript class hierarchies. --&gt;
<strong> &lt;!-- not set --&gt;</strong>
 &lt;!--
 &lt;source-path&gt;
 &lt;path-element&gt;string&lt;/path-element&gt;
 &lt;/source-path&gt;
 --&gt;</pre>
<p>So there is no explicit source path set. So I changed it so it would point to &lt;GRAILS_PROJ&gt;/grails-app/views/flex:</p>
<pre>&lt;!-- List of path elements that form the roots of ActionScript class hierarchies. --&gt;
 &lt;!-- not set --&gt;
 &lt;source-path&gt;
<strong> &lt;path-element&gt;../../../grails-app/views/flex&lt;/path-element&gt;</strong>
 &lt;/source-path&gt;</pre>
<p>Voilá - it works. However, as mentioned earlier, this might be a very limited solution, but for now it works.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jakusys.de/blog/2009/10/grails-graniteds-plugin-and-flex-modules-could-not-resolve-to-a-component-implementation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Panorama – Château Villandry II</title>
		<link>http://www.jakusys.de/blog/2009/09/panorama-%e2%80%93-chateau-villandry-ii/</link>
		<comments>http://www.jakusys.de/blog/2009/09/panorama-%e2%80%93-chateau-villandry-ii/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 22:45:05 +0000</pubDate>
		<dc:creator>Jakob Külzer</dc:creator>
				<category><![CDATA[Panorama]]></category>
		<category><![CDATA[Travel]]></category>
		<category><![CDATA[France]]></category>
		<category><![CDATA[Hugin]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Val de Loires]]></category>
		<category><![CDATA[Villandry]]></category>

		<guid isPermaLink="false">http://www.jakusys.de/blog/?p=1102</guid>
		<description><![CDATA[And here is my second panorama from Château de Villandry. This particular one has been made from the stairs leading to the vegetable gardens.
]]></description>
			<content:encoded><![CDATA[<p>And here is my second panorama from Château de Villandry. This particular one has been made from the stairs leading to the vegetable gardens.</p>
<div id="attachment_1103" class="wp-caption alignnone" style="width: 310px"><a href="http://www.jakusys.de/blog/wp-content/uploads/2009/09/stitch01.jpg" rel="lightbox[1102]"><img class="size-medium wp-image-1103" title="Vegetable Gardens at Château de Villandry " src="http://www.jakusys.de/blog/wp-content/uploads/2009/09/stitch01-300x78.jpg" alt="Vegetable Gardens at Château de Villandry" width="300" height="78" /></a><p class="wp-caption-text">Vegetable Gardens at Château de Villandry</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.jakusys.de/blog/2009/09/panorama-%e2%80%93-chateau-villandry-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Panorama &#8211; Château Villandry</title>
		<link>http://www.jakusys.de/blog/2009/09/panorama-chateau-villandry/</link>
		<comments>http://www.jakusys.de/blog/2009/09/panorama-chateau-villandry/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 16:50:10 +0000</pubDate>
		<dc:creator>Jakob Külzer</dc:creator>
				<category><![CDATA[Panorama]]></category>
		<category><![CDATA[Travel]]></category>
		<category><![CDATA[France]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Val de Loires]]></category>
		<category><![CDATA[Villandry]]></category>

		<guid isPermaLink="false">http://www.jakusys.de/blog/?p=1093</guid>
		<description><![CDATA[I finally managed to create my panorama from Château Villandry in France. I missed one image so there's an ugly gray border on the bottom left. Other than that it's a really beautiful panorama, you can see almost all the gardens. Enjoy. (Click for high-res version!)
]]></description>
			<content:encoded><![CDATA[<p>I finally managed to create my panorama from <a href="http://www.chateauvillandry.com/" target="_blank">Château Villandry</a> in France. I missed one image so there's an ugly gray border on the bottom left. Other than that it's a really beautiful panorama, you can see almost all the gardens. Enjoy. (Click for high-res version!)</p>
<div id="attachment_1096" class="wp-caption alignnone" style="width: 310px"><a href="http://www.jakusys.de/blog/wp-content/uploads/2009/09/stitch02.jpg" rel="lightbox[1093]"><img class="size-medium wp-image-1096" title="Panorama of Château Villandry and its Gardens" src="http://www.jakusys.de/blog/wp-content/uploads/2009/09/stitch02-300x97.jpg" alt="Panorama of Château Villandry and its Gardens" width="300" height="97" /></a><p class="wp-caption-text">Panorama of Château Villandry and its Gardens</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.jakusys.de/blog/2009/09/panorama-chateau-villandry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zurück nach Deutschland</title>
		<link>http://www.jakusys.de/blog/2009/09/zuruck-nach-deutschland/</link>
		<comments>http://www.jakusys.de/blog/2009/09/zuruck-nach-deutschland/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 02:23:09 +0000</pubDate>
		<dc:creator>Jakob Külzer</dc:creator>
				<category><![CDATA[Auslandspraktikum]]></category>
		<category><![CDATA[Das tägliche Photo]]></category>
		<category><![CDATA[Lustige Bilder]]></category>
		<category><![CDATA[Toronto]]></category>

		<guid isPermaLink="false">http://www.jakusys.de/blog/?p=1067</guid>
		<description><![CDATA[Die letzten Wochen waren unheimlich ereignisreich. Meine Zeit bei Mindblossom ist vorüber aber die letzten 2 Wochen dort war ich nicht untätig. Ein letztes Projekt mit unheimlich enger Deadline musste (und wurde) gestemmt: Rona 70th Anniversary. Danach ging es mit viel Freelance Arbeit weiter. Heute habe ich endlich ein wenig Luft und ich plane meine [...]]]></description>
			<content:encoded><![CDATA[<p>Die letzten Wochen waren unheimlich ereignisreich. Meine Zeit bei Mindblossom ist vorüber aber die letzten 2 Wochen dort war ich nicht untätig. Ein letztes Projekt mit unheimlich enger Deadline musste (und wurde) gestemmt: Rona 70th Anniversary. Danach ging es mit viel Freelance Arbeit weiter. Heute habe ich endlich ein wenig Luft und ich plane meine Rückkehr nach Deutschland. Der Flug ist gebucht und ich werde am kommenden Donnerstag um 16:50 in München aufschlagen.</p>
<p>Heute habe ich auch endlich mal die Bilder von meinem Handy heruntergeladen und da ein paar schöne Schmankerl aus den letzten Monaten dabei sind, habe ich sie hier hochgeladen. Enjoy.
<a href='http://www.jakusys.de/blog/2009/09/zuruck-nach-deutschland/dsc00022/' title='CN Tower im Nebel'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/09/dsc00022-150x150.jpg" class="attachment-thumbnail" alt="CN Tower im Nebel" title="CN Tower im Nebel" /></a>
<a href='http://www.jakusys.de/blog/2009/09/zuruck-nach-deutschland/dsc00037/' title='Feuriger Sonnenuntergang'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/09/dsc00037-150x150.jpg" class="attachment-thumbnail" alt="Feuriger Sonnenuntergang, gesehen von meiner alten Wohnung @ Fort York Blvd" title="Feuriger Sonnenuntergang" /></a>
<a href='http://www.jakusys.de/blog/2009/09/zuruck-nach-deutschland/dsc00041/' title='Sandsturm in Toronto'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/09/dsc00041-150x150.jpg" class="attachment-thumbnail" alt="Sandsturm in Toronto, gesehen @ Spadina Ave" title="Sandsturm in Toronto" /></a>
<a href='http://www.jakusys.de/blog/2009/09/zuruck-nach-deutschland/dsc00043/' title='Da stand ein halber Panzer...'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/09/dsc00043-150x150.jpg" class="attachment-thumbnail" alt="Da stand ein halber Panzer in ner Seitenstraße..." title="Da stand ein halber Panzer..." /></a>
<a href='http://www.jakusys.de/blog/2009/09/zuruck-nach-deutschland/dsc00045-2/' title='Ich denke es ist ein umgebauter Hummer'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/09/dsc00045-150x150.jpg" class="attachment-thumbnail" alt="Ich denke es ist ein umgebauter Hummer - eine gepanzerte Version einer Zivilversion eines Militärvehikels. Macht irgendwie keinen Sinn..." title="Ich denke es ist ein umgebauter Hummer" /></a>
<a href='http://www.jakusys.de/blog/2009/09/zuruck-nach-deutschland/dsc00046-2/' title='Fischvehikel'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/09/dsc00046-150x150.jpg" class="attachment-thumbnail" alt="Fischvehikel" title="Fischvehikel" /></a>
<a href='http://www.jakusys.de/blog/2009/09/zuruck-nach-deutschland/dsc00047-2/' title='CN Tower im... Dunst?'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/09/dsc00047-150x150.jpg" class="attachment-thumbnail" alt="CN Tower im... Dunst?" title="CN Tower im... Dunst?" /></a>
<a href='http://www.jakusys.de/blog/2009/09/zuruck-nach-deutschland/dsc00052/' title='Protest für die Tamil Tigers'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/09/dsc00052-150x150.jpg" class="attachment-thumbnail" alt="Protest für die Tamil Tigers - Unglücklicherweise direkt vor meinem Schlafzimmer und bis spät in die Nacht" title="Protest für die Tamil Tigers" /></a>
<a href='http://www.jakusys.de/blog/2009/09/zuruck-nach-deutschland/dsc00073-2/' title='Lake Ontario'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/09/dsc00073-150x150.jpg" class="attachment-thumbnail" alt="Lake Ontario" title="Lake Ontario" /></a>
<a href='http://www.jakusys.de/blog/2009/09/zuruck-nach-deutschland/dsc00074-2/' title='Somewhere in Toronto'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/09/dsc00074-150x150.jpg" class="attachment-thumbnail" alt="Somewhere in Toronto" title="Somewhere in Toronto" /></a>
<a href='http://www.jakusys.de/blog/2009/09/zuruck-nach-deutschland/dsc00078-2/' title='Mein neuer Bildschirm'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/09/dsc00078-150x150.jpg" class="attachment-thumbnail" alt="Mein neuer Bildschirm - 30&quot; Apple HD Cinema" title="Mein neuer Bildschirm" /></a>
<a href='http://www.jakusys.de/blog/2009/09/zuruck-nach-deutschland/dsc00079-2/' title='Mein Schreibtisch'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/09/dsc00079-150x150.jpg" class="attachment-thumbnail" alt="Mein Schreibtisch nach einer langen Woche" title="Mein Schreibtisch" /></a>
<a href='http://www.jakusys.de/blog/2009/09/zuruck-nach-deutschland/dsc00080-2/' title='Goodbye Mindblossom Feier'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/09/dsc00080-150x150.jpg" class="attachment-thumbnail" alt="Goodbye Mindblossom Feier - Lily und ich" title="Goodbye Mindblossom Feier" /></a>
<a href='http://www.jakusys.de/blog/2009/09/zuruck-nach-deutschland/dsc00082-2/' title='Goodbye Mindblossom Feier'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/09/dsc00082-150x150.jpg" class="attachment-thumbnail" alt="Goodbye Mindblossom Feier - ein paar von meinen großartigen Kollegen" title="Goodbye Mindblossom Feier" /></a>
<a href='http://www.jakusys.de/blog/2009/09/zuruck-nach-deutschland/dsc00089-2/' title='Tesla!'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/09/dsc00089-150x150.jpg" class="attachment-thumbnail" alt="Tesla!" title="Tesla!" /></a>
<a href='http://www.jakusys.de/blog/2009/09/zuruck-nach-deutschland/dsc00090-2/' title='Telsa'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/09/dsc00090-150x150.jpg" class="attachment-thumbnail" alt="Tesla - man beachte das Fahrzeug steht auf Tassen!" title="Telsa" /></a>
<a href='http://www.jakusys.de/blog/2009/09/zuruck-nach-deutschland/dsc00091-2/' title='Ja wirklich, auf Tassen!'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/09/dsc00091-150x150.jpg" class="attachment-thumbnail" alt="Ja wirklich, auf Tassen - es ist jedoch fraglich ob das mit dem normalen IKEA Geschirr geht!" title="Ja wirklich, auf Tassen!" /></a>
<a href='http://www.jakusys.de/blog/2009/09/zuruck-nach-deutschland/dsc00092-2/' title='Ach ja...'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/09/dsc00092-150x150.jpg" class="attachment-thumbnail" alt="Ach ja, der fährt mit Strom!" title="Ach ja..." /></a>
<a href='http://www.jakusys.de/blog/2009/09/zuruck-nach-deutschland/dsc00096-2/' title='Pilze'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/09/dsc00096-150x150.jpg" class="attachment-thumbnail" alt="Pilze" title="Pilze" /></a>
<a href='http://www.jakusys.de/blog/2009/09/zuruck-nach-deutschland/dsc00098-2/' title='Buchladen... so in der Art'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/09/dsc00098-150x150.jpg" class="attachment-thumbnail" alt="Buchladen... so in der Art" title="Buchladen... so in der Art" /></a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jakusys.de/blog/2009/09/zuruck-nach-deutschland/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paris, Tag 2</title>
		<link>http://www.jakusys.de/blog/2009/06/paris-tag-2/</link>
		<comments>http://www.jakusys.de/blog/2009/06/paris-tag-2/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 23:21:42 +0000</pubDate>
		<dc:creator>Jakob Külzer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.jakusys.de/blog/?p=1035</guid>
		<description><![CDATA[Tag zwei in Paris. Nachdem wir den halben Tag wegen meines Jetlags verpasst haben, sind wir erstmal zum Essen raus. Danach ging es zu weiteren Sehenswürdigkeiten und einer Bootstour. Brüllend heiß und Paris ist ziemlich... nun ja, es riecht überall.   Bin wohl von der guten Luft in Toronto verwöhnt. Morgen fahren wir nach [...]]]></description>
			<content:encoded><![CDATA[<p>Tag zwei in Paris. Nachdem wir den halben Tag wegen meines Jetlags verpasst haben, sind wir erstmal zum Essen raus. Danach ging es zu weiteren Sehenswürdigkeiten und einer Bootstour. Brüllend heiß und Paris ist ziemlich... nun ja, es riecht überall. <img src='http://www.jakusys.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Bin wohl von der guten Luft in Toronto verwöhnt. Morgen fahren wir nach Versailles. Juhuu.<br />

<a href='http://www.jakusys.de/blog/2009/06/paris-tag-2/img_1807/' title='Mittagszeit. In Torontozeit: 6 Uhr Morgens - der Blick verrät es!'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1807-150x150.jpg" class="attachment-thumbnail" alt="Mittagszeit. In Torontozeit: 6 Uhr Morgens - der Blick verrät es!" title="Mittagszeit. In Torontozeit: 6 Uhr Morgens - der Blick verrät es!" /></a>
<a href='http://www.jakusys.de/blog/2009/06/paris-tag-2/img_1809/' title='Mjam'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1809-150x150.jpg" class="attachment-thumbnail" alt="Mjam" title="Mjam" /></a>
<a href='http://www.jakusys.de/blog/2009/06/paris-tag-2/img_1810/' title='Man kann über die Franzosen sagen was man will, kochen können sie! '><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1810-150x150.jpg" class="attachment-thumbnail" alt="Man kann über die Franzosen sagen was man will, kochen können sie!" title="Man kann über die Franzosen sagen was man will, kochen können sie!" /></a>
<a href='http://www.jakusys.de/blog/2009/06/paris-tag-2/img_1813/' title='Metro'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1813-150x150.jpg" class="attachment-thumbnail" alt="Metro" title="Metro" /></a>
<a href='http://www.jakusys.de/blog/2009/06/paris-tag-2/img_1817/' title='Das obligatorische Photo vom Eifelturm'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1817-150x150.jpg" class="attachment-thumbnail" alt="Das obligatorische Photo vom Eifelturm" title="Das obligatorische Photo vom Eifelturm" /></a>
<a href='http://www.jakusys.de/blog/2009/06/paris-tag-2/img_1818/' title='Lily, Eis und Eifelturm. '><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1818-150x150.jpg" class="attachment-thumbnail" alt="Lily, Eis und Eifelturm." title="Lily, Eis und Eifelturm." /></a>
<a href='http://www.jakusys.de/blog/2009/06/paris-tag-2/img_1821/' title='Canada -&gt; &lt;- Deutschland'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1821-150x150.jpg" class="attachment-thumbnail" alt="Das stand da wirklich! Wie passend!" title="Canada -&gt;" /></a>
<a href='http://www.jakusys.de/blog/2009/06/paris-tag-2/img_1836/' title='Lily und ich auf dem Boot.'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1836-150x150.jpg" class="attachment-thumbnail" alt="Lily und ich auf dem Boot." title="Lily und ich auf dem Boot." /></a>
<a href='http://www.jakusys.de/blog/2009/06/paris-tag-2/img_1837/' title='Lily und ich auf dem Boot.'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1837-150x150.jpg" class="attachment-thumbnail" alt="Lily und ich auf dem Boot." title="Lily und ich auf dem Boot." /></a>
<a href='http://www.jakusys.de/blog/2009/06/paris-tag-2/img_1841/' title='Notre Dame'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1841-150x150.jpg" class="attachment-thumbnail" alt="Notre Dame" title="Notre Dame" /></a>
<a href='http://www.jakusys.de/blog/2009/06/paris-tag-2/img_1873/' title='Rue Jacob. Alle schreiben meinen Namen falsch... ;)'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1873-150x150.jpg" class="attachment-thumbnail" alt="Rue Jacob." title="Rue Jacob. Alle schreiben meinen Namen falsch... ;)" /></a>
<a href='http://www.jakusys.de/blog/2009/06/paris-tag-2/img_1878/' title='Irgendwo in Paris...'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1878-150x150.jpg" class="attachment-thumbnail" alt="Irgendwo in Paris..." title="Irgendwo in Paris..." /></a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jakusys.de/blog/2009/06/paris-tag-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Geburtstag und Erster Tag in Paris</title>
		<link>http://www.jakusys.de/blog/2009/06/geburtstag-erster-tag-paris/</link>
		<comments>http://www.jakusys.de/blog/2009/06/geburtstag-erster-tag-paris/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 22:59:46 +0000</pubDate>
		<dc:creator>Jakob Külzer</dc:creator>
				<category><![CDATA[Das tägliche Photo]]></category>
		<category><![CDATA[Lustige Bilder]]></category>
		<category><![CDATA[Travel]]></category>

		<guid isPermaLink="false">http://www.jakusys.de/blog/?p=1019</guid>
		<description><![CDATA[So, sicher in Paris gelandet nach einem mehr oder minder ereignisfreien Flug, mal abgesehen davon das mein Sitznachbar wohl Blähungen hatte. Vom Flughafen ging es direkt nach Paris wo ich Manne und Lily getroffen habe. Danach ging es direkt nach Paris, ein paar Sehenswürdigkeiten ansehen und in einem idyllischen Straßencafé Geschichten austauschen und auf den [...]]]></description>
			<content:encoded><![CDATA[<p>So, sicher in Paris gelandet nach einem mehr oder minder ereignisfreien Flug, mal abgesehen davon das mein Sitznachbar wohl Blähungen hatte. Vom Flughafen ging es direkt nach Paris wo ich Manne und Lily getroffen habe. Danach ging es direkt nach Paris, ein paar Sehenswürdigkeiten ansehen und in einem idyllischen Straßencafé Geschichten austauschen und auf den Neusten Stand bringen. </p>
<p>Meine Mailbox, Facebook und Lokalisten quillt über vor lieben Geburtstagsgrüßen. Vielen vielen lieben Dank an alle! <img src='http://www.jakusys.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<a href='http://www.jakusys.de/blog/2009/06/geburtstag-erster-tag-paris/img_1767/' title='Lily, Manne und ich vor Basilique du Sacré-Coeur de Montmartre'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1767-150x150.jpg" class="attachment-thumbnail" alt="Lily, Manne und ich vor Basilique du Sacré-Coeur de Montmartre" title="Lily, Manne und ich vor Basilique du Sacré-Coeur de Montmartre" /></a>
<a href='http://www.jakusys.de/blog/2009/06/geburtstag-erster-tag-paris/img_1778/' title='Basilique du Sacré-Coeur de Montmartre'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1778-150x150.jpg" class="attachment-thumbnail" alt="Basilique du Sacré-Coeur de Montmartre" title="Basilique du Sacré-Coeur de Montmartre" /></a>
<a href='http://www.jakusys.de/blog/2009/06/geburtstag-erster-tag-paris/img_1795/' title='Lily vor dem Louvre'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1795-150x150.jpg" class="attachment-thumbnail" alt="Lily vor dem Louvre" title="Lily vor dem Louvre" /></a>
<a href='http://www.jakusys.de/blog/2009/06/geburtstag-erster-tag-paris/4819_121671995218_635600218_3339830_3029902_n/' title='Chillaxing in Jardin des Tuileres'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/4819_121671995218_635600218_3339830_3029902_n-150x150.jpg" class="attachment-thumbnail" alt="Chillaxing in Jardin des Tuileres" title="Chillaxing in Jardin des Tuileres" /></a>
<a href='http://www.jakusys.de/blog/2009/06/geburtstag-erster-tag-paris/4819_121673925218_635600218_3339945_319979_n/' title='Mittagessen in einem Straßencafé'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/4819_121673925218_635600218_3339945_319979_n-150x150.jpg" class="attachment-thumbnail" alt="Mittagessen in einem Straßencafé" title="Mittagessen in einem Straßencafé" /></a>
<a href='http://www.jakusys.de/blog/2009/06/geburtstag-erster-tag-paris/4819_121673930218_635600218_3339946_2481631_n/' title='Mein Lieblingsschwede'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/4819_121673930218_635600218_3339946_2481631_n-150x150.jpg" class="attachment-thumbnail" alt="Mein Lieblingsschwede" title="Mein Lieblingsschwede" /></a>

]]></content:encoded>
			<wfw:commentRss>http://www.jakusys.de/blog/2009/06/geburtstag-erster-tag-paris/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ninja Coding Monkey goes France. And Germany.</title>
		<link>http://www.jakusys.de/blog/2009/06/ninja-coding-monkey-goes-france-and-germany/</link>
		<comments>http://www.jakusys.de/blog/2009/06/ninja-coding-monkey-goes-france-and-germany/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 20:25:56 +0000</pubDate>
		<dc:creator>Jakob Külzer</dc:creator>
				<category><![CDATA[Auslandspraktikum]]></category>

		<guid isPermaLink="false">http://www.jakusys.de/blog/?p=1016</guid>
		<description><![CDATA[So Freunde, es ist soweit. Heute geht es zurück nach Europa. Nur für eineinhalb Wochen, aber immerhin. Heute Abend geht es mit dem Flieger nach Paris, wo ich erstmal bei meinem alten Mitbewohner Manne unterkommen werde. Von dort aus geht es weiter nach Versailles und in das Loires Tal. Bin schon ziemlich aufgeregt. 
Nächste Woche [...]]]></description>
			<content:encoded><![CDATA[<p>So Freunde, es ist soweit. Heute geht es zurück nach Europa. Nur für eineinhalb Wochen, aber immerhin. Heute Abend geht es mit dem Flieger nach Paris, wo ich erstmal bei meinem alten Mitbewohner Manne unterkommen werde. Von dort aus geht es weiter nach Versailles und in das Loires Tal. Bin schon ziemlich aufgeregt. </p>
<p>Nächste Woche Freitag geht es weiter zurück nach München. Das Programm ist voll. Ich will Lily München und ein paar Sehenswürdigkeiten in Bayern zeigen, Freunde besuchen und natürlich ein wenig Zeit mit meiner Familie verbringen. </p>
<p>Bis denn. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.jakusys.de/blog/2009/06/ninja-coding-monkey-goes-france-and-germany/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Toronto Island, 1000 Tastes of Toronto und ein Abstecher nach Deutschland</title>
		<link>http://www.jakusys.de/blog/2009/06/toronto-island-1000-tastes-of-toronto-und-ein-abstecher-nach-deutschland/</link>
		<comments>http://www.jakusys.de/blog/2009/06/toronto-island-1000-tastes-of-toronto-und-ein-abstecher-nach-deutschland/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 03:35:23 +0000</pubDate>
		<dc:creator>Jakob Külzer</dc:creator>
				<category><![CDATA[Auslandspraktikum]]></category>
		<category><![CDATA[Das tägliche Photo]]></category>
		<category><![CDATA[Lustige Bilder]]></category>

		<guid isPermaLink="false">http://www.jakusys.de/blog/?p=988</guid>
		<description><![CDATA[Nach langer Pause endlich wieder eine Post. Die letzten Wochen waren ereignisreich.
Am Freitag vor zwei Wochen ist Lily's Hund Tiger nach einem Unfall von uns gegangen. RIP Tiger. :'(
Nun aber zu besseren Nachrichten. Den heutigen Samstag haben Lily und ich auf Toronto Island verbracht. Habt ihr euch gefragt woher diese atemberaubenden Bilder von der Toronto [...]]]></description>
			<content:encoded><![CDATA[<p>Nach langer Pause endlich wieder eine Post. Die letzten Wochen waren ereignisreich.</p>
<p>Am Freitag vor zwei Wochen ist Lily's Hund <a title="Tigers Memorial Page" href="http://www.doggyheaven.com/memorial.php?id=401" target="_blank">Tiger</a> nach einem Unfall von uns gegangen. RIP Tiger. :'(</p>
<p>Nun aber zu besseren Nachrichten. Den heutigen Samstag haben Lily und ich auf <a title="Toronto Islands" href="http://en.wikipedia.org/wiki/Toronto_Islands" target="_blank">Toronto Island</a> verbracht. Habt ihr euch gefragt woher diese atemberaubenden Bilder von der Toronto Skyline kommen? Ja genau, von Toronto Island. Man hat die gesamte Skyline im Blick. Aber seht selbst...</p>
<p>Auf Toronto Island haben wir ein einem Volleyballturnier zu wohltätige Zwecken teilgenommen. An dieser Stelle sollte ich wohl anmerken das ich seit 2003 nicht mehr Volleyball gespielt habe. Aber das war ok nachdem wir in der Anfängerliga waren. Und keines der Teams war wirklich besser als wir. Oder eigentlich doch, denn irgendwie haben wir jedes Spiel bis auf zwei - einmal weil die andere Mannschaft nicht da war und einmal war ein unentschieden - verloren haben. Macht nix, hat Spaß gemacht. Außerdem haben wir so viele Hunde gesehen. Von Huskeys so groß wie ein Kalb bis zu Golden Retrievern und Black Labs so ziemlich alles.</p>
<p>Später gings dann zum 1000 Tastes of Toronto Festival am Queens Quay, so eine Art kulinarischer Jahrmarkt. So ziemlich jedes bessere Restaurant in Toronto war mit einem Stand vertreten. Die Bilder sprechen für sich...</p>
<p>Und zu allerletzt: Ich komme im Juli über das Wochenende 4. und 5. nach Deutschland. <img src='http://www.jakusys.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Ich bin nur ein paar Tage da aber ich hoffe es ist genug Zeit euch alle wiederzusehen.</p>

<a href='http://www.jakusys.de/blog/2009/06/toronto-island-1000-tastes-of-toronto-und-ein-abstecher-nach-deutschland/img_1678/' title='CN Tower von der Fähre'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1678-150x150.jpg" class="attachment-thumbnail" alt="CN Tower von der Fähre" title="CN Tower von der Fähre" /></a>
<a href='http://www.jakusys.de/blog/2009/06/toronto-island-1000-tastes-of-toronto-und-ein-abstecher-nach-deutschland/img_1684/' title='Lily und ich auf der Fähre'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1684-150x150.jpg" class="attachment-thumbnail" alt="Lily und ich auf der Fähre" title="Lily und ich auf der Fähre" /></a>
<a href='http://www.jakusys.de/blog/2009/06/toronto-island-1000-tastes-of-toronto-und-ein-abstecher-nach-deutschland/img_1688/' title='Doggy!'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1688-150x150.jpg" class="attachment-thumbnail" alt="Doggy!" title="Doggy!" /></a>
<a href='http://www.jakusys.de/blog/2009/06/toronto-island-1000-tastes-of-toronto-und-ein-abstecher-nach-deutschland/img_1692/' title='CN Tower von Toronto Island'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1692-150x150.jpg" class="attachment-thumbnail" alt="CN Tower von Toronto Island" title="CN Tower von Toronto Island" /></a>
<a href='http://www.jakusys.de/blog/2009/06/toronto-island-1000-tastes-of-toronto-und-ein-abstecher-nach-deutschland/img_1714/' title='Blumen - Makroaufnahme'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1714-150x150.jpg" class="attachment-thumbnail" alt="Blumen - Makroaufnahme" title="Blumen - Makroaufnahme" /></a>
<a href='http://www.jakusys.de/blog/2009/06/toronto-island-1000-tastes-of-toronto-und-ein-abstecher-nach-deutschland/img_1717/' title='Noch ein Doggy'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1717-150x150.jpg" class="attachment-thumbnail" alt="Noch ein Doggy" title="Noch ein Doggy" /></a>
<a href='http://www.jakusys.de/blog/2009/06/toronto-island-1000-tastes-of-toronto-und-ein-abstecher-nach-deutschland/img_1721/' title='Fernseher sinnvoll genutzt.'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1721-150x150.jpg" class="attachment-thumbnail" alt="Fernseher sinnvoll genutzt." title="Fernseher sinnvoll genutzt." /></a>
<a href='http://www.jakusys.de/blog/2009/06/toronto-island-1000-tastes-of-toronto-und-ein-abstecher-nach-deutschland/img_1722/' title='1000 Tastes of Toronto'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1722-150x150.jpg" class="attachment-thumbnail" alt="1000 Tastes of Toronto" title="1000 Tastes of Toronto" /></a>
<a href='http://www.jakusys.de/blog/2009/06/toronto-island-1000-tastes-of-toronto-und-ein-abstecher-nach-deutschland/img_1732/' title='Seafood'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1732-150x150.jpg" class="attachment-thumbnail" alt="Seafood" title="Seafood" /></a>
<a href='http://www.jakusys.de/blog/2009/06/toronto-island-1000-tastes-of-toronto-und-ein-abstecher-nach-deutschland/img_1738/' title='Stand mit buntem Essen'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1738-150x150.jpg" class="attachment-thumbnail" alt="Stand mit buntem Essen" title="Stand mit buntem Essen" /></a>
<a href='http://www.jakusys.de/blog/2009/06/toronto-island-1000-tastes-of-toronto-und-ein-abstecher-nach-deutschland/img_1739/' title='Noch viel bunteres Essen'><img width="150" height="150" src="http://www.jakusys.de/blog/wp-content/uploads/2009/06/img_1739-150x150.jpg" class="attachment-thumbnail" alt="Noch viel bunteres Essen" title="Noch viel bunteres Essen" /></a>

]]></content:encoded>
			<wfw:commentRss>http://www.jakusys.de/blog/2009/06/toronto-island-1000-tastes-of-toronto-und-ein-abstecher-nach-deutschland/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
