by Evidlo · 5y ago · 0 comments
e.g. (with hypothetical <extends> and <block> tags)
template.html
<!doctype html>
<html>
<h1>My Fancy Blog</h1>
<block main/>
</html>
index.html <extends "template.html">
<block main>
<body>
Hello world
</body>
</block>
Maybe this would compromise browser performance or add some kind of vulnerability, but authoring DRY HTML directly is my fantasyXHTML does, it's XSLT.
For example:
<?xml version='1.0' encoding='ASCII'?>
<?xml-stylesheet type="text/xsl" href="stylesheet.xsl"?>
<root>
<title>Page Title</title>
<block name="main">
<article xmlns="http://www.w3.org/1999/xhtml">
<p>Hello world</p>
</article>
</block>
</root>
With this in stylesheet.xsl: <?xml version="1.0" encoding="ASCII"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/root">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml">
<head>
<title><xsl:value-of select="title" /></title>
</head>
<body>
<h1>My Fancy Blog</h1>
<xsl:copy-of select="block[@name='main']/xhtml:article" />
</body>
</html>
</xsl:template>
</xsl:stylesheet>
And it's supported by all major browsers. Probably even IE6.