Xalan-Java Overview

Introduction Xalan-Java Features Getting to work with Xalan-Java Getting up to speed with XSLT Glossary
| Introduction |
| Xalan-Java (named after a rare musical instrument) fully implements the and the . XSLT is the first part of the XSL stylesheet language for XML. It includes the XSL Transformation vocabulary and XPath, a language for addressing parts of XML documents. For links to background materials, discussion groups, frequently asked questions, and tutorials on XSLT, see Getting up to speed with XSLT.
| XSL also includes a vocabulary for formatting documents, which is still under design and is not part of Xalan-Java. For more information, see W3C XSL Working Draft and the Apache XML FOP (Formatting Objects Project).
You use the XSLT language to compose XSL stylesheets. An XSL stylesheet contains instructions for transforming XML documents from one document type into another document type (XML, HTML, or other). In structural terms, an XSL stylesheet specifies the transformation of one tree of nodes (the XML input) into another tree of nodes (the output or transformation result).
| The XSL stylesheet may generate and refer to cascading style sheets (CSS) as part of its output.
In the following example, the foo.xsl stylesheet is used to transform foo.xml into foo.out: foo.xml:
    <?xml version="1.0"?>
    <doc>Hello</doc>
foo.xsl:
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:template match="doc">
    <out><xsl:value-of select="."/></out>
    </xsl:template>
    </xsl:stylesheet>
foo.out:
    <out>Hello</out>
By default, Xalan-Java uses a high-performance Document Table Model (DTM) to parse XML documents and XSL stylesheets. It can be set to use the Xerces-Java XML parser, and it can be adapted to work with other DOM-producing mechanisms and SAX document handlers. The input may appear in the form of a file, a character stream, a byte stream, a DOM, or a SAX input stream. Xalan-Java performs the transformations specified in the XSL stylesheet and produces a document file, a character stream, a byte stream, a DOM, or a series of SAX events, as you specify when you set up the transformation.
| Xalan-Java Features |
| Implements the Incorporates the May be run through the interfaces Interfaces directly to the Xerces-Java XML parser Can interface to a SAX document handler or to any XML parser that produces Java DOM Trees Can output to SAX or DOM May be run from the command line for convenient file-to-file transformations Includes an applet wrapper May be used in a servlet to transform XML documents into HTML and serve the results to clients Supports Java and scripting language extensions Provides a growing number of proprietary extension elements and functions
| Getting to work with Xalan-Java |
| For instructions and some suggestions about how to get started using Xalan-Java, see Getting Started.
| Getting up to speed with XSLT |
| If you are still working through the details of the XSLT spec (the W3C 1.0 Recommendation), you may want to consult one or more of the following: Michael Kay's XSLT Programmer's Reference, Wrox Press, 2000 Neil Bradley's XSL Companion, Addison-Wesley, 2000 Elliotte Rusty Harold's Chapter 14 of the XML Bible: XSL Transformations Crane Softwright's Free preview of Practical Transformation Using XSLT and XPath The Mulberry XSL-List -- Open Forum on XSL (of interest to XSL users at all levels) Dave Pawson's XSL Frequently Asked Questions Objects by Design's Transforming XMI to HTML (oriented towards XMI, "an XML-based, stream representation of a UML model," but also covers "generic" XML transformations) Nic Miloslav's XSL Tutorial OASIS (the Organization for the Advancement of Structured Information Standards): Extensible Stylesheet Language (XSL) by Robin Cover Donald Ball's A Guide to XML and XSL for Designers XSLT - XSL Transformations in The XML Revolution: Technologies for the future Web by Anders Møller and Michael I. Schwartzbach When you come across other useful introductory or background materials, please email Don Leslie, so he can add them to this list.
| Glossary |
| XSLT Namespace The XML namespace for XSLT. An XML namespace is a collection of element and attribute names, identified by a Unique Resource Identifier (URI), which often takes the form of a URL, but is really just a unique string, not a pointer to a web page. The XSLT namespace URI is http://www.w3.org/1999/XSL/Transform. In each XSLT stylesheet, you must declare this namespace in the stylesheet element tag and bind it to a local prefix. Like the XSLT specification, we always use xsl as the XSLT namespace prefix in our descriptions and examples, although you are free to bind any prefix to this namespace. XSL Instruction Any tag associated with the XSLT namespace. Template An element, usually with child elements, that specifies a "rule" or set of instructions to perform when a particular kind of node is encountered in the source tree. XSL Template Instruction Any tag that occurs inside an xsl:template element and is associated with the XSLT namespace. Source Tree The XML tree input to the XSL process. Result Tree The tree that is output by the XSL process. Stylesheet Tree The stylesheet tree produced from the XSL file. Match Pattern The part of a template that defines the kind(s) of nodes to which the template applies. For more definitions of XSLT terminology, see Dave Pawson's XSLT Terminology Clarification and the Glossary in Michael Kay's XSLT Programmer's Reference.

Copyright © 2000 The Apache Software Foundation. All Rights Reserved.