Present status of XSLT support in browsers

Despite supporting XSLT Safari 2.0 ignores XSLT when it comes to RSS/RDF (I would assume Atom as well) feeds. This means that, if you have an XSLT transformation on your site’s various feeds, Safari will ignore the XSLT and render it within its native RSS viewer. Needless to say I’m not happy about this.

I’ve also discovered that Mozilla’s XSLT parser ignores disable-output-escaping, which, in their defense, is deprecated. In order to properly output XHTML/HTML that may be present in your <![CDATA[ ... ]]> you need to do the following.

  1. Remove your <![CDATA[ ... ]]>
  2. Make sure the markup inside of the <![CDATA[ ... ]]> is valid.
  3. Use <xsl:copy-of select="./*"/> to copy the content of the valid XHTML (it’s no longer HTML once it’s valid XML) into your output.

I’ve got an example (tested in Firefox, but not IE) of my RDF feed here. If you’re using Safari you’ll notice that it uses the new RSS reader instead of displaying my XSLT output. Thanks Apple. The odd part is that XSLT works just fine with non-RSS/RDF XML. The only thing I can guess is that Safari recognizes certain RSS tags and switches to whatever the RSS/RDF reader is.

I’ve been thinking about redoing the site so that it’s just XML/XSLT. This was the initial test to see how things would work in various browsers. Things look good, but in order to support Safari, I’ll have to use non-RSS/RDF XML.

2 thoughts on “Present status of XSLT support in browsers

  1. “The only thing I can guess is that Safari recognizes certain RSS tags and switches to whatever the RSS/RDF reader is.”

    It uses the Content-Type HTTP header sent by the server. Sniffing tags in the content is messy and error-prone; the Content-Type is the final word on what any given document actually is. You could probably hack something together with mod_rewrite to send “application/xml” to Safari to work around this.

    Also, there is presently no XSLT support in Konqueror (coming soon, probably with KDE 4.0). IIRC, it’s buggy in IE 6, and completely broken/nonexistent in IE <= 5.5.

    Here’s a chart of XSLT support in browsers.

  2. Ian,

    It is sending application/xml as the Content-Type. Run this to double check me:

    w3m -dump_head http://zebulon.miester.org/~jstump/rdf.xml

Leave a Reply

Your email address will not be published. Required fields are marked *