<?xml version="1.0" encoding="iso-8859-1"?> <?xml-stylesheet href="../../make-menu.xsl" type="text/xsl"?><html> <head> <this-is section="extensions" page="output-extras" subpage="method"/> <!-- Generated at 2011-12-09T20:47:22.916Z--><title>Saxonica: XSLT and XQuery Processing: The method attribute</title> <meta name="coverage" content="Worldwide"/> <meta name="copyright" content="Copyright Saxonica Ltd"/> <meta name="title" content="Saxonica: XSLT and XQuery Processing: The method attribute"/> <meta name="robots" content="noindex,nofollow"/> <link rel="stylesheet" href="../../saxondocs.css" type="text/css"/> </head> <body class="main"> <h1>The method attribute</h1> <p>The <code>method</code> attribute of <code>xsl:output</code> can take the standard values "xml", "html", "xhtml", or "text", or a <i>QName</i>.</p> <p>If a QName in the Saxon namespace is specified, the name must be one of Saxon serialization methods supported in Saxon-PE and Saxon-EE. These are:</p> <table> <tr> <td content="para"> <p>saxon:base64Binary</p> </td> <td content="para"> <p> <a class="bodylink" href="../../extensions/output-extras/base64Binary-method.xml">The saxon:base64Binary serialization method</a> </p> </td> </tr> <tr> <td content="para"> <p>saxon:hexBinary</p> </td> <td content="para"> <p> <a class="bodylink" href="../../extensions/output-extras/hexBinary-method.xml">The saxon:hexBinary serialization method</a> </p> </td> </tr> <tr> <td content="para"> <p>saxon:ptree</p> </td> <td content="para"> <p> <a class="bodylink" href="../../extensions/output-extras/ptree-method.xml">The saxon:ptree serialization method</a> </p> </td> </tr> <tr> <td content="para"> <p>saxon:xquery</p> </td> <td content="para"> <p> <a class="bodylink" href="../../extensions/output-extras/xquery-method.xml">The saxon:xquery serialization method</a> </p> </td> </tr> </table> <p>If a QName is specified, the local name must be the fully-qualified class name of a class that implements either the SAX2 <code>org.xml.sax.ContentHandler</code> interface, or the <code>net.sf.saxon.event.Receiver</code> 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 <code>xsl:output</code> element.</p> <p> The prefix of the <i>QName</i> must correspond to a valid namespace URI. It is recommended to use the Saxon URI "http://saxon.sf.net/", but this is not enforced.</p> <p>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.</p> <div class="boxed" style="border: solid thin; background-color: #B1CCC7; padding: 2px">As an alternative to specifying your own output method, you can customize Saxon's serialization pipeline. There is a Saxon class <code>net.sf.saxon.event.SerializationFactory</code> that constructs the pipeline, from individual components that perform the various stages of serialization. You can define your own subclass of <code>net.sf.saxon.event.SerializationFactory</code>, and register this using the method <code>setSerializationFactory()</code> on the <code>Configuration</code> 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.</div> <table width="100%"> <tr> <td> <p align="right"><a class="nav" href="base64Binary-method.xml">Next</a></p> </td> </tr> </table> </body> </html>