tags:

views:

1097

answers:

5

When you view a simple XML document in Firefox, it goes to the standard XML display mode, where you can collapse subtrees, etc. But it's pretty limited in functionality; there's nothing convenient like "expand all" and "collapse all" buttons, there's that annoying "This XML file does not appear to have any style information associated with it. The document tree is shown below" message at the top of the page. Are there any decent Firefox extensions that provide better XML viewing/manipulating/navigating? I looked in the Mozilla extension repository but there didn't seem to be anything promising.

+2  A: 

When I write web services that serve XML content, I usually prepend an XML stylesheet declaration to the content to style the content for human consumption. The stylesheet is a client-side XSLT transform that runs in the browser to turn the XML into XHTML and CSS, maybe with some JavaScript to add interactivity. It makes it much easier to debug the webservice and often means I don't have to write an HTML webapp to access the same data.

Nat
http://www.w3.org/TR/xml-stylesheet/ +1
RobertPitt
A: 

Nat, this doesn't help if you're downloading someone else's XML content.

I usually use IE 6 (at least you can open it in a text editor), but IE8 acts similarly to Firefox. I'd love an answer to this question.

Cameron
Unless you're answering the OP's question, please use the Add Comment feature to discuss.
musicfreak
I didn't have enough reputation at the time.
Cameron
+1  A: 

Associate another viewer with the XML mimetypes you want to edit by editing mimeTypes.rdf in your profile directory. XML is application/xml and text/xml but there are also specific variants like application/xhtml+xml, application/svg+xml and application/rss+xml that'll you'll need to decide whether to override the default behaviour (catching these would break XHTML rendering, SVG images and RSS feeds respectively).

Once you've registered the type you should be able to modify the default action under Tools->Options / Applications to use whatever editor you want.

SpliFF
A: 

You can edit firefox's own xsl doc as indicated by the following link

I'm after the same kind of thing myself i'll have a play with xsl and post my results.

wmitchell
A: 

You can associate an XSLT Stylesheet to your XML document by adding :

<?xml-stylesheet type="text/xsl" encoding="UTF-8" href="yourstylesheet.xsl" version="1.0"?>

after the XML declaration. See http://www.w3schools.com/xsl/xsl_transformation.asp for more information.

Pierre