Compile a stylesheet.
Note: the term "compile" here indicates that the stylesheet is converted into an executable form. There is no implication that this involves code generation.
The source argument identifies the XML document holding the principal stylesheet module. Other modules will be located relative to this module by resolving against the base URI that is defined as the systemId property of the supplied Source.
The following kinds of {@link javax.xml.transform.Source} are recognized:
- {@link javax.xml.transform.stream.StreamSource}, allowing the stylesheet to be supplied as a URI, as a {@link java.io.File}, as an {@link java.io.InputStream}, or as a {@link java.io.Reader}
- {@link javax.xml.transform.sax.SAXSource}, allowing the stylesheet to be supplied as a stream of SAX events from a SAX2-compliant XML parser (or any other source of SAX events)
- {@link javax.xml.transform.dom.DOMSource}, allowing the stylesheet to be supplied as a DOM tree. This option is available only if saxon9-dom.jar is on the classpath.
- Document wrappers for XOM, JDOM, or DOM4J trees, provided the appropriate support libraries are on the classpath
- A Saxon NodeInfo, representing the root of a tree in any of the native tree formats supported by Saxon
- An {@link XdmNode} representing the document node of the stylesheet module
@param source Source object representing the principal stylesheet module to be compiled
@return an XsltExecutable, which represents the compiled stylesheet.
@throws SaxonApiException if the stylesheet contains static errors or if it cannot be read. Note thatthe exception that is thrown will
not contain details of the actual errors found in the stylesheet. These will instead be notified to the registered ErrorListener. The default ErrorListener displays error messages on the standard error output.