logoalt Hacker News

Evidlo05/03/20252 repliesview on HN

You can get JS-free, client-side include functionality if you're willing to wrap your HTML in XML. Here is a demo:

https://github.com/Evidlo/xsl-website


Replies

imiric05/03/2025

That's interesting, thanks.

How well supported is XSLT in modern browsers? What would be the drawbacks of using this approach for a modern website?

show 1 reply
int_19h05/03/2025

I don't think you even need to wrap it, really. You need to make sure it's valid XML, but the root element could be <html> just fine. And then use an identity transform with <xsl:output method="html">.