ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button
  Generating Database Server-Side Cross Tabulations
Subject:   Crosstabs are the playground for XML
Date:   2003-12-08 14:23:57
From:   gmax
Response to: Crosstabs are the playground for XML

"IMHO, Crosstabs can easily be done by XML"

Are you talking about producing or representing them? Client-side or server-side? (And since we are talking about database servers, don't forget that web servers are database clients.)

Crosstabs are statistical reports. They manipulate data from a database.
The purpose of my article is about doing it server-side rather than client-side.
I don't understand where exactly XML enters the equation.

XML is a markup language. It can represent data, but AFAIK it can't produce it. I hope this is not a case of confusing databases with their media (http://www.dbazine.com/pascal2.html).

Anyway, if Cocoon can send a query to a database, it can also send a crosstab query. The relevant point is how to create the SQL query and then how to transform the result from the database into a hierarchical structure. Notice that, unlike a normal database recordset, a crosstab query has a tree structure at the top and one at its left. Each row is related to both structures at once.
I am not saying that this data can't be represented in XML (because you can see several examples of XML representation at http://gmax.oltrelinux.com/cgi_bin/xtab.cgi) but it is less trivial that it seems.

The bottom line is: XML can represent data, but to extract data from a database you need some help from a major language.