<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/rss-style.xsl" type="text/xsl"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	     xmlns:dc="http://purl.org/dc/elements/1.1/"
	   xmlns:atom="http://www.w3.org/2005/Atom"
	     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	  xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>XML &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/xml/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Mon, 19 Aug 2024 05:42:51 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://shkspr.mobi/blog/wp-content/uploads/2023/07/cropped-avatar-32x32.jpeg</url>
	<title>XML &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[Let's build a website using XML!]]></title>
		<link>https://shkspr.mobi/blog/2023/08/lets-build-a-website-using-xml/</link>
					<comments>https://shkspr.mobi/blog/2023/08/lets-build-a-website-using-xml/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Sat, 19 Aug 2023 11:34:35 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[web dev]]></category>
		<category><![CDATA[XML]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=46577</guid>

					<description><![CDATA[It is 2023. XHTML is dead and buried. HTML is a &#34;living standard&#34; with billions of users. So what kind of idiot would want to build a website using XML?  Me. I am that idiot.  Last year, I launched a &#34;web page&#34; which didn&#039;t use HTML. Called, appropriately enough, &#34;YOU DON&#039;T NEED HTML!&#34; That (ab)used Unicode to make a somewhat attractive page. This year, I decided to forego the Unicode silliness…]]></description>
										<content:encoded><![CDATA[<p>It is 2023. XHTML is dead and buried. HTML is a "living standard" with billions of users. So what kind of idiot would want to build a website using XML?</p>

<p>Me. I am that idiot.</p>

<p>Last year, I launched a "web page" which didn't use HTML. Called, appropriately enough, "<a href="https://shkspr.mobi/blog/2022/12/you-dont-need-html/">YOU DON'T NEED HTML!</a>" That (ab)used Unicode to make a somewhat attractive page. This year, I decided to forego the Unicode silliness and use XML silliness instead.</p>

<h2 id="demo"><a href="https://shkspr.mobi/blog/2023/08/lets-build-a-website-using-xml/#demo">Demo</a></h2>

<p>Visit <a href="https://xml.viii.fi/index.xml"></a><a href="https://xml.viii.fi/index.xml">https://xml.viii.fi/index.xml</a> and see for yourself. Take a look at the source-code to verify that it is, indeed, an XML document.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2023/08/xml-fs8.png" alt="Screenshot of some XML code." width="732" height="372" class="aligncenter size-full wp-image-46586">

<p>All modern browsers <em>should</em> be able to render it. If you spot any glitches - please let me know.</p>

<h2 id="why"><a href="https://shkspr.mobi/blog/2023/08/lets-build-a-website-using-xml/#why">Why</a></h2>

<p>Because I can 😂</p>

<p>OK, there were three main reasons:</p>

<ol>
<li>I learned this stuff at University about a million years ago and I wondered if these skills were still relevant (they aren't!)</li>
<li>Browsers are constantly deprecating old features. I wanted to see if XML &amp; XSL still worked (they do!)</li>
<li>The voices in my head told me to (they didn't!)</li>
</ol>

<p>As an additional bonus reason - I'm bemused by the number of pages which are basically JSON files with client side Javascript rendering. So I thought I'd go old-skool and have the client rendering done <em>without</em> <strong>any</strong> JS!</p>

<p>Bonus bonus reason - semantics!</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2023/08/meme-xml-xslt.jpg" alt="Popular meme format. A young man points at a butterfly and says &quot;Is this the semantic web?&quot;
The butterfly is labelled &quot;XML + XSLT&quot;." width="556" height="500" class="aligncenter size-full wp-image-46587">

<h2 id="how"><a href="https://shkspr.mobi/blog/2023/08/lets-build-a-website-using-xml/#how">How</a></h2>

<p>Regular readers will recall that I wrote about <a href="https://shkspr.mobi/blog/2023/06/style-your-wordpress-atom-feed/">how to style your WordPress Atom feed</a>. The technique is pretty simple: take a well-formed XML document and link it to an XSL stylesheet, <i lang="fr">et voilà</i> there's a beautifully rendered document in your browser.</p>

<p>For this demo, I didn't bother with a proper document schema. I just bashed some random elements together.</p>

<p>The XSL tells the browser to render it as HTML and provides a scaffold for doing so.</p>

<p>It is all gussied up with some fairly generic CSS.</p>

<p>And that's it really.</p>

<p>I'm delighted that this technique still works. I don't think you should use this unless you absolutely need a lightweight way to render XML directly.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=46577&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2023/08/lets-build-a-website-using-xml/feed/</wfw:commentRss>
			<slash:comments>19</slash:comments>
		
		
			</item>
	</channel>
</rss>
