You can find dozens of them via your favorite search engine. They call themselves either « formatters », « viewers » or « beautifiers ». They are online tools to examine XML. I've been working part-time on one of them for more than one year now. It's time for me to compare Format Express with its competitors.
In this article, I pick several other online XML formatters, and I try to make an honest comparison of their features, to find out where Format Express stands out, and where it can be improved. Many such tools exist and I could not include all of them, so I chose 5 that looked different enough from each other.
Who use an online formatter ?
Most users working regularly with XML have an advanced text editor or IDE installed on their computer to help them with their task; The others, who do not have such a tool ready at hand, may look for an online solution.
- as a viewer : the user has a minified XML and wants to format it, in order to read/explore it.
- as an editor : the user is creating or modifying an XML extract.
- as a validator : the user wants to check if an XML is valid or not, with indication of the errors.
Let's dive into the comparison of their features. There will be no ranking of the different tools, as each one may be more suitable for a usage or another.
|Disposition||Full screen||Full screen||Half screen||Half screen||Half screen||Half screen|
|Ease of use||Formatted in place, on paste||Formatted in place, after validate||Formatted below original input, after validate||Formatted in place, after validate||Formatted side of original input, after validate||Formatted side original input, after validate|
|Ads / tracking||No||No||Yes||Yes||Yes||Yes|
|Search||Improved with regular expressions and filter||Improved with regular expressions||Browser default||Improved with regular expressions||Improved with regular expressions||Improved with regular expressions|
|Misc||breadcrumb, darkmode||tree view|
|Truncated XML||Processed with highlighted unclosed tag||Processed with highlighted unclosed tag||Not processed||Processed with no shown errors||Processed with no shown errors||Processed with highlighted unclosed tag|
|Invalid XML||Processed with highlighted errors||Processed with highlighted errors||Not processed||Processed with no shown errors||Processed with no shown errors||Processed with highlighted errors|
|HTML support||Yes, same page
Also format CSS
|Yes, separate page
Also format CSS
|Yes, separate page||Yes, separate page||Yes, separate page||Yes, separate page
Also format CSS
|Settings||Indentation, trimming, line breaks||None||Indentation, trimming||None||None||Font size|
|Editor||Simple textarea||Syntax highlighting and completion||Simple textarea||Syntax highlighting and completion||Syntax highlighting and completion||Syntax highlighting and completion|
|Misc||Recursive format, unescape Unicode, http API||Minify, load XML from URL||Minify, load XML from URL|
So, how Format Express performs ?
As stated earlier, the goal of the article is to study how my formatter, Format Express, stands against the other XML formatters. Disclaimer : the rest of this article has a lot of self-promotion and self-satisfaction, you might skip it if you're not a Format Express enthusiast :-)
The good points
- auto-adjust to the dimension of the browser window, so the maximum space is available for the useful content.
- when an input is pasted in the page, it's immediately formatted (no need to click "Format").
- the formatter supports several languages (XML, HTML, JSON, ...) and the right one is applied automatically (no extra action required by the user).
- multiples settings available to accommodate to the user's preference.
- no ads, no tracking, lightweight site (< 150kb).
- a minimap to have a quick overview of the formatted input
- a dynamic breadcrumb coupled with keyboard navigation
- recursive formatting (if the XML contains other XML or JSON for example)
- can unescape escaped characters or written with Unicode notation
- a stacktrace viewer
Format Express will try to format any given XML, even if it's incomplete, or invalid, or if it's inside quotes and escaped; It definitely doesn't fill the "validator" usage (there is no proper validation aside from some basic XML errors like unclosed tags), but it excels in the "viewer" usage : XML can be formatted of course, but also HTML (including CSS), JSON (or anything that looks like JSON), SQL... And all this on the same page.
The bad points
The server-side formatting increases the overall processing time, due to the transfer of the input back and forth. Most users won't notice the extra delay, but for the ones with very large input and/or limited bandwidth, the tools using client-side processing definitely have better performance.
My stats show that in most cases, the whole process takes less than a second : the average formatting time is 1.2s, with only 2% of requests taking more than 5s. This is not so bad.
The second drawback of server-side processing is the user may be reluctant to submit data for privacy/security reasons : I can assure you the input sent to Format Express is neither saved nor logged and no one can look at it. Yet it is a valid concern, even for seemingly client-side processing tools : do not submit personal or sensible information on any random website ! You don't know who might read it.
I have not implemented a per se editor : whereas some other tools have a real online editor (with completion, syntax coloring as typing, auto-indentation, etc...), Format Express only uses a basic HTML textarea when editing the input.
I have considered for some time to add such an editor like the others (interestingly, they all 4 use a combination of the Ace editor and vkBeautify formatter), but very few users edit the input after having pasted it. For now, I'll keep my focus on the "viewer" usage, and I leave the "editor" usage to some other tools
I originally created Format Express because I had minified data in my web services logs, and I
wanted to quickly format them when I was debugging.
I wanted a single tool that would handle both XML and JSON, was fault-tolerant (so many times I copied too much or
not enough from my console) and more user-friendly than the existing ones.
And for all this I think I succeeded. Yet it doesn't fill every needs, and people looking for an editor or a
validator should use some other tools.
If you're not already using Format Express and think it might suit you, let's try it !