Wednesday, March 16, 2011

XML Explorer - Portable app for spelunking large XML files (with source)

addictive tips - XML Explorer Portable Opens Very Large XML Files Extremely Fast

"XML (Extensible Markup Language) is a set of rules for electronically encoding documents. It is a format intended for providing information in a wide variety of structural formats such as RSS. XML Explorer Portable is a lightweight open source XML file viewer which is capable of opening very large XML files in few seconds. This makes it a reliable XML file viewer for viewing, exploration and copying of formatted XML data, evaluating XPath expressions and XSD schema validation. It contains an expression library to store and manage XPath expressions. Moreover, it supports multiple tabs, has a middle-click option to close tabs, and contains Visual Studio-style dockable panes.

..."

CodeProject - XML Explorer

Contents

  • Introduction
  • Background
  • Using the code
  • Points of interest
    • XPathNavigatorTreeView
    • XPathNavigatorTreeNode
    • Loading XML files asynchronously
    • Settings
  • Performance
  • Future enhancements

Introduction

At work, I find myself constantly having to view XML files. Some of the files I work with are extremely large (150MB+). Internet Explorer and Firefox take forever to open these files. I like the way Visual Studio 2005 provides the ability to expand/collapse individual elements, collapse or expand the entire document, etc., but it doesn't handle large files well either. Even the extremely expensive Stylus Studio chokes on large files, and doesn't offer the features of VS2005.

I explored several Open-Source solutions, including the ones from CodeProject, but most of them were not fast enough. Most loaded the entire document into a tree, all at once.

This article discusses my solution to the problem. I ended up with a nice little utility that gets used extensively around the office. It is an extremely fast, lightweight XML file viewer. It supports multiple document tabs, with support for middle-clicking to close tabs. It can be handle extremely large XML files. It has been tested on files as big as 150MB. It allows fast viewing and exploration, copying of formatted XML data, and evaluation of XPath expressions.

..."

CodePlex - XML Explorer

"image

XML Explorer is an extremely fast, lightweight XML file viewer. It can handle extremely large XML files. It has been tested on files as big as 300MB. It allows fast viewing and exploration, copying of formatted XML data, evaluation of XPath expressions, and XSD schema validation

...

SNAGHTML1182fbc

..."

Here's a snap of it opening a 13MB XML file (a backup of my blog)

image

It can open XML from local files, clipboard or via URLs;

SNAGHTML12d7802

1 comment:

BillC said...

I tried XML Explorer on a 20 MB xml file with one child under the root and that child had one million empty child elements. It hung up when I tried to expand the root child, likely because it attemtpted to add all one million grandchild nodes to the tree. The technique of dynamically loading a treeview does not work with all xml files. Take a look at how I solved this problem at my website: xponentsoftware dot com.