demo · v152

RSS without XSLT

The biggest real-world XSLT casualty: pretty-printed feed pages. This demo renders RSS / Atom feeds purely with DOMParser and template strings — the modern replacement for <?xml-stylesheet?>.

Pick a feed and fetch.

what XSLT did, what JS does now

// Old (XSLT, deprecated in v152):
//   <?xml-stylesheet type="text/xsl" href="rss.xsl"?>
// The browser auto-applied rss.xsl to turn the RSS into HTML.

// Replacement: parse + render in JS.
const res = await fetch(feedUrl);
const xml = new DOMParser().parseFromString(await res.text(), "application/xml");
const items = [...xml.querySelectorAll("item, entry")];
container.innerHTML = items.map((it) => `
  <article>
    <h4>${esc(it.querySelector("title")?.textContent)}</h4>
    <p>${esc(it.querySelector("description, summary")?.textContent ?? "")}</p>
  </article>`).join("");

why this angle

The other concept tests whether XSLTProcessor still exists. This one shows the most common deployed use of browser-XSLT — pretty RSS — and how to replace it with eight lines of JS. Feed authors are the largest group affected; this is what they need.

see also