TIL XML Has Stylesheets?!
Published February 5, 2021
Today I learned XML documents can have stylesheets! ๐ฎ
Browsing the comments of a recent HackerNews post on RSS led me to this comment which included a link to interconnected.org/home/feed. On first-pass this looks like a standard web page, but if you view the source1 itโs a raw RSS XML feed. Wtf?!
Turns out, thereโs an XML-esque stylesheet language: XSLT. Others have done this before. Compared to CSS, the stylesheet for an XML document is just more XML. For example, the stylesheet to the aforementioned feed: interconnected.org/home/static/styles/pretty-feed-v2.xsl.
I think this is pretty neat and a clever solution to the problem of having a link to your feed (click it!) which either 1) renders raw XML or 2) prompts to download the feed2. Another option Iโve noticed around is having a landing page for your feed(s). Examples:
Makes me think I should consider revamping how I do things on this site. ๐ค
Anyways, if youโre reading this and didnโt already know, you can subscribe to my feed! If you want a feed reader recommendation, Iโm using Miniflux and enjoy it.
Last modified March 19, 2021 #til #syndication