Saturday, July 30

Firefox doesn't support disable-output-escaping feature

If you have to know, disable-output-escaping is an atribute of xsl:text to stop escapes & and < into & and <. It's a pity that Firefox can't handle this well. From Denis de Bernardy I found a letter from Mozilla developers saying that the Mozilla(Firefox, Netscape) was already doing the right thing, following the standard of W3C. So they are not going to fix this bug, because they even don't think it is a bug.

Good, we have to find some way to go around it. Sean M. Burke made a javascript program to render the paragraph before it's output. It works pretty well: Feedburners is using this program too. I made a xsl file using this js program to make RSS (0.91/0.92/2.0) pretty in browsers. If you are thinking to deal with RSS, you can simply copy this rss.xsl into the same folder of your RSS file, and add
<?xml-stylesheet type="text/xsl" href="rss.xsl" ?>

under the first line
<?xml version="1.0"?>

If you want to handle other xml files, you can look into the code of the rss.xsl. Happy hacking!

Labels:

6 Comments:

At August 03, 2005 12:19 PM, Blogger xls said...

This is very helpful.

In my feeding program, I limited the rss text to less than 500 lines. Enough for most of them.

 
At August 03, 2005 3:02 PM, Blogger Ben said...

In your blog you don't put any link, any image, not even any Bold or Italic type, so it's easy for you. :)

 
At August 18, 2008 10:16 AM, Anonymous Mark said...

You might also try my in-line solution for this problem. Find "Firefox disable-output-escaping" in my AJAX xslt lib source listing:

http://ajamyajax.com/ajaMyXSL.html

or download the free lib which has a few RSS Feed ideas also. Hope this helps.

 
At January 21, 2009 10:50 AM, Anonymous Bobble Bardsley said...

Not sure if this will work for everyone but I believe if you use copy-of rather than value-of when copying across your xml content, it works cross-browser. We're using it with a simple JS script to turn the whole thing into html rather than having the .xml in the address bar but it works for us. More detailed instructions here.

 
At April 17, 2009 11:09 PM, Blogger Stephan said...

Thanks Bobble,

But when the content isn't enclosed with CDATA, can it also be traversed with JavaScript?

 
At April 17, 2009 11:40 PM, Blogger Ben said...

Bobble, my script can work "cross-browser", so I didn't try yours.

 

Links to this post:

Create a Link

<< Home