Skip to main content


developerWorks  >  XML | Web development  >

Analyze with XSLT: Create 3D representations with XSLT and SVG

developerWorks

Level: Intermediate

Nicholas Chase (nicholas@nicholaschase.com), Author, Web-Site Developer, Freelance
Jason Bell (jasonbell@sys-con.com), Technical architect, Consultant

27 Apr 2004

Register now or sign in using your IBM ID and password.

In Part 4 of this series on analyzing data with XSLT, the MindMap Research Team realized that the cognitive data they're analyzing might be easier to understand if represented in the 3D space for which it is intended. The team decides to use XSLT to transform it into a 3D graph so changing the viewpoint changes the view of the data. This tutorial shows how to implement this from a command line and using a browser to display the results.

Prerequisites

This tutorial is for developers who want to combine XSLT with other languages such as Scalable Vector Graphics and Java. It details the creation of an SVG image that represents a view of three-dimensional data from an arbitrary viewpoint.

The tutorial assumes that you are familiar with the basics of XML and XSL Transformations. It covers some SVG and a tiny bit of HTML, but no prior knowledge is assumed. It also uses Java code to perform the transformation and as an extension to the stylesheet, but the concepts hold true for any environment.

Other tutorials in this series are:


System requirements

You will need JavaScript enabled in your browser.

To follow along with this tutorial, you'll need to have the following tools installed and working.

For the command-line version, you will need:

  • Java 2 Standard Edition 1.4 or another XSLT engine: As the title implies, this tutorial involves performing XSLT transformations. The sample code uses Java 1.4 (available at http://java.sun.com/j2se/1.4.2/download.html, which has XSLT built in. If you're using Java 1.3 or earlier, you can download the Xalan XSLT processor, available at http://xml.apache.org/xalan-j/index.html. You also have the option to use another language and another engine, but you'll have to adapt those sections of code accordingly.
  • An SVG reader: You can download the Adobe SVG Reader from http://www.adobe.com/svg/viewer/install/ in order to give your browser the ability to view the SVG created here. The Mozilla browser (http://www.mozilla.org) will have SVG support built into it, but at the time of this writing, support is turned off by default.
  • An XSLT development environment, and a Java development environment: You can develop Java and XSLT using a text editor, but you will find it easier if you use an IDE such as WebSphere Studio Application Developer. You can download a trial version at http://www-106.ibm.com/developerworks/websphere/downloads/WSsupport.html.

For the browser-based version, you will also need:

  • A servlet engine: This tutorial demonstrates an XSLT transformation in a Java servlet, so you'll need a servlet engine such as Tomcat, available from http://jakarta.apache.org/tomcat/index.html. If you're using WebSphere Studio Application Developer, however, you can skip this step and use the WebSphere Test Environment.


Duration

Under one hour


Formats

html, pdf


Share this....

digg Digg this story del.icio.us del.icio.us Slashdot Slashdot it!


Back to top


Document options

Document options requiring JavaScript are not displayed


My developerWorks needs you!

Connect to your technical community


More in this series:
Analyze with XSLT