views:

276

answers:

7

We have a 120MB XML file that we want to view. Opening it in IE brings my machine to a crawl. I guess IE is loading the whole file into memory.

Is there a tool to view this in a faster manner? Ideally a Windows GUI based tool. Would be nice if you could drill down through the data by collapsing/uncollapsing elements.

Textpad works but the data isn't formatted in a hierarchical manner. Ie: displays data as:

<TagA><TagB id="a"><TagC>abc</TagC></TagB></TagA>

instead of:

<TagA>
      <TagB id="a">
            <TagC>abc</TagC>
      </TagB>
</TagA>
+1  A: 

To view an XML file, I would use less(1), even though this doesn't format anything, either (beyond breaking the input into pages). If you want syntax hiliting, try vim.

Apparently, you want to view it in a pretty-printed form. For that, I suggest to use a separate prettifier, as a filter, and pipe its output into less. HTML Tidy can do pretty printing of XML. For less, mere piping would work; for vim, you need to tidy into a separate file (which you can then view with notepad instead, also).

Martin v. Löwis
Updated post re formatting. We could use less using Cygwin (we're on Windows). Would prefer a tool like less that would format the data as described in post.
Marcus
Ah - see my edit.
Martin v. Löwis
I tried using less with cygwin but it just seems to peg my CPU. Not sure what it is doing if it's just reading one page at a time. (Haven't gotten to HTML Tidy with cygwin yet).
Marcus
A: 

If you have it installed already, Visual Studio works pretty well for viewing XML documents.
Edit > Advanced > Format Document will reformat the layout of a document to make it easier to read (nice for the XML you receive as a single line).
Going to menu item Edit > Advanced > Outlining > Toggle All Outlining can collapse all your nodes to aid in drilling into the sections you need to.
If you don't have it loaded already, not sure if its really worth loading for this.

Brettski
A: 

To view the XML document faster to use UltraEdit or Microsoft Visual Studio IDE.

Chad
A: 

I've used the free EditPad Lite successfully for that (e.g. opening the StackOverflow db dump (>1 GB file).

It opens the file instantly.

JRL
Works similarly to TextPad for me. Seems to tax my machine a fair bit more than TextPad though.
Marcus
+3  A: 

You say you already use TextPad, so there's a plugin for Textpad called XmlTidy which will reformat the XML into a indented layout. Very handy. You can find it on the Textpad extensions page.

skaffman
+1 for XmlTidy. Very useful, especially if you use TextPad for everything.
dogbane
That is cool. Works really well on smaller files. Problem I seem to have is when using TextPad, TextPad complains that the file is all on one line and asks to split the XML file into multiple (4) lines. If I run XmlTidy after the split, it complains about the XML being invalid format.
Marcus
While this didn't really work for me for the really big files it does work great on the small-med files. Best solution I found.
Marcus
A: 

XMLMax will load your 120Mb xml in a syntx-colored treeview in less than 5 seconds. you can collapse, expand and more with any size xml. google xmlmax editor.

bill seacham
+1  A: 
JimSizzle