Using SVG and XSLT for graphic representation

In this paper we will present an XML based framework that can be used to produce graphical visualisation of scientific data. The approach rather than producing ordinary histogram and function diagaram graphs, tries to represent the information in a more graphical appealing and easy to understand way. For examples the approach will give the ability to represent the temperature as the level of coulored fluid in a thermometer.

The proposed framework is able to maintain the value of the datas strictly separated from the visual form of its representation (positions of element, colours, visual representation etc.).

By defining appropriate data structures and expressing them using XML, the framework gives the user the ability to create graphic representations using standard SVG and XSLT.

Since XML can be used for describing complex data information, we represent every level of the graphic representation with an XML structure.

To describe our architecture we defined the following XML dialects, each one with different markup tags, reflecting the semantical values of the elements.

Both data representation and data definition files are based on a DTD to impose the constraints.

Data representation level is the core of the system, and defines a powerful language for representation.

XSLT is used to output a SVG file derived from the two files describing the graphic representation.

Our aim is to provide an abstract language to be used to represent in different ways the same concept. In fact, we can link a data definition file with different data representation levels, providing different kinds and levels of complexity for the same concept. An example use could be the representation of the temperature described before, where the temperature itself could be represented either as the level of mercury in the termomether, or as the rotation of an arrow in a gauge.

The transformation process is made from an XML source tree into an XML result tree, using XPath to define patterns. XSLT transformation process is based on templates, that define some actions (like adding or removing elements, or sorting them) to be performed when a part of the document matches a template.

To implement some of the complex graphics operations we are using XSLT extensions that allow to perform mathematical operations.

These XSLT extensions are not yet standard and require specific compliant parser, as Apache Xalan, that allows the developer to interface with Java classes in order to increase XSLT areas of application, from simple node transformations to quite complex operations.