Apache Xalan Tools

Apache Xalan is a popular open-source XSLT processing component developed by the Apache XML Foundation. Stylus Studio®'s XSLT tools provide seamless integration with the Xalan XSLT Processor, enabling you to execute, debug, and optimize your XSLT stylesheets using the Xalan XSLT processor. No additional downloads are necessary — when you download Stylus Studio, you get out-of-the-box support for the latest version of Apache Xalan-J — it's that easy! The following tutorial provides an overview of some of many features and functions in Stylus Studio that are geared towards accelerating development of Xalan applications.

XSLT Editor (click to enlarge XSLT Editor)

Xalan XSLT Support

Stylus Studio® is the only XML IDE to provide comprehensive support for building Xalan applications — Other XML tools rely on proprietary XML processing technologies. Developers that are serious about XSLT standards compliance can stick to using proven Apache Xalan technologies directly from within the Stylus Studio XML IDE. The key advantage of using the same XSLT processor in both your development and production environment is that you avoid potentially dangerous complications that arise due to propretary implementations and stylesheet formats. To enable Xalan in Stylus Studio's XSLT tools, click "File" -> "New" -> XSLT: (Text Editor). Then, in the Scenario Properties menu, select the Processor Tab, and select "Xalan-J 2.5.2" from the combo box, as illustrated here:

Using Apache Xalan

Xalan Error Handling and Troubleshooting

Now that you've selected Xalan as your default XSLT processor, create an XSLT stylesheet (or open one of the .XSL example files included with the default project. Notice when you click on the "Execute" button (the green arrow — or simply hit the F5 key), Stylus Studio is using Xalan to process your stylesheet — the output is displayed in a preview window. You can do anything that is supported in Xalan, running external Java extension functions or even EXSLT. Stylus Studio provides integrated backmapping which is a convenient way to troubleshoot Xalan applications — when you click on the output, Stylus Studio highlights the region of XSL code that was responsible for generating that output, as illustrated here:

Handling of Xalan Errors

Debugging Using Apache Xalan

Integrated support for Xalan Debugging in Stylus Studio means that it's easy to re-produce, isolate, and then eliminate unwanted stylesheet bugs. Other XML tools provide limited XSL debugging suppor and are based on their own proprietary implementations. By contrast, debugging using Xalan and Stylus Studio is seamless, powerful and simple. Just set your breakpoints (by typing the F9 key), then start debugging. All of the information regarding processor state, including variables, call-stack, watches, (etc.) are all from the latest Apache Xalan processor included with Stylus Studio, as illustrated here:

Debugging XSLT using Xalan

Benchmarking Xalan Performance

Serious XSL applications demand the highest speed — Stylus Studio can help you write faster Xalan stylesheets by providing integrated Xalan benchmarking tools which analyzes Xalan's the execution of an XSL stylesheet and produces a detailed node-by-node trace report, allowing you to identify performance bottlenecks and eliminate them. To enable XSL profiling options using Xalan, go to the XSL scenario properties dialog box, choose your profiling options, click OK, then run the stylesheet again. The detailed performance profile report will be available for viewing in the output window.

Xalan Performance

Extending Xalan To Access Non-XML Data

Xalan is widely used to do various XML transformations, for example, XML-to-XML, XML to HTML, etc. But what happens if you data isn't conveniently available in an XML format? Stylus Studio XML Converters are high-performance Java components that seamlessly stream any legacy data format (for example EDI, X12, CSV, TSV, text, binary data, etc.) into an XML format on the fly so that you can access the data as though it were XML using Apache Xalan! Using DataDirect XML Converters involves a two-step process:

  1. Converting the legacy data into an XML format using one of thousands of pre-built XML converters, or designing your own converter using Convert to XML, a powerful tool for converting any data into XML.
  2. Write your XSL stylesheet as you would normally - to access the non-XML data, use the standard XSL document function, for example: xsl:value-of select="document ('adapter:myconversion.conv').
  3. Use the Java code generator to generate the Java code required to invoke the Stylus Studio XML Deployment Adapter components along with Apache Xalan.

Together, DataDirect XML Converters provide a standards-based way to extend the Apache Xalan processor to access using

Using Java and Xalan

Once you've developed, debugged and benchmarked your stylesheet application, it's easy to generate the Java code required to run your Xalan application with just one mouse click. Select XSLT -> Generate Java Code. The generated code employs standard JAXP code for invoking your stylesheet from a Java application, and you can further customize using an integrated Java IDE. The process is illustrated here:

Xalan Java

Stylus Studio®'s XSLT Editor is the world's first and most comprehensive XSL development environment for building advanced XSLT stylesheet applications which employ the Xalan parser.


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Try Stylus Xalan Tools

Download a free trial of our award-winning development tools for Xalan-J today!

Learn XQuery in 10 Minutes!

Say goodbye to 10-minute abs, and say Hello to "Learn XQuery in Ten Minutes!", the world's fastest and easiest XQuery primer, now available for free!

Why Pay More for XML Tools?

With Stylus Studio® X16 XML Enterprise Suite, you get the most comprehensive XML tool suite at one incredibly low price. Value: it's just one of many reasons why smart XML developers are choosing Stylus Studio!

An Introduction to XSLT

A new 5 minute online video tutorial entitled: Editing XSL Stylesheets covers how to use Apache Xalan and Stylus Studio together to simplify XSLT stylesheet development.

Free Stylus Studio XML Training:
W3C Member