[Westwales] Off-topic question, on the offchance... (XSLT and stuff)

Jon Pearse jon at jonpearse.net
Sat May 14 22:10:40 BST 2005


   Well, I ask you lot on the offchance someone here knows... save 
trawling the 'net for helppages.

   I'm playing around with XSLT to transform an XML file so that it 
displays nicely in a browser - the idea is that I can apply it to all 
of the RSS feeds dotted around my websites to offer a slightly more 
useful output than raw XML dumped to the screen. That's the idea 
anyways, and I have it working in a few of the browsers I'm working 
with. However, moz. proj. browsers are causing me an issue.

   In order to conform to the RSS spec, whilst still retaining rich 
formatting in the feed data, I've enclosed the contents of the 
DESCRIPTION block for each item in CDATA sections. It doesn't break the 
spec, and displays well in newsreaders. Wonderful. The result looks 
something like:

	<description><![CDATA[<p>What? An update? How 
bizzare...</p>]]></description>

   I'm using the following XSL fragment to transform the XML:

	<dd><xsl:value-of select="description" 
disable-output-escaping="yes"/></dd>

   I'm expecting the result to look like:

	<dd><p>What, an update? How bizzare...</p></dd>

   Safari - my main browser - produces this code and, as if to confirm 
that it works the way it does, setting disable-output-escaping to 'no' 
gives me literal HTML. Excellent.
   Mozproj. browsers, however... seem to either be ignoring 
disable-output-escaping, or seems to be applying it slightly 
differently to the way I want it to. Either way, it's bloody annoying 
because mozproj. browsers have the largest userbase out there other 
than IE (and IE here is having serious problems even with UTF-8 encoded 
XML, let alone attempting to transform anything)...

  ... so, if anyone knows anything about XSLT and how to deal with this 
... or knows anyone who does ... I'd be extremely grateful for any 
help. A 'live' example can be found at 
http://jon.jonpearse.net/rss/blog.xml

   Cheers,

-Jon
(who would rather not be doing stuff for a customer on a Saturday 
evening)

-----------------------------------------------------------------------
 http://www.jonpearse.net                            jon at jonpearse.net
 AIM/Skype: JonDPearse                      Phone: +44 (0)78 1260 2710

 Some people come into our lives and quickly go. Some stay for a while
 and leave footprints on our hearts. And we are never, ever the same.
-----------------------------------------------------------------------



More information about the Westwales mailing list