xml viewer for linux [closed] xml viewer for linux [closed] xml xml

xml viewer for linux [closed]


None of you guys suggesting Emacs, Vim, Geany or other text editor have clearly not worked with enterprise level XML data...

To get a touch with reality please take some averagely complex OpenDocument (Open/Libre Office ".odt" file, preferably with some tables and images) and try to edit that with your Emacs or Vim. Try to create a new with all the required fields pre-filled. Create a new table, or insert a new image. With a good XML editor all you need is "Right click -> Insert".

Unfortunately good XML editors cost money. XMLSpy from Altova is about 1000 U.S. dollars, OxygenXML bit less.


If you like to use command line interface, you woud like to use xmllint tool to proper format xml file, and then you can use regular less to view this large xml file.


Combining xmllint and less was a great intuition (kudos for @kokosing) and yes, it is possible to have syntax highlighting with less! Here is the full, workable solution:

xmllint --format yourfile | highlight --syntax=xml --out-format=xterm256 | less -R -N

The trick is to use:

  1. Another utility to do the syntax hightlighting (highlight can do it).
  2. Use the -R (raw) option in less so that it respects the escape sequences; N simply provides line numbering, which is nice.

It worked surprisingly well, so I published the solution on github with a bash script, under the name xmlshow.

Note: Next time you use less, I suggest that you press hto (re-)discover its amazing range of features.