|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.PreparedStylesheet
public class PreparedStylesheet
This PreparedStylesheet class represents a Stylesheet that has been prepared for execution (or "compiled").
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 |
PreparedStylesheet |
getCachedStylesheet(String href,
String baseURI)
Get a "next in chain" stylesheet. |
Configuration |
getConfiguration()
Get the configuration in which this stylesheet is compiled |
int |
getErrorCount()
Get the number of errors reported so far |
ErrorListener |
getErrorListener()
Get the ErrorListener used at compile time for reporting static errors in the stylesheet |
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. |
URIResolver |
getURIResolver()
Get the URIResolver used at compile time for resolving URIs in xsl:include and xsl:import |
boolean |
isCompileWithTracing()
Determine whether trace hooks are included in the compiled code. |
static PreparedStylesheet |
loadCompiledStylesheet(Configuration config,
ObjectInputStream ois)
Load a PreparedStylesheet from a compiled stylesheet stored in a file. |
static PreparedStylesheet |
loadCompiledStylesheet(Configuration config,
String fileName)
Load a PreparedStylesheet from a compiled stylesheet stored in a file. |
static DocumentImpl |
loadStylesheetModule(Source styleSource,
Configuration config,
NamePool localNamePool,
StyleNodeFactory nodeFactory)
Build the tree representation of a stylesheet module |
Transformer |
newTransformer()
Make a Transformer from this Templates object. |
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 |
setTargetNamePool(NamePool pool)
Set the name pool |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static PreparedStylesheet compile(Source source, Configuration config, CompilerInfo info) throws TransformerConfigurationException
source
- the source of this principal stylesheet moduleconfig
- the Saxon configurationinfo
- compile-time options for this stylesheet compilation
TransformerConfigurationException
public Transformer newTransformer()
newTransformer
in interface Templates
Controller
public void setConfiguration(Configuration config)
config
- the configuration to be used.public Configuration getConfiguration()
public void setTargetNamePool(NamePool pool)
pool
- the name poolpublic NamePool getTargetNamePool()
public StyleNodeFactory getStyleNodeFactory()
public static DocumentImpl loadStylesheetModule(Source styleSource, Configuration config, NamePool localNamePool, StyleNodeFactory nodeFactory) throws XPathException
styleSource
- the source of the moduleconfig
- the Configuration of the transformation factorylocalNamePool
- the namepool used during compilationnodeFactory
- the StyleNodeFactory used for creating
element nodes in the tree
XPathException
- if XML parsing or tree
construction failspublic static PreparedStylesheet loadCompiledStylesheet(Configuration config, String fileName) throws IOException, ClassNotFoundException
config
- The Configuration. This method changes the NamePool used by this configuration
to be the NamePool that was stored with the compiled stylesheet. The method must therefore not
be used in a multi-threaded environment where the Configuration (and NamePool) are shared between
multiple concurrent transformations.fileName
- The name of the file containing the compiled stylesheet (which is just the Java serialization
of a PreparedStylesheet object).
IOException
ClassNotFoundException
public static PreparedStylesheet loadCompiledStylesheet(Configuration config, ObjectInputStream ois) throws IOException, ClassNotFoundException
config
- The Configuration. This method changes the NamePool used by this configuration
to be the NamePool that was stored with the compiled stylesheet. The method must therefore not
be used in a multi-threaded environment where the Configuration (and NamePool) are shared between
multiple concurrent transformations.ois
- The ObjectInputStream containing the compiled stylesheet (which is just the Java serialization
of a PreparedStylesheet object).
IOException
ClassNotFoundException
public Executable getExecutable()
public boolean isCompileWithTracing()
public Properties getOutputProperties()
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.
getOutputProperties
in interface Templates
Transformer.setOutputProperties(java.util.Properties)
public void reportError(TransformerException err) throws TransformerException
err
- the exception containing details of the error
TransformerException
- if the ErrorListener decides that the
error should be reportedpublic int getErrorCount()
public void reportWarning(TransformerException err)
err
- an exception holding details of the warning condition to be
reportedpublic PreparedStylesheet getCachedStylesheet(String href, String baseURI)
href
- the relative URI of the next-in-chain stylesheetbaseURI
- the baseURI against which this relativeURI is to be resolved
public void putCachedStylesheet(String href, String baseURI, PreparedStylesheet pss)
href
- the relative URI of the stylesheetbaseURI
- the base URI against which the relative URI is resolvedpss
- the prepared stylesheet object to be cachedpublic URIResolver getURIResolver()
public ErrorListener getErrorListener()
public void explain(ExpressionPresenter presenter)
presenter
- defines the destination and format of the output
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |