Re: Human readable XML hacks?

From: Paul R. Butler <Paul.R.Butler_at_nyob>
Date: Mon, 30 Mar 2026 18:37:56 +0000
To: CODE4LIB_at_LISTS.CLIR.ORG
I use Notepad++ and the "XML tools" plugin. It has a "pretty print" function that has served me well for years. I've used Oxygen before, but it offered way more than I needed for most tasks. 

Cheers, Paul


Paul Butler | Dartmouth Libraries Discovery Systems Librarian | Dartmouth | Hanover, NH, 03755

-----Original Message-----
From: Code for Libraries <CODE4LIB_at_LISTS.CLIR.ORG> On Behalf Of Eric Lease Morgan
Sent: Monday, March 30, 2026 2:26 PM
To: CODE4LIB_at_LISTS.CLIR.ORG
Subject: Re: [CODE4LIB] Human readable XML hacks?

On Mar 30, 2026, at 2:14 PM, Canino, Adrienne <Adrienne_at_AXIOMDATASCIENCE.COM> wrote:

> Anyone have a favorite tool for make XML 'render' into a document friendlier for humans to read?
> Latex? Oxygen Editor? Ideally this would be a lightweight tool on a local machine (meaning chromebook friendly) or browser magical widget.
> 
> --
> Adrienne Canino (she/her)
> Data Librarian (MLIS)
> TetraTech Ocean Sciences
> Anchorage, Alaska


Yes, XML can be difficult to read, and, in general, there are two ways to make it more readable: 1) formatting it, and 2) transforming it. The former is relatively easy through the use of a widely available command-line program called xmllint. Try:

  $ xmllint --format <file.xml>

Xmllint will look at your file, verify that it is well-formed (or not), and then collapse and indent things for more easier reading. You can pipe the result through to a pager to see the result one screen at a time, kinda like this:

  $ xmllint --format <file.xml> | less -S

A program called HTML Tidy does much the same thing. [1]

If you want to make your XML really easier to read, then maybe you are wanting to transform the XML into some other format, like HTML, a plain text file, a CSV file, et cetera. If you want to do these sorts of things, then that is something else altogether.

Finally, while searching for Tidy I see there may be more than a handful of Web-based tools to make your XML easier to read. I haven't tried any of them. 


[1] https://www.html-tidy.org/documentation/


--
Eric Morgan <emorgan_at_nd.edu>
Received on Mon Mar 30 2026 - 14:37:57 EDT