Showing off XML
by Simon St. Laurent
Related link: http://alistapart.com/stories/usingxml/
Eisenberg starts off with a tough question:
"Isnít it inefficient to have to type all those tags...? What good is this? It looks nice, but what can I do with this document? How can I put this in a web page or use it with other programs? Wouldnít it be easier to just use HTML or a database/word processor/fill-in-the-blank?"
In answering it, he manages to show off RELAX NG (for validation), CSS (for annotated styles), XSLT (for transformative styles), HTML (for showing the contents in older browsers), SVG (for interactive graphics), and XSL-FO (to produce a PDF for print).
It's an excellent demonstration, and creatively applies technologies most commonly thought of as "document-oriented" to an XML document whose contents are largely "data", bridging a common divide in the XML world. To top it off, he explores the challenge it presented him:
"You donít have to be an expert at Relax NG, XSLT, XSL Formatting Objects, or SVG to do this. I donít use any of these techonlogies on a daily basis. I just know enough about each of them to get things to work. In this case, my philosophy was 'the first way you think of that works is the right way.'... This is not to say that there is no learning involved here; you will need to spend some time on that. You donít need to spend a lifetime on it, though. It is definitely possible to learn enough about these technologies to put them to effective use in a short time."
He doesn't even get into programmatic access to the data (through SAX or DOM for instance), but he's already shown off a wide range of immediately useful techniques. XML may finally be ready for the Web.
Is this kind of flexibility useful to your work?