🦋 Live Bluesky Post

Matt Kane's avatar

Matt Kane

@mk.gg

Matt Kane

OK, how did I not know this before? Turns out you can run scripts when you display XML documents in the browser by including them with an xhtml namespace. You can even load external scripts. Seems it could be useful if they do remove XSLT from browsers.

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[
  alert("hello");
]]></script>
<channel>
  <title>The Astro Blog</title>
    <description>News and updates about Astro.</description>
    <link>https://astro.build/</link>
</channel>
</rss>
August 24, 2025 at 7:49 AM UTC