Using XSL formatting for XML Traffic Reports

XSL stands for Extensible Stylesheet Language. It is kind of the XML equivalent of Cascading Stylesheets (CSS). Since XML data by itself does not contain any information on how to render its contents, a style sheet needs to be attached to it in order to convert it into HTML, PDF, RTF, GIF or any other display format.

Here is an example of XML document produced by TMeter:

<?xml version="1.0"?>
        <Filter Id="1">
        <Filter Id="2">
        <LastModified&gtNovember, 26 2002 11:19:14</LastModified>

If you open this document using Microsoft Internet Explorer, it will look like:

This view is not human-friendly. However, let's create XSL formatting (in a separated file traffic.xsl) for the XML document. The content of traffic.xsl is here.

Next, add a reference to the traffic.xsl in a prolog of the XML document:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="traffic.xsl"?>

...and we will get a human-friendly view of the XML document using Microsoft Internet Explorer:

To format the Monthly XML Traffic Reports, use XSL formatting included in the TMeter package.