Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Analyze with XSLT, Part 4: Create 3D representations with XSLT and SVG

Represent cognitive data in 3D graphs

Nicholas Chase (nicholas@nicholaschase.com), Author, Web-Site Developer, 自由职业者
Nicholas Chase, a Studio B author, has been involved in Web site development for companies such as Lucent Technologies, Sun Microsystems, Oracle, and the Tampa Bay Buccaneers. Nick has been a high school physics teacher, a low-level radioactive waste facility manager, an online science fiction magazine editor, a multimedia engineer, and an Oracle instructor. More recently, he was the Chief Technology Officer of an interactive communications firm in Clearwater, Florida, USA, and is the author of three books on Web development, including XML Primer Plus (Sams).
Jason Bell (jasonbell@sys-con.com), Technical architect, Freelance Developer
Jason Bell, a Studio B author, is a technical architect and API documentation advocate who is based in England. He is the Core and Internals section editor of the Java Developer's Journal and is also involved in a number of open source projects including RSSLibJ, a Java API for creating and reading Rich Site Summary news feeds.

Summary:  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.

View more content in this series

Date:  27 Apr 2004
Level:  Intermediate PDF:  A4 and Letter (229 KB | 41 pages)Get Adobe® Reader®

Activity:  7441 views
Comments:  

Introduction

Should I take this tutorial?

This tutorial is for developers who want to combine XSLT with other languages such as Scalable Vector Graphics and Java technology. 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.


What is this tutorial about?

The previous parts of this series (see Resources) followed the exploits of the fictional MindMap Research Team and their work in using XSLT in data analysis. In this installment, the team decides that much of their data could be better understood if investigators were able to look at it three dimensionally. To this end, they create a proof-of-concept that uses XSLT to create a Scalable Vector Graphics (SVG) image out of the data.

This tutorial touches on several XML-related standards. In the course of working through it you will:

  • Create a basic SVG image
  • Use XSLT to create an SVG file
  • Pass parameters to a transformation
  • Call a Java class and method from within XSLT
  • Create a simple HTML form
  • Output the results of a transformation to the browser using a Java servlet

You'll also learn how to project three-dimensional coordinates onto a two-dimensional plane, but we promise to keep the math as painless as possible.


Tools

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/ to give your browser the ability to view the SVG created here. The Mozilla browser (http://www.mozilla.org) has 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(R) Studio Application Developer. You can download a trial version at http://www.ibm.com/developerworks/websphere/downloads/wsad/.

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.

1 of 10 | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=XML
ArticleID=138568
TutorialTitle=Analyze with XSLT, Part 4: Create 3D representations with XSLT and SVG
publish-date=04272004
author1-email=nicholas@nicholaschase.com
author1-email-cc=dwxed@us.ibm.com
author2-email=jasonbell@sys-con.com
author2-email-cc=dwxed@us.ibm.com