It always bothered me that Safari doesn’t show raw XML data in a useful way, like Firefox and other browsers do. I had to use “View Source” every time to see the XML data, because Safari seems to interpret the XML elements as HTML, leaving only text element content visible:

Here’s the same data in Firefox:

In my current project at work I had to use “View Source” all the time, so I decided to do something about it. Joachim Fornallaz pitched in and the result is “XML View Plugin”, a Safari WebKit plugin that registers as a handler for some XML MIME types and displays the raw XML code:

It can optionally pretty-print it with Tidy:

I’d like to add syntax coloring if I can find a C-based library with a BSD-ish license that does that.
The inspiration for this project came from the fantastic ClickToFlash plugin that was in the Mac news recently. Like XML View Plugin, ClickToFlash is implemented as a WebKit plugin. Before reading about it, I did not realize that there’s a convenient, Objective-C based alternative to the old-school Netscape browser plugin API.Download and more information are on the plugin’s info page. Please try it out and let me know what you think, and especially let me know if you find any problems that impact Safari’s stability.
Update 2009-03-04: Version 1.5 added user-customizable syntax coloring, see the info page for details. This is how it looks by default:

Trackback URL for this entry: http://www.entropy.ch/blog/Mac+OS+X/2009/02/09/Safari-Plugin-for-Viewing-XML-Data.html?tb=y
|













Soma online sales.
Tempra soma. Soma in san diego. Soma. Soma buy soma cheap soma soma online. Soma sen. Soma medication. Soma and addiction.