SAXONICA

Saxon Documentation
Full Contents
About Saxon
Changes in this Release
Conditions of Use
Using XSLT 2.0
Using XQuery
Handling Source Documents
XML Schema Processing
XPath API for Java
Saxon on .NET
Extensibility
Saxon Extensions
| Introduction
| EXSLT Extensions
| Extension attributes (XSLT only)
» | Additional serialization parameters
| Extension functions
| Extension instructions
Sample Saxon Applications
The Saxon SQL Extension
XSLT Elements
XPath 2.0 Expression Syntax
Function Library
Standards Conformance

# The method attribute

The `method` attribute of `xsl:output` can take the standard values "xml", "html", "xhtml", or "text", or a QName.

If a QName is specified, the local name must be the fully-qualified class name of a class that implements either the SAX2 `org.xml.sax.ContentHandler` interface, or the `net.sf.saxon.event.Receiver` interface. If such a value is specified, output is directed to a newly-created instance of the user-supplied class. You can pass additional information to this class by means of extra user-defined attributes on the `xsl:output` element.

The prefix of the QName must correspond to a valid namespace URI. It is recommended to use the Saxon URI "http://saxon.sf.net/", but this is not enforced.

When output is sent to a user-specified ContentHandler or Receiver, other serialization options (for example indentation, addition of meta elements in HTML, and generation of a DOCTYPE declaration) have no effect.

As an alternative to specifying your own output method, you can customize Saxon's serialization pipeline. There is a Saxon class `net.sf.saxon.event.SerializationFactory` that constructs the pipeline, from individual components that perform the various stages of serialization. You can define your own subclass of `net.sf.saxon.event.SerializationFactory`, and register this using the method `setSerializationFactory()` on the `Configuration` object. This allows you to insert your own steps into the pipeline, or to override any of the standard pipeline components with classes of your own.

Next