An XSLT Editor Tool - Examples

May 6, 2002 -- Example of how to use the XsltEditor. First select the download page and then follow the instructions for download, installation, and execution of the XSLT Editor tool.

After the application starts, a license dialog will appear. Read the terms of the license. If you agree, click the "Agree" button. If you don't agree to terms of the license, select "Decline" and the application will terminate.

Select File on the menubar and select "Open XML URL". Enter the following when the "Enter URL" dialog appears, enter the following URL::

http://www.raben.com/articles/XsltEditor/request.xml

You do not need to enter a username or password.

Next select File on the menubar and select "Open XSLT URL". Enter the following when the "Enter URL" dialog appears, enter the following URL:

http://www.raben.com/articles/XsltEditor/request2sql.xsl

Then press the "Transform" button.

The "Result" editor pane will be selected, and you should see the following:


The XML file is extremely simple. There is just one element, called "SpaceWeatherRequest", with a number of attributes. The XSLT script matches the element "SpaceWeatherRequest", outputs the "sql" tag and then substitutes values for various attributes. The attributes are selected by the "xsl:value-of" element. The "select" statement identifies which attribute to display. A detailed explanation of XML and XSLT is beyond the scope of this article. A references which I have found to be extremely useful is:

Michael Kay, XSLT Programmers Reference, Wrox Press, 2000.

The following example is a bit more interesting. Once again select "File" on the menubar and then "Open XML URL". When the "Enter URL" dialog box appears, enter the following URL:

http://www.raben.com/articles/XsltEditor/region_1day.xml

Next select File on the menubar and select "Open XSLT URL". Enter the following when the "Enter URL" dialog appears, enter the following URL:

http://www.raben.com/articles/XsltEditor/region2Html.xsl

When you press the "transform" button, you will see an html table listing the current active regions on the Sun and additional information such as the region location, size, number of sunspots, and its magnetic classification. If you examine the XSLT file you will note that near the top, is a statement containing
<xsl:output method="html" />. This is recognized by the tool and it displays the transformed file as html. If you want to examine the html it produces, set output method="text".

Article Index Back to XSLT Transformations Next Undo, Redo, Cut, and Paste