I want to view large XML files. I tried XML Copy Editor but it displays XML data just in one line means it is not showing it in proper format. I saw screenshots of XML Copy Editor on Google which look quite good.
Does anybody have an idea how do I view XML file in XML Copy Editor in proper format?
Or any other good XML viewer for Ubuntu?
xml file you want to view. If you're using Gnome, you can open GNOME Files and double-click the folder where the file is stored. If you're using KDE, the built-in file manager is Dolphin. Right-click the file and select Open With Other Application.
View an XML file in a browser Just about every browser can open an XML file. In Chrome, just open a new tab and drag the XML file over. Alternatively, right click on the XML file and hover over "Open with" then click "Chrome". When you do, the file will open in a new tab.
XML is a markup language that's being used widely to structure and transfer data across the wire. While there are tonnes of libraries and frameworks that allow us to parse and handle XML documents, xmllint is one of the most versatile XML command-line tools in Linux.
The original XML Notepad shipped in back in 1998, written by Murray Low in C++. Later on it fell behind in support for XML standards and, because we didn't have time to fix it, we pulled the downloader.
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.
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:
-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 h
to (re-)discover its amazing range of features.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With