Comment

Comment by ndriscoll

xslt is a native template system that has includes: <xsl:copy-of select="document('/header.html')"/>

xhtml/xslt still works today (though browsers are stuck on v1). It's a declarative template system with a pretty powerful pattern matching system (xpath). You can also extract fragments from external documents or store them into variables. e.g. <xsl:copy-of select="document('/content.html')/body/div[2]/ul/li/a/@href"/> will copy all urls from a list inside the 2nd div. Or instead of second div in the body, you could search for a div with an id or specific attributes or specific children or whatever pattern you want.

Why webdevs forsook xml will always be a mystery to me. Particularly given that they now use things like JSX.

parent ndriscoll 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton