views:

3003

answers:

7

There are plenty of "heavyweight" tools such as XmlSpy, which are good for prodding around in xml docs - but often (very often in some cases!) you just want to quickly open and browse an xml doc, and have it pretty printed. Possibly with some basic search functionality (textual is probably fine).

I usually use a browser such as IE of Firefox for this, but they tend to break down for larger file sizes (I'm often opening files in the 10s of MBs or more).

I have some ideas about how such a viewer might be implemented, so I'm sure there must be something out there that can do it, but my google-fu is letting me down.

So I thought I'd put it to the hive-mind that is SO to lead the way.

Thoughts?

A: 

I like the viewer of Total Commander because it only loads the text you actually see and so is very fast. Of course, it is just a text/hex viewer, so it won't format your XML, but you can use a basic text search.

schnaader
pretty-printing is quite important. Thanks, tho.
Phil Nash
A: 

I like Microsoft's XML Notepad 2007, but I don't know how it handles very large files, sorry.

It handles them ok in it's tree-view, but the text view still uses IE, so has the same problem
Phil Nash
+1  A: 

JEdit and its XML-plugin.

Johannes
Thanks.I was ideally looking for a dedicated xml viewer, but if JEdit does the job I won't rule it out. I shall take a look. Not tried it for a few years, but last time I did (as a text editor) I don't remember being bowled over...
Phil Nash
Ok, I tried it. I have to say I really hate vanilla Java GUIs, and JEdit is Java GUI to the core. That said it does seem to do it's parsing on a background thread, and shows what it can as soon as it has it. So it starts showing my 30MB file within 2-3 seconds.... [continued]
Phil Nash
... You can't then jump to later parts of the doc until they have been parsed, of course - and I think it does still do a full in memory parse - so it might struggle more with even larger docs, but in terms of my requirements this is the best so far. Thanks
Phil Nash
+1  A: 

Try EditPlus - http://www.editplus.com/

lkurts
Thanks Ikurts. I gave it a try and it certainly does a better job than the browers. It can handle large files fairly well (I tried it with some 30MB XML docs), and didn't crash! However, it does appear to be parsing the whole doc before showing it, which is not what I wanted. Voting you up anyway
Phil Nash
+2  A: 

XML Copy Editor is perfect for this type of thing.

yalestar
I just tried this. Very similar to EditPlus (see comments to IKurts). From trying a few times (not rigourous profiling), it seems slightly faster than EditPlus (both it's own startup time, and the load time for the 30MB doc) - but still parses the whole doc before showing.
Phil Nash
+15  A: 

firstobject's 605k download lightweight native Windows free XML editor opens a 50MB file in 1.3 seconds and provides text editing, search, syntax-colored printing, plus tree view and additional XML features including formatting and full-blown CMarkup scripting built in. You can reformat an entire 50MB XML document to a different indentation (takes 3 seconds on a nothing special 2.3GHz/2GB machine).

Ben Bryant
Thanks Ben. Just came back to this question as the requirement came up again and saw your response. This tool seems to be exactlty what I was originall looking for! I haven't yet tried it on huge docs, but 5Mb docs certainly open in a fraction of a second, and pretty-pretting in about a second by just hitting the F8 key. From what you say the performance should scale well into the tens of Mbs. May have some GB docs to try it with later. That will sort the men from the boys ;-)
Phil Nash
Thanks great answer!
George
I've just tried it with a 250 MB document and it works like a charm! Only thing I can't figure out is how to "make" it display HTML Entity as a value (eg, HTML Entity (decimal) from http://www.fileformat.info/info/unicode/char/160/index.htm)
Andrija
A: 

TextPad has a free xmltidy plugin that pretty-prints your XML. Nice and fast, although TextPad is shareware.

skaffman