Re: Human readable XML hacks?

From: Joey Takeda <takeda_at_nyob>
Date: Tue, 31 Mar 2026 00:51:06 +0000
To: CODE4LIB_at_LISTS.CLIR.ORG
Hi Adrienne,

If you're looking to render XML (rather than just format it) and If you're already using oXygen for editing/authoring the XML files, then oXygen can definitely be of use. It has some built-in stylesheets in their "Author" view for a variety of well-known flavours of XML (e.g. TEI, DocBook, JATS); you can also use oXygen to associate a CSS stylesheet with any XML to make it a bit more readable (see https://www.oxygenxml.com/doc/versions/28.1/ug-editor/topics/dg-css-support-in-author.html). However, a lot of the tools in oXygen or otherwise are going to depend on what kind of XML you're working with.

Otherwise, I can't think of any generic XML viewers, but if you happen to be using TEI, then you could also look at CETEIcean, which renders TEI in the browser as custom elements: https://github.com/TEIC/CETEIcean . Even if you're not using TEI, though, this approach might be useful (though not really a lightweight solution).

All best,
Joey

⎯
Joey Takeda, MLIS
Developer, Digital Humanities Innovation Lab
Simon Fraser University Library
takeda_at_sfu.ca
Unceded territory of the səl̓ilw̓ətaʔɬ (Tsleil-Waututh), kʷikʷəƛ̓əm (Kwikwetlem), Sḵwx̱wú7mesh Úxwumixw (Squamish), and xʷməθkʷəy̓əm (Musqueam) Nations

On Mar 30, 2026, at 11:37 AM, Paul R. Butler <Paul.R.Butler_at_DARTMOUTH.EDU> wrote:

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 - 20:51:10 EDT