|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--javax.xml.transform.Transformer
|
+--net.sf.saxon.Controller
Controller processes an XML file, calling registered node handlers when appropriate to process its elements, character content, and attributes. This is Saxon's implementation of the JAXP Transformer class
| Constructor Summary | |
Controller(Configuration config)
Create a Controller and initialise variables. |
|
| Method Summary | |
void |
addTraceListener(TraceListener trace)
Adds the specified trace listener to receive trace events from this instance. |
void |
clearDocumentPool()
Clear the document pool. |
void |
clearParameters()
Reset the parameters to a null list. |
void |
defineGlobalParameters(Bindery bindery)
|
Bindery |
getBindery()
Get the current bindery. |
Configuration |
getConfiguration()
|
java.util.GregorianCalendar |
getCurrentDateTime()
Get the current date and time for this transformation. |
DecimalFormatManager |
getDecimalFormatManager()
Get the Decimal Format Manager. |
DocumentPool |
getDocumentPool()
Get the document pool. |
javax.xml.transform.ErrorListener |
getErrorListener()
Get the error listener. |
Executable |
getExecutable()
Get the Executable object. |
InstructionInfo |
getInstructionInfo()
Get diagnostic information about this context |
KeyManager |
getKeyManager()
Get the KeyManager. |
Emitter |
getMessageEmitter()
Get the Emitter used for xsl:message output. |
NamePool |
getNamePool()
Get the name pool in use. |
java.util.Properties |
getOutputProperties()
Get the output properties for the transformation. |
java.lang.String |
getOutputProperty(java.lang.String name)
Get the value of an output property. |
OutputURIResolver |
getOutputURIResolver()
Get the output URI resolver. |
java.lang.Object |
getParameter(java.lang.String expandedName)
Get a parameter to the transformation. |
javax.xml.transform.Result |
getPrincipalResult()
Get the principal result destination |
java.lang.String |
getPrincipalResultURI()
Get the URI of the principal result destination. |
DocumentInfo |
getPrincipalSourceDocument()
Get the principal source document |
int |
getRecoveryPolicy()
Get the policy for handling recoverable errors. |
int |
getRememberedNumber(NodeInfo node)
Get the number of a node if it is the last remembered one. |
RuleManager |
getRuleManager()
Get the Rule Manager. |
javax.xml.transform.URIResolver |
getStandardURIResolver()
Get the fallback URI resolver. |
TraceListener |
getTraceListener()
Get the TraceListener. |
javax.xml.transform.URIResolver |
getURIResolver()
Get the primary URI resolver. |
java.lang.Object |
getUserData(java.lang.Object node,
java.lang.String name)
Get user data associated with a node. |
boolean |
isTracing()
Test whether instruction execution is being traced. |
Builder |
makeBuilder()
Make a builder for the selected tree model. |
Emitter |
makeMessageEmitter()
Make an Emitter to be used for xsl:message output. |
Stripper |
makeStripper(Builder b)
Make a Stripper configured to implement the whitespace stripping rules. |
XPathContextMajor |
newXPathContext()
Make an XPathContext object for expression evaluation. |
void |
pauseTracing(boolean pause)
Pause or resume tracing. |
void |
preEvaluateGlobals(XPathContext context)
Pre-evaluate global variables (when debugging/tracing) |
NodeInfo |
prepareInputTree(javax.xml.transform.Source source)
Prepare an input tree for processing. |
javax.xml.transform.Result |
prepareNextStylesheet(java.lang.String href,
java.lang.String baseURI,
javax.xml.transform.Result result)
Prepare another stylesheet to handle the output of this one. |
void |
recoverableError(XPathException err)
Report a recoverable error. |
void |
registerDocument(DocumentInfo doc,
java.lang.String systemId)
Add a document to the document pool. |
void |
removeTraceListener(TraceListener trace)
Removes the specified trace listener so that the next invocation of the render method will not send trace events to the listener. |
void |
setDecimalFormatManager(DecimalFormatManager manager)
Set the Decimal Format Manager. |
void |
setErrorListener(javax.xml.transform.ErrorListener listener)
Set the error listener. |
void |
setExecutable(Executable exec)
Associate this Controller with an Executable. |
void |
setInitialMode(java.lang.String expandedModeName)
Set the initial mode for the transformation. |
void |
setInitialTemplate(java.lang.String expandedName)
Set the initial named template to be used as the entry point |
void |
setLineNumbering(boolean onOrOff)
Set line numbering (of the source document) on or off. |
void |
setMessageEmitter(Emitter emitter)
Set the Emitter to be used for xsl:message output |
void |
setOutputProperties(java.util.Properties properties)
Set the output properties for the transformation. |
void |
setOutputProperty(java.lang.String name,
java.lang.String value)
Set an output property for the transformation. |
void |
setOutputURIResolver(OutputURIResolver resolver)
Set the URI resolver for secondary output documents. |
void |
setParameter(java.lang.String expandedName,
java.lang.Object value)
Set a parameter for the transformation. |
void |
setPreparedStylesheet(PreparedStylesheet sheet)
Associate this Controller with a compiled stylesheet. |
void |
setPrincipalSourceDocument(DocumentInfo doc)
Set the principal source document (used for evaluating global variables) |
void |
setRememberedNumber(NodeInfo node,
int number)
Set the last remembered node, for node numbering purposes. |
void |
setRuleManager(RuleManager r)
Set the RuleManager, used to manage template rules for each mode. |
void |
setTreeModel(int model)
Set the tree data model to use. |
void |
setURIResolver(javax.xml.transform.URIResolver resolver)
Set an object that will be used to resolve URIs used in document(), etc. |
void |
setUserData(java.lang.Object node,
java.lang.String name,
java.lang.Object data)
Set user data associated with a node (or any other object). |
void |
transform(javax.xml.transform.Source source,
javax.xml.transform.Result result)
Perform a transformation from a Source document to a Result document. |
void |
transformDocument(NodeInfo startNode,
javax.xml.transform.Result result)
Render a source XML document supplied as a tree. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Controller(Configuration config)
config - The Configuration used by this Controller| Method Detail |
public Configuration getConfiguration()
public void setInitialMode(java.lang.String expandedModeName)
expandedModeName - the name of the initial mode. The mode is
supplied as an expanded QName, that is "localname" if there is no
namespace, or "{uri}localname" otherwisepublic void setOutputProperties(java.util.Properties properties)
setOutputProperties in class javax.xml.transform.Transformerproperties - the output properties to be used for the
transformationpublic java.util.Properties getOutputProperties()
getOutputProperties in class javax.xml.transform.Transformer
public void setOutputProperty(java.lang.String name,
java.lang.String value)
setOutputProperty in class javax.xml.transform.Transformername - the name of the propertyvalue - the value of the propertypublic java.lang.String getOutputProperty(java.lang.String name)
getOutputProperty in class javax.xml.transform.Transformername - the name of the requested property
SaxonOutputKeyspublic java.lang.String getPrincipalResultURI()
public javax.xml.transform.Result getPrincipalResult()
public void setInitialTemplate(java.lang.String expandedName)
throws XPathException
expandedName - The expanded name of the template in {uri}local format
XPathException - if there is no named template with this name
public Emitter makeMessageEmitter()
throws XPathException
XPathException - if any dynamic error occurs; in
particular, if the registered MessageEmitter class is not an
Emitterpublic void setMessageEmitter(Emitter emitter)
public Emitter getMessageEmitter()
public int getRecoveryPolicy()
public void setErrorListener(javax.xml.transform.ErrorListener listener)
setErrorListener in class javax.xml.transform.Transformerlistener - the ErrorListener to be usedpublic javax.xml.transform.ErrorListener getErrorListener()
getErrorListener in class javax.xml.transform.Transformer
public void recoverableError(XPathException err)
throws DynamicError
err - An exception holding information about the error
DynamicError - if the error listener decides not to
recover from the errorpublic Executable getExecutable()
public DocumentPool getDocumentPool()
public void clearDocumentPool()
public void setLineNumbering(boolean onOrOff)
onOrOff - true to switch line numbering on; false to switch it offpublic void setPrincipalSourceDocument(DocumentInfo doc)
public Bindery getBindery()
public DocumentInfo getPrincipalSourceDocument()
public void setURIResolver(javax.xml.transform.URIResolver resolver)
setURIResolver in class javax.xml.transform.Transformerresolver - An object that implements the URIResolver interface, or
null.public javax.xml.transform.URIResolver getURIResolver()
getURIResolver in class javax.xml.transform.Transformerpublic javax.xml.transform.URIResolver getStandardURIResolver()
public void setOutputURIResolver(OutputURIResolver resolver)
resolver - An object that implements the OutputURIResolver
interface, or null.public OutputURIResolver getOutputURIResolver()
public KeyManager getKeyManager()
public NamePool getNamePool()
public void setTreeModel(int model)
model - the required tree model: Builder.STANDARD_TREE or
Builder.TINY_TREEBuilderpublic Builder makeBuilder()
public Stripper makeStripper(Builder b)
b - the Builder to which the events filtered by this stripper are
to be sent. May be null if the stripper is not being used for filtering
into a Builder.
public void registerDocument(DocumentInfo doc,
java.lang.String systemId)
doc - the root node of the document to be addedsystemId - thesystem ID of this documentpublic void setDecimalFormatManager(DecimalFormatManager manager)
manager - the Decimal Format Manager. This object is responsible
for maintaining all named and unnamed decimal format declarationspublic DecimalFormatManager getDecimalFormatManager()
public void setRuleManager(RuleManager r)
r - the Rule Managerpublic RuleManager getRuleManager()
public TraceListener getTraceListener()
public final boolean isTracing()
public final void pauseTracing(boolean pause)
pause - true if tracing is to pause; false if it is to resumepublic void addTraceListener(TraceListener trace)
trace - the trace listener.public void removeTraceListener(TraceListener trace)
trace - the trace listener.public void setPreparedStylesheet(PreparedStylesheet sheet)
sheet - the compiled stylesheetpublic void setExecutable(Executable exec)
public void defineGlobalParameters(Bindery bindery)
public java.lang.Object getUserData(java.lang.Object node,
java.lang.String name)
node - the node to which the data is attachedname - the name of the required property
public void setUserData(java.lang.Object node,
java.lang.String name,
java.lang.Object data)
node - name - data -
public void transform(javax.xml.transform.Source source,
javax.xml.transform.Result result)
throws javax.xml.transform.TransformerException
transform in class javax.xml.transform.Transformersource - The input for the source tree. May be null if and only if an
initial template has been supplied.result - The destination for the result tree.
XPathException - if the transformation fails. As a
special case, the method throws a TerminationException (a subclass
of XPathException) if the transformation was terminated using
xsl:message terminate="yes".
javax.xml.transform.TransformerExceptionpublic NodeInfo prepareInputTree(javax.xml.transform.Source source)
source - the input tree. Must be either a DOMSource or a NodeInfo
public void transformDocument(NodeInfo startNode,
javax.xml.transform.Result result)
throws javax.xml.transform.TransformerException
startNode - A Node that identifies the source document to be
transformed and the node where the transformation should start.
May be null if the transformation is to start using an initial template.result - The output destination
XPathException - if any dynamic error occurs
javax.xml.transform.TransformerException
public void preEvaluateGlobals(XPathContext context)
throws XPathException
XPathException
public javax.xml.transform.Result prepareNextStylesheet(java.lang.String href,
java.lang.String baseURI,
javax.xml.transform.Result result)
throws javax.xml.transform.TransformerException
href - URI of the next stylesheet to be appliedbaseURI - base URI for resolving href if it's a relative
URIresult - the output destination of the current stylesheet
XPathException - if any dynamic error occurs
javax.xml.transform.TransformerException
public void setParameter(java.lang.String expandedName,
java.lang.Object value)
setParameter in class javax.xml.transform.TransformerexpandedName - The name of the parameter in {uri}local formatvalue - The value object. This can be any valid Java
object it follows the same conversion rules as a value returned
from a Saxon extension function.public void clearParameters()
clearParameters in class javax.xml.transform.Transformerpublic java.lang.Object getParameter(java.lang.String expandedName)
getParameter in class javax.xml.transform.TransformerexpandedName - the name of the required parameter, in
"{uri}local-name" format
public java.util.GregorianCalendar getCurrentDateTime()
public XPathContextMajor newXPathContext()
public void setRememberedNumber(NodeInfo node,
int number)
node - the node in questionnumber - the number of this nodepublic int getRememberedNumber(NodeInfo node)
node - the node for which remembered information is required
public InstructionInfo getInstructionInfo()
getInstructionInfo in interface InstructionInfoProvider
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||