Clicky

ChrisEllsworth.com

The online home of Christopher Chess Ellsworth
Welcome to ChrisEllsworth.com Sign in | Join | Help
in Search

Chris's Development Blog

Tutorials and thoughts on software development.

A Simple XSLT Tutorial

XSLT allows you to transform one XML document type to another. For instance, you may have a XML document containing your hours logs for different projects:

XML Hours Log
         
<HoursLog>
    <Entry>
        <ProjectName>My XML Project</ProjectName>
        <Date>10/3/2003</Date>
        <StartTime>10:00pm</StartTime>
        <StopTime>4:00am</StopTime>
        <Duration>6</Duration>
        <Comments>Made new XSLT sheet for translating XML into HTML.</Comments>
    </Entry>
    <Entry>
        <ProjectName>My XML Project</ProjectName>
        <Date>15/3/2003</Date>
        <StartTime>8:00pm</StartTime>
        <StopTime>12:00am</StopTime>
        <Duration>4</Duration>
        <Comments>Made new XSLT sheet for translating XML into a SVG Image.</Comments>
    </Entry>
</HoursLog>


Using an XSLT processor and a XSLT stylesheet, you can transform this dataset into a html document or even an image bar chart. The XSLT processor works as follows: it takes as input a XML document to transform, the XSLT stylesheet defining the transformation, and produces a new XML document.


Detailed Example

A detailed "Hello World" style example may be downloaded to get you started with this useful technology. The download contains everything you need to get started, including the Xalan XSLT Processor for Java (Yes, you can use Xalan from inside your Java programs, cool!). 


Download the example:  XSLT_Tutorial.zip

 

 

Published Monday, January 24, 2005 7:30 PM by Christopher Chess Ellsworth
Filed under: , ,

Attachment(s): http://www.cs.appstate.edu/~cce/downloads/XSLT_Tutorial.zip

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
(optional)
(required) 
Submit

Locations of Visitors

Locations of visitors to this page
©2007 Christopher Chess Ellsworth