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 developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

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 3: Layering XSLT stylesheets

Layer and use chain transformations to create procedural techniques

Chuck White (chuck@tumeric.net), XSLT consultant and Web engineer, Freelance Developer
Chuck White, a Studio B author, has been working with XML since before its official inception in February, 1998. He was co-author of Mastering XML Premium Edition (with Linda Burman and the W3C's XML Activity Lead, Liam Quin) and author of Mastering XSLT, both from Sybex Books. His latest books are Developing Killer Web Apps with Dreamweaver MX & C# (also for Sybex Books) and HTML, XHTML, and CSS Bible, 3rd Edition for Wiley, for which he is co-author with Steve Schafer. Chuck is currently working with the XSL Team at eBay as a project consultant and Web engineer.

Summary:  In this third tutorial in a multi-part series on the benefits of using XSLT, the MindMap Team discovers the need to perform some analyses that require procedural techniques. Because XSLT is not a procedural language, this tutorial explains how to layer and use chain transformations to get around some of the limitations this structure provides. The tutorial demonstrates how to use named templates to mimic side effects, and how external documents are layered together to interoperate.

View more content in this series

Date:  16 Mar 2004
Level:  Intermediate PDF:  A4 and Letter (196 KB | 28 pages)Get Adobe® Reader®

Activity:  3147 views
Comments:  

Summary

XSLT: Limited only by your imagination

The display.xsl stylesheet is the glue that manages the entire process of accepting and returning parameter values. However, its success is directly dependent on a series of other files that have dependencies on one another. So far, the first three tutorials in this series have focused on a key concept central to advanced XSLT processing -- something the MindMap team refers to as cascading parameters. You were introduced to this concept in the first two tutorials, but in this one the application is more robust and ideally demonstrates that their use is limited only by your imagination.

Overall, the concept of layering multiple documents demonstrates that you can create very dynamic applications that strongly mimic the functionality of procedural programming. This can result in everything from calculators to chess games, as well as comprehensive Web applications that involve high-level processing. This doesn't mean that XSLT is a replacement for back-end and application server logic that involves databases and the business logic used by such environments as J2EE to work with them. In fact, it's always better to do as much logic as you can in the back end before processing XSLT on the presentation layer. But often, developers make the mistake of assuming XSLT can't do something, so they turn to JavaScript, which can result in unwieldy spaghetti code that takes days to reengineer when problems surface. Sometimes in XSLT, the answers to some simple logic questions are looking right at you. You just need to know where to turn, and the place to turn is very nearly always parameters and named templates.


Layering XSLT stylesheets summary

The MindMap team's interactive journey with XSLT began, as seen in the first tutorial in this series, with the team's earliest exposure to XSLT a few years ago. Then, the team, like most developers learning about a language, gingerly stepped forward, beginning with some basic string manipulation patterns and moving on to template manipulation. This led to the world of interactive forms in the second tutorial, which allowed them to create dynamic applications designed for the analysis and review of information.

Now, in this tutorial, they've taken the concept of cascading parameters seen in the second tutorial a step further, by creating an application that relies heavily on passing parameter values to such an extent that it actually seems as though the parameter values aren't static. If you look closely at display.xsl, you'll also see how CSS styles are managed by variables that also seemingly change values. Of course, because XSLT has only static values for variables and parameters, this is all an illusion. A magic act of sorts.

In the next tutorial in the series, the MindMap team is going to take some of the data they've gathered and create a 3D representation of it using an XSLT stylesheet.

8 of 11 | Previous | Next

Comments



Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=XML
ArticleID=138322
TutorialTitle=Analyze with XSLT, Part 3: Layering XSLT stylesheets
publish-date=03162004
author1-email=chuck@tumeric.net
author1-email-cc=dwxed@us.ibm.com

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.