<?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>
	<copyright>© Terence Eden. 🄯 CC BY-SA. See https://shkspr.mobi/blog/copyright-and-copyleft/</copyright>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.3</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[Terence Eden]]></dc:creator>
		<pubDate>Sat, 19 Aug 2023 11:34:35 +0000</pubDate>
		<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>&lt;p&gt;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?&lt;/p&gt;

&lt;p&gt;Me. I am that idiot.&lt;/p&gt;

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

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

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

&lt;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"&gt;

&lt;p&gt;All modern browsers &lt;em&gt;should&lt;/em&gt; be able to render it. If you spot any glitches - please let me know.&lt;/p&gt;

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

&lt;p&gt;Because I can 😂&lt;/p&gt;

&lt;p&gt;OK, there were three main reasons:&lt;/p&gt;

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

&lt;p&gt;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 &lt;em&gt;without&lt;/em&gt; &lt;strong&gt;any&lt;/strong&gt; JS!&lt;/p&gt;

&lt;p&gt;Bonus bonus reason - semantics!&lt;/p&gt;

&lt;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 &amp;quot;Is this the semantic web?&amp;quot;
The butterfly is labelled &amp;quot;XML + XSLT&amp;quot;." width="556" height="500" class="aligncenter size-full wp-image-46587"&gt;

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

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

&lt;p&gt;For this demo, I didn't bother with a proper document schema. I just bashed some random elements together.&lt;/p&gt;

&lt;p&gt;The XSL tells the browser to render it as HTML and provides a scaffold for doing so.&lt;/p&gt;

&lt;p&gt;It is all gussied up with some fairly generic CSS.&lt;/p&gt;

&lt;p&gt;And that's it really.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;
&lt;img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=46577&amp;amp;HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager"&gt;</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>
