<?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"
	>

<channel>
	<title>Fireside Media Development Blog</title>
	<atom:link href="http://www.firesidemedia.net/dev/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.firesidemedia.net/dev</link>
	<description></description>
	<pubDate>Sat, 23 Feb 2008 00:58:19 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>The Power of XSL</title>
		<link>http://www.firesidemedia.net/dev/the-power-of-xsl/</link>
		<comments>http://www.firesidemedia.net/dev/the-power-of-xsl/#comments</comments>
		<pubDate>Fri, 22 Feb 2008 20:47:53 +0000</pubDate>
		<dc:creator>James</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.firesidemedia.net/dev/the-power-of-xsl/</guid>
		<description><![CDATA[When we did the last rewrite of Christian Lyrics I spent a good bit of time working on the template system. I loathe Smarty due to how bloated it is, but almost went with it because needed modular caching (guests all see the same static files, logged in users see their user info, etc&#8230;). We [...]]]></description>
			<content:encoded><![CDATA[<p>When we did the last rewrite of <a href="http://www.christian-lyrics.net/" rel="external" title="Christian Music Lyrics">Christian Lyrics</a> I spent a good bit of time working on the template system. I loathe <a href="http://smarty.php.net" title="Smarty Templating Engine" rel="external">Smarty</a> due to how bloated it is, but almost went with it because needed modular caching (guests all see the same static files, logged in users see their user info, etc&#8230;). We ended up using a <a href="http://phpsavant.com" title="PHP Savant" rel="external">Savant</a> style system (no stupid custom tags, no parsing, just PHP) that works pretty well, but has some short comings still. After we finished the rewrite, I spent some time exploring other options. Only one caught my eye: <a href="http://www.w3.org/TR/xsl" title="Extensible Stylesheet Language" rel="external">XSL</a>.</p>
<blockquote><p>The eXtensible Stylesheet Language (XSL) is a family of transformation languages which allows one to describe how files encoded in the XML standard are to be formatted or transformed. XSL is designed to be data driven and strongly encourages the Inversion of control design pattern. There are three languages in the family:</p>
<ol>
<li>XSL Transformations (XSLT): an XML language for transforming XML documents</li>
<li>XSL Formatting Objects (XSL-FO): an XML language for specifying the visual formatting of an XML document</li>
<li>the XML Path Language (XPath): a non-XML language used by XSLT, and also available for use in non-XSLT contexts, for addressing the parts of an XML document.</li>
</ol>
<p><cite>Source: <a href="http://en.wikipedia.org/wiki/Extensible_Stylesheet_Language" rel="external nofollow">Wikipedia</a></cite></p></blockquote>
<p>In a nutshell, XSL can be used to transform a plain XML document into a full-fledged HTML document. One thing I really like about XSL is that the processing can be done either server-side or client-side. Most modern browsers understand XSL and do all the dirty work for you, leaving your server to do other, more important, things. Not only that, but if you send the XML to the client for processing, then you have the base of your API already done.</p>
<p>But the best part is how modular you can make the caching. Here&#8217;s how I do it:</p>
<ol>
<li>If the data is cacheable it gets saved to disk in an XML file. Queries are only done to the SQL server for this data if the cache file doesn&#8217;t exist or has expired.</li>
<li>If it&#8217;s not cacheable, insert it into the cached XML document on the fly.</li>
</ol>
<p>Then the XSL document handles the rest. I can&#8217;t think of any simpler way to do it.</p>
<p>However, there are downsides (when aren&#8217;t there?):</p>
<ul>
<li>IE has notoriously bad support for XSL (of course).</li>
<li>PHP has <a href="http://www.php.net/xsl" title="PHP:XSL" rel="external">XSL support natively in PHP5</a>, but PHP4 requires a <a href="http://www.php.net/xslt">PECL library</a> (I can&#8217;t find the extension on PECL for some reason).</li>
<li>More syntax to remember</li>
<li>The only good documentation I&#8217;ve come across is the specification itself. <a href="http://www.w3schools.com/xsl/" title="W3 Schools XSLT Tutorial" rel="external">W3Schools</a>, which usually has a pretty decent overview, I found lacking.</li>
<li><span style="font-weight: bold; font-style: italic">Most</span> variable processing has to be done before you transform the XML. It is possible to use variables in the XSL itself, but it is very limited.</li>
<li>Javascript does not work on the XML document itself, just the generated source. This means if you use AJAX to grab eg. a list of languages, you have to either do the transformation server-side or in the Javascript itself. Thankfully, Google has an excellent <a href="http://code.google.com/p/ajaxslt/" rel="external" title="AJAXSLT">Javascript library to do XSL transformations</a>! Some browsers (Mozilla is one I believe) also have built-in XSLT support in Javascript.</li>
<li>Unless you do the transformation on the server-side <span style="font-weight: bold">search engine crawlers will not be able to index your site</span>. Of course you could set it up to only transform server-side if a crawler comes.</li>
</ul>
<p>Now I ask: why don&#8217;t more sites use XSL? I know I&#8217;ll be building most of my sites in the future with XSL, the benefits far outweigh the downsides in my opinion.</p>
<p><span style="font-weight: bold">Update:</span> I completely forgot to mention a <span style="font-style: italic">very important</span> downside. I bolded it in the list.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.firesidemedia.net/dev/the-power-of-xsl/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fireside Media LLC Software Development</title>
		<link>http://www.firesidemedia.net/dev/fireside-media-llc-software-development/</link>
		<comments>http://www.firesidemedia.net/dev/fireside-media-llc-software-development/#comments</comments>
		<pubDate>Wed, 20 Feb 2008 18:07:30 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
		
		<category><![CDATA[News]]></category>

		<category><![CDATA[open source]]></category>

		<category><![CDATA[wordpress]]></category>

		<category><![CDATA[wordpress plugins]]></category>

		<guid isPermaLink="false">http://www.firesidemedia.net/dev/fireside-media-llc-software-development/</guid>
		<description><![CDATA[We have the start of what will be a long line of open source products by Fireside Media, LLC.  To start it, we are releasing an updated version of the Twitter Updater plugin.
The plugin was originally written by Victoria, but she gave us permission to release the updated version here.  The plugin was [...]]]></description>
			<content:encoded><![CDATA[<p>We have the start of what will be a long line of <a href="http://www.firesidemedia.net/dev/software/">open source</a> products by <a href="http://www.firesidemedia.net/">Fireside Media, LLC</a>.  To start it, we are releasing an updated version of the <a href="http://www.firesidemedia.net/dev/software/wordpress/twitter-updater/">Twitter Updater plugin</a>.</p>
<p>The plugin was originally written by Victoria, but she gave us permission to release the updated version here.  The plugin was modified by Jonathan to include tinyurl.com&#8217;s API as part of the Twitter updating.</p>
<p>We have some other great ideas for <a href="http://www.firesidemedia.net/dev/software/wordpress/">Wordpress plugins</a> already coming along and will be releasing them in stages.  Expect some new plugins to come out within the next few weeks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.firesidemedia.net/dev/fireside-media-llc-software-development/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
