Blog Entries for XSLT Blog Engines

Just wondering how blog entries should be formatted so that they can be properly rendered using XSLT. Tested this out, seems to work OK:

<bodycontent>
<h2>Greetings!</h2>
 
<p>How are you?</p>
 
<pre><![CDATA[
hi
<
]]></pre>
 
</bodycontent>

I was specifically curious about the CDATA section. Thanks to dpawson again: xslt cdata sections.

CDATA sections are pretty much a convenient way of escaping special XML characters. Perhaps a pre-processor could find all <pre> sections and escape all the characters within it.

The eternal debate about whether to use pre or code tags continues to rage. I’m not going to worry about it. I’ve been using pre for many moons and it hasn’t been a problem at all.

By Albert on August 22, 2009 8:18 PM

Categories: