Making XML human-readable without XSLT
AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.
Why it matters
Gives RSS/XML publishers a browser-native way to render XML as HTML now that XSLT support is being questioned, though it hinges on continued script execution in XML documents.
A blog post by Jake Archibald describes a trick for making raw XML files, like website feeds, readable in a browser without using XSLT, the old styling language browsers may be dropping. You add a single script tag inside the XML file pointing to a JavaScript file. That script replaces the XML page with a normal HTML page the browser can display nicely. It mainly affects people who publish XML feeds such as RSS and want them readable when clicked.
Amid debate over browsers dropping XSLT, a decades-old technology for styling XML, Jake Archibald published a workaround for publishers of XML documents such as RSS feeds. It uses a script tag within the XML itself to run JavaScript that swaps in HTML. The cost is one extra script file per feed; the risk is that it depends on browsers continuing to run scripts in XML documents. Teams maintaining public XML feeds gain an alternative now, but it is not a standard.
Jake Archibald proposes adding an XHTML-namespaced <script src="script.js" defer/> element to an XML document. The browser executes that script, which calls document.createElementNS('http://www.w3.org/1999/xhtml', 'html') and uses document.documentElement.replaceWith() to substitute an HTML element, then populates the new DOM. This avoids XSLT entirely while remaining in-browser. Limitations: the XML must be allowed to load scripts, and no cross-browser testing data is given.
Read the original
This summary exists to save you time, not to replace the source.
Key terms
Was this summary useful?
One click, anonymous. It tells us which summaries to re-run.
Related reading
Code-driven AI illustrations are more useful than images from dedicated image models
Code-driven AI illustrations let designers edit assets directly in code, saving time on iteration and ensuring consistency, which is a game-changer for teams that need rapid, reusable visual content.
A hierarchical note-taking app for building large personal knowledge bases
Trilium lets users build and navigate massive personal knowledge bases without duplicating content, saving time on organization and retrieval.
Desktop apps in Go with native UI or web frontend
Go developers can now ship cross-platform desktop and mobile apps in a single small binary without cgo or heavy runtimes, cutting build complexity and deployment size.
OpenBitFun: an agent workspace with four harness modes and phone remote control
OpenBitFun lets agents run on any machine and be controlled from a phone, eliminating the need to choose between local power and remote access, saving developers time switching contexts.
Intel One Mono: a monospaced font designed with low-vision developers
Developers with low vision or eye fatigue can read code more clearly, reducing errors and improving productivity.