Today, I have a small demonstration.
Small - seeing that I’m unsure how to tie the XML and XSLT together with PHP using the DOM XML Extension installed on my host’s server(s).
Let us suppose that I created a new weblog. Now, let us also assume that I really don’t feel much like producing a design (beyond that of what movabletype, or another blogging program, offers as a default). What I could do, is acquire a series of XML templates, install them into my blogging system, then simply link those XML templates to a “theme” of my liking.
The following link will point you towards this blog’s index, encoded in XML and using (what is similar to) a default movabletype layout.
What makes this thing so special?
Movabletype outputs this particular page to pure XML (extensible markup language). This data can be ported to any source you like. For instace, with the advent of RSS, custom applications are being produced simply to read the RSS data and present it in a user friendly manner. The showcased XML document is linked to an XSLT (extensible stylesheet language tranformations) document. This document reads the XML data and transforms it into something that a web browser (in our case, IE6, Netscape 6+, Mozilla) can read. In turn, the XSLT document is linked to a CSS (cascading style-sheet) document which defines font-sizes, background images and other superficial (but important) styling.
Well, I don’t know about you, but, even though I like the black, I’m not a very big fan of the overall layout. Because of this, why not link the XML document to XSLT/CSS stylesheets which may be more to our liking?
carbon copy of alazanto.org
alazanto.org/xml/style2.xml
carbon copy of mezzoblue.com (acquired with permission)
alazanto.org/xml/mezzo.xml
Or, how about…
carbon copy of my zen garden submission
alazanto.org/xml/style3.xml
For the latter page layout, I hacked Dave Shea’s beautiful markup to pieces in order to bring you an alternative rendition of my css zen garden submission. :) However, I didn’t even touch the CSS document, except to bring basic formatting to undefined headers.
In all these examples, I have linked to different XML documents. Each of these documents are identical, except for the following:
<?xml-stylesheet type=\"text/xsl\"href=”pick_a_stylesheet.xsl”?>
Let us now assume that someone else wanted to start their own weblog, but did not want to spend their time writing custom markup or sculpting css. All they would need to do is implement the standard XML movabletype templates, link those XML documents to the URL of their desired XSLT stylesheet, and viola!
Instant layout in a can.
The importance of such a methodology may be:
And so, I leave you with my current state of progress. Now for a couple of open requests.
AddType text/xml .xml .xsl
The server will automatically give XML and XSL documents a document-type of text/xml.
Published: 5 years ago
Leave a comment in the form below.
Leave a Reply
You must log in to post a comment.
Latest entries