From XML To…Anything
XML may be the best way to store your data, but how do you make it presentable? Enter XSL.
Saturday, June 15th, 2002
The story so far: you’ve got a mountain of data coded in XML, you’ve got schemas to make sure the data is valid, and you’ve written tools to manipulate the XML documents in a sensible way.
Now your boss has asked you to generate a report for the board meeting tomorrow. You know just what needs to be done: you have to convert your XML into something that can be displayed and printed–like HTML or a PDF file.
You could whip out your favorite programming language and write a tool to format the information, but data conversion tools are tedious to write. It would be nice if there was a better way. What you need is a tool that lets you describe how to transform your XML into “something else” and not have to write the code that does the transformation.
The Extensible Style Language (XSL) family of specifications can help save the day.
Making it Presentable
XSL makes it easy to change an XML document into a readable on-screen display or an attractive printed presentation (or another XML document based on a different schema).
Instead of writing your own tools, you can use XSL to define rules — change this element to that element, ignore this attribute, sort these sub-elements into this order, etc. — and use pre-built tools to interpret the rules and process the document.
XSL is composed of three complementary technologies: