Xalan-Java fully implements XSL Transformations (XSLT) Version 1.0 and the XML Path Language (XPath) Version 1.0. 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 stylesheets are written in the XSLT language. An XSL stylesheet contains instructions for transforming XML documents into XML, HTML, XHTML or plain text. 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).
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 Xerces-Java, but it may be configured with system properties to work with other XML parsers (see Plugging in a Transformer and XML parser). The input may be submitted in the form of a stream of XML markup (from a URI, a character or byte stream, or another transformation), a SAX InputStream, or a DOM Node.
Xalan-Java performs the transformations specified in the XSL stylesheet and packages a sequence of SAX events that may be serialized to an output stream or writer, used to build a DOM tree, or forwarded as input to another transformation.
For instructions and some suggestions about how to get started using the XSLT Interpretive processor, see Getting Started with Interpretive Processing.
For instructions and some suggestions about how to get started using the XSLT Compiling processor, see Getting Started with XSLTC.
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:
When you come across other useful introductory or background materials, please email Xalan Development Mailing List, so we can add them to this list.
For more definitions of XSLT terminology, see Dave Pawson's XSLT Terminology Clarification and the Glossary in Michael Kay's XSLT Programmer's Reference.