|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.saxon.PreparedStylesheet
This PreparedStylesheet class represents a Stylesheet that has been prepared for execution (or "compiled").
Constructor Summary | |
protected |
PreparedStylesheet(Configuration config,
CompilerInfo info)
Constructor: deliberately protected |
Method Summary | |
PreparedStylesheet |
getCachedStylesheet(java.lang.String href,
java.lang.String baseURI)
Get a "next in chain" stylesheet |
Configuration |
getConfiguration()
|
int |
getErrorCount()
Get the number of errors reported so far |
javax.xml.transform.ErrorListener |
getErrorListener()
|
Executable |
getExecutable()
Get the associated executable |
java.util.Properties |
getOutputProperties()
Get the properties for xsl:output. |
StyleNodeFactory |
getStyleNodeFactory()
Get the StyleNodeFactory in use. |
NamePool |
getTargetNamePool()
Get the name pool in use. |
javax.xml.transform.URIResolver |
getURIResolver()
|
static PreparedStylesheet |
loadCompiledStylesheet(Configuration config,
java.io.ObjectInputStream ois)
Load a PreparedStylesheet from a compiled stylesheet stored in a file. |
static PreparedStylesheet |
loadCompiledStylesheet(Configuration config,
java.lang.String fileName)
Load a PreparedStylesheet from a compiled stylesheet stored in a file. |
static DocumentImpl |
loadStylesheetModule(javax.xml.transform.Source styleSource,
Configuration config,
NamePool localNamePool,
StyleNodeFactory nodeFactory)
Build the tree representation of a stylesheet module |
javax.xml.transform.Transformer |
newTransformer()
Make a Transformer from this Templates object. |
protected void |
prepare(javax.xml.transform.Source styleSource)
Prepare a stylesheet from a Source document |
void |
putCachedStylesheet(java.lang.String href,
java.lang.String baseURI,
PreparedStylesheet pss)
|
void |
reportError(javax.xml.transform.TransformerException err)
Report a compile time error. |
void |
reportWarning(javax.xml.transform.TransformerException err)
Report a compile time warning. |
void |
setConfiguration(Configuration config)
|
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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected PreparedStylesheet(Configuration config, CompilerInfo info)
config
- The Configuration set up by the TransformerFactoryMethod Detail |
public javax.xml.transform.Transformer newTransformer()
newTransformer
in interface javax.xml.transform.Templates
Controller
public void setConfiguration(Configuration config)
public Configuration getConfiguration()
public void setTargetNamePool(NamePool pool)
public NamePool getTargetNamePool()
public StyleNodeFactory getStyleNodeFactory()
protected void prepare(javax.xml.transform.Source styleSource) throws javax.xml.transform.TransformerConfigurationException
styleSource
- the source document containing the stylesheet
javax.xml.transform.TransformerConfigurationException
- if compilation of the
stylesheet fails for any reasonpublic static DocumentImpl loadStylesheetModule(javax.xml.transform.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, java.lang.String fileName) throws java.io.IOException, java.lang.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).
java.io.IOException
java.lang.ClassNotFoundException
public static PreparedStylesheet loadCompiledStylesheet(Configuration config, java.io.ObjectInputStream ois) throws java.io.IOException, java.lang.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).
java.io.IOException
java.lang.ClassNotFoundException
protected void setStylesheetDocument(DocumentImpl doc, StyleNodeFactory snFactory) throws XPathException
doc
- the document containing the stylesheet modulesnFactory
- the StyleNodeFactory used to build the tree
XPathException
- if the document supplied
is not a stylesheetpublic Executable getExecutable()
public java.util.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 javax.xml.transform.Templates
Transformer.setOutputProperties(java.util.Properties)
public void reportError(javax.xml.transform.TransformerException err) throws javax.xml.transform.TransformerException
err
- the exception containing details of the error
javax.xml.transform.TransformerException
- if the ErrorListener decides that the
error should be reportedpublic int getErrorCount()
public void reportWarning(javax.xml.transform.TransformerException err)
err
- an exception holding details of the warning condition to be
reportedpublic PreparedStylesheet getCachedStylesheet(java.lang.String href, java.lang.String baseURI)
public void putCachedStylesheet(java.lang.String href, java.lang.String baseURI, PreparedStylesheet pss)
public javax.xml.transform.URIResolver getURIResolver()
public javax.xml.transform.ErrorListener getErrorListener()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |