net.sf.saxon
public class PreparedStylesheet extends Object implements Templates, Serializable
Constructor Summary | |
---|---|
protected | PreparedStylesheet(Configuration config, CompilerInfo info)
Constructor - deliberately protected
|
Method Summary | |
---|---|
static PreparedStylesheet | compile(Source source, Configuration config, CompilerInfo info)
Factory method to make a PreparedStylesheet |
void | explain(ExpressionPresenter presenter)
Produce an XML representation of the compiled and optimized stylesheet |
static Source | getAssociatedStylesheet(Configuration config, Source source, String media, String title, String charset)
Get the stylesheet specification(s) associated
via the xml-stylesheet processing instruction (see
http://www.w3.org/TR/xml-stylesheet/) with the document
document specified in the source parameter, and that match
the given criteria. |
PreparedStylesheet | getCachedStylesheet(String href, String baseURI)
Get a "next in chain" stylesheet. |
CompilerInfo | getCompilerInfo()
Get the CompilerInfo containing details of XSLT compilation options |
Configuration | getConfiguration()
Get the configuration in which this stylesheet is compiled |
DecimalFormatManager | getDecimalFormatManager()
Get the DecimalFormatManager which handles decimal-format definitions
|
int | getErrorCount()
Get the number of errors reported so far
|
Executable | getExecutable()
Get the associated executable
|
Properties | getOutputProperties()
Get the properties for xsl:output. |
StyleNodeFactory | getStyleNodeFactory()
Get the StyleNodeFactory in use. |
NamePool | getTargetNamePool()
Get the name pool in use. |
boolean | isCompileWithTracing()
Determine whether trace hooks are included in the compiled code. |
DocumentImpl | loadStylesheetModule(Source styleSource, StyleNodeFactory nodeFactory)
Build the tree representation of a stylesheet module
|
Transformer | newTransformer()
Make a Transformer from this Templates object.
|
protected void | prepare(Source styleSource)
Prepare a stylesheet from a Source document
|
void | putCachedStylesheet(String href, String baseURI, PreparedStylesheet pss)
Save a "next in chain" stylesheet in compiled form, so that it can be reused repeatedly.
|
void | reportError(TransformerException err)
Report a compile time error. |
void | reportWarning(TransformerException err)
Report a compile time warning. |
void | setConfiguration(Configuration config)
Set the configuration in which this stylesheet is compiled.
|
void | setDecimalFormatManager(DecimalFormatManager dfm)
Set the DecimalFormatManager which handles decimal-format definitions
|
protected void | setStylesheetDocument(DocumentImpl doc, StyleNodeFactory snFactory)
Create a PreparedStylesheet from a supplied DocumentInfo
Note: the document must have been built using the StyleNodeFactory
|
void | setTargetNamePool(NamePool pool)
Set the name pool |
Parameters: config The Configuration set up by the TransformerFactory info Compilation options
Parameters: source the source of this principal stylesheet module config the Saxon configuration info compile-time options for this stylesheet compilation
Returns: the prepared stylesheet
Parameters: presenter defines the destination and format of the output
Parameters: config The Saxon Configuration source The XML source document. media The media attribute to be matched. May be null, in which case the prefered templates will be used (i.e. alternate = no). title The value of the title attribute to match. May be null. charset The value of the charset attribute to match. May be null.
Returns: A Source object suitable for passing to the TransformerFactory.
Throws: TransformerConfigurationException if any problems occur
Parameters: href the relative URI of the next-in-chain stylesheet baseURI the baseURI against which this relativeURI is to be resolved
Returns: the cached stylesheet if present in the cache, or null if not
Returns: the CompilerInfo containing compilation options
Since: 9.2
Returns: the configuration in which this stylesheet is compiled
Returns: the DecimalFormatManager containing the named xsl:decimal-format definitions
Returns: the number of errors reported
Returns: the Executable for this stylesheet
In Saxon, the properties object is a new, empty, Properties object that is backed by the live properties to supply default values for missing properties. This means that the property values must be read using the getProperty() method. Calling the get() method on the underlying Hashtable will return null.
In Saxon 8.x, this method gets the output properties for the unnamed output format in the stylesheet.
Returns: A Properties object reflecting the output properties defined for the default (unnamed) output format in the stylesheet. It may be mutated and supplied to the setOutputProperties() method of the Transformer, without affecting other transformations that use the same stylesheet.
See Also: javax.xml.transform.Transformer#setOutputProperties
Returns: the StyleNodeFactory
Returns: the name pool in use
Returns: true if trace hooks are included, false if not.
Since: 8.9
Parameters: styleSource the source of the module nodeFactory the StyleNodeFactory used for creating element nodes in the tree
Returns: the root Document node of the tree containing the stylesheet module
Throws: XPathException if XML parsing or tree construction fails
Returns: the new Transformer (always a Controller)
See Also: Controller
Parameters: styleSource the source document containing the stylesheet
Throws: TransformerConfigurationException if compilation of the stylesheet fails for any reason
Parameters: href the relative URI of the stylesheet baseURI the base URI against which the relative URI is resolved pss the prepared stylesheet object to be cached
Parameters: err the exception containing details of the error
Throws: TransformerException if the ErrorListener decides that the error should be reported
Parameters: err an exception holding details of the warning condition to be reported
Parameters: config the configuration to be used.
Parameters: dfm the DecimalFormatManager containing the named xsl:decimal-format definitions
Parameters: doc the document containing the stylesheet module snFactory the StyleNodeFactory used to build the tree
Throws: XPathException if the document supplied is not a stylesheet
Parameters: pool the name pool