Lab

Minimize Close

Arithmetic Layout Manager

http://code.google.com/p/arithmetic-layout-manager/

IE-conditional comments in XSLT

For a long while I've thought this to be impossible, but recently I ran into a few useful sources. It turns out both IE and non-IE comments are quite possible to generate from XSLT. Both use a very different syntax.

This piece of XSLT code from the source code of this very website demonstrates how to use the two types of conditional comments:


<xsl:comment><![CDATA[[if !IE]><!]]></xsl:comment>
<style type="text/css" media="screen">
<xsl:comment>
@import url("style/Moz.main.css"); /* level 1 */
@import url("style/Moz.window.css"); /* level 2 */
@import url("style/Moz.document.css"); /* level 3 */
</xsl:comment>
</style>
<xsl:comment><![CDATA[<![endif]]]></xsl:comment>

<xsl:comment>[if IE]>
<![CDATA[
<style type="text/css" media="screen">
@import url('style/IE.main.css'); /* level 1 */
@import url('style/IE.window.css'); /* level 2 */
@import url('style/IE.document.css'); /* level 3 */
</style>
]]>
&lt;![endif]</xsl:comment>

The resulting code is:

<!--[if !IE]><!-->
<style type="text/css" media="screen">
<!--
@import url("style/Moz.main.css"); /* level 1 */
@import url("style/Moz.window.css"); /* level 2 */
@import url("style/Moz.document.css"); /* level 3 */
-->
</style>
<!--<![endif]-->
<!--[if IE]>
<style type="text/css" media="screen">
@import url('style/IE.main.css'); /* level 1 */
@import url('style/IE.window.css'); /* level 2 */
@import url('style/IE.document.css'); /* level 3 */
</style>
<![endif]-->
Sticky
Around this time of year I often need to find a suitable font for Christmas cards. Finding a nice free font can sometimes be rather annoying as for some odd reason most free fonts are not actually free. Thanks to the Custom Search Engine feature of Google co-op this has now become a whole lot easier.

Presenting a search engine that only searches a selected set of nice, free font websites:

Launch Font Search