Publishing sites with pure XML instead of HTML and XHTML
Utilizing the Atom Syndication Format and the XSLT technologies in order to create universal sites over HTTP.
About
From this tutorial you would learn of creating sites with XML files.
The most common and preferred XML file for that task is the Atom Syndication Format.
Yet, on some occations, you might want to publish custom XML datasets.
Terms
If you do not yet know of XML and XSLT, then please read these paragraphs.
XML
XML (The Extensible Markup Language) is the universal format for structured documents and data on the Internet.
XML is descriptively identified in the XML 1.0 W3C Recommendation as "an extremely simple dialect [or 'subset'] of SGML" the goal of which "is to enable generic SGML to be served, received, and processed on the Internet in the way that is now possible with HTML, " for which reason "XML has been designed for ease of implementation, and for interoperability with both SGML and HTML."
HTML
Note that the "HTML" referenced in the preceding sentence (bis) means HTML 4.0 and 3.2 which were in common use as of 10-February-1998, when the XML 1.0 specification was published as a W3C Recommendation.
The next version of 'HTML' was expected to be reformulated as an XML application, so that it will be based upon XML rather than upon SGML. As of December 1998, 'Voyager' was the W3C code name for HTML reformulated as an application of XML.
XSLT
XSL (Extensible Stylesheet Language) is a language which is intended to provide a rich stylistic control, and to ensure consistency of implementations.
It has document manipulation capabilities beyond styling.
XSL is a different language from CSS, and caters for different needs. The unique features are that CSS can be used to style HTML documents. XSL, on the other hand, is able to tranform documents.
For example, XSL can be used to transform XML data into HTML/CSS documents on the server. This means, the two languages complement each other and can be used together. Both languages can be used to style XML documents.
CSS and XSL will use the same underlying formatting model and designers will therefore have access to the same formatting features in both languages.
Benefits
The main benefits of utilizing XSLT are.
- Harmonization of internet pages by utilizing standard XML files;
- Interoperability with both internet browsers and syndication feed readers;
- The rendering process is engaged over client-side computer (i.e, the visitor), instead of the server;
- There is no need to utilize templating engines such as Jinja of Python or as PHP does, because the output is pure XML; and
- If a client computer does not support XSLT transformation, it is possible to do that task over the server-side instead.
Summary
This concise post from RSRSSS summaries XSLT very well.
Who needs HTML anyway?
12/16/2020, 9:40:22 AM
I have added an XSLT stylesheet to this RSS feed!
This means that when you open this feed in an internet browser that does not support subscribing to RSS feeds, you will instead get a nice looking page without me ever writing actual raw HTML.
In older or less common internet browsers that still support RSS subscriptions (as every good web browser should), such as Pale Moon, you will still get the default page that asks you if you want to subscribe.
Some of my friends had mentioned adding RSS to their static site generators was hard; how about turning your index page into the RSS feed, and letting browsers generate the HTML for you?
Samples
Here are XML pages that utilize XSLT stylesheets.
Syndication
RSRSSS
This site is entirely based on RSS 2.0
It utilizes a couple of directives, an XSLT and a CSS as a fallback.
Trần H. Trung
The journal of Mr. Trần H. Trung is based on Atom Syndication Format 1.0
Idiomdrottning
The journal of this site is also based on Atom Syndication Format 1.0
Interestingly, it utilizes only a CSS stylesheet, which demonstrates that Atom Syndication Format is the ideal format for publishing.
Dataset
yax.im
This site has a DOAP dataset which is contained within an XML file of type RDF.
The CSS stylesheet is called via the generated XHTML.
Content
XMPP
The site of xmpp.org offers its XEP index as XML which is styled by an XSLT stylesheet.
Authors: stpeter and temas.
Conclusion
Instead of utilizing Static Site Generators, or other Content Management Systems, you can merely host XML files and add XSLT stylesheet in order to transform these XML files into XHTML.
History
Past sites that have utilized XSLT.