Saxonica.com

The method attribute

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

The QName saxon:xquery refers to Saxon's XQuery serialization method: see The saxon:xquery serialization method.

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