Java Doc for Controller.java in  » XML » XPath-Saxon » net » sf » saxon » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » XML » XPath Saxon » net.sf.saxon 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.xml.transform.Transformer
      net.sf.saxon.Controller

All known Subclasses:   net.sf.saxon.IdentityTransformer,
Controller
public class Controller extends Transformer implements InstructionInfoProvider(Code)
The Controller is Saxon's implementation of the JAXP Transformer class, and represents an executing instance of a transformation or query. Multiple concurrent executions of the same transformation or query will use different Controller instances. This class is therefore not thread-safe.

The Controller is serially reusable, as required by JAXP: when one transformation or query is finished, it can be used to run another. However, there is no advantage in doing this rather than allocating a new Controller each time.

The Controller can also be used when running Java applications that use neither XSLT nor XQuery. A dummy Controller is created when running free-standing XPath expressions.

The Controller holds those parts of the dynamic context that do not vary during the course of a transformation or query, or that do not change once their value has been computed. This also includes those parts of the static context that are required at run-time.

Wherever possible XSLT applications should use the JAXP Transformer class directly, rather than relying on Saxon-specific methods in the Controller. However, some features are currently available only through this class. This applies especially to new features specific to XSLT 2.0, since the JAXP interface still supports only XSLT 1.0. Such methods may be superseded in the future by JAXP methods.

Many methods on the Controller are designed for internal use and should not be considered stable. From release 8.4 onwards, those methods that are considered sufficiently stable to constitute path of the Saxon public API are labelled with the JavaDoc tag "since": the value indicates the release at which the method was added to the public API.
author:
   Michael H. Kay
since:
   8.4




Constructor Summary
public  Controller(Configuration config)
     Create a Controller and initialise variables.
public  Controller(Configuration config, Executable executable)
     Create a Controller and initialise variables.

Method Summary
public  voidaddTraceListener(TraceListener trace)
     Adds the specified trace listener to receive trace events from this instance.
public  booleancheckUniqueOutputDestination(String uri)
     Check that an output destination has not been used before.
public  voidclearDocumentPool()
     Clear the document pool.
public  voidclearParameters()
     Reset the parameters to a null list.
public  voiddefineGlobalParameters(Bindery bindery)
     Define the global parameters of the transformation or query.
public  StringgetBaseOutputURI()
     Get the base output URI. This defaults to the system ID of the principal Result object, but a different value can be set for use where there is no principal result. The command line interface sets this to the current working directory.

The concept of the base output URI is new in XSLT 2.0: it defines the base URI for resolving relative URIs in the href attribute of the xsl:result-document instruction.

public  BinderygetBindery()
     Get the current bindery.
public  ClassLoadergetClassLoader()
     Get the ClassLoader supplied using the method Controller.setClassLoader .
public  ConfigurationgetConfiguration()
     Get the Configuration associated with this Controller.
public  DateTimeValuegetCurrentDateTime()
     Get the current date and time for this query or transformation. All calls during one transformation return the same answer.

This method is intended for internal use. Get the current date and time.

public  DocumentPoolgetDocumentPool()
     Get the document pool.
public  ErrorListenergetErrorListener()
     Get the error listener.
public  ExecutablegetExecutable()
     Get the Executable object.
public  InstructionInfogetInstructionInfo()
     Get diagnostic information about this context.
public  KeyManagergetKeyManager()
     Get the KeyManager.
public  EmittergetMessageEmitter()
     Get the Emitter used for xsl:message output.
public  NamePoolgetNamePool()
     Get the name pool in use.
public  PropertiesgetOutputProperties()
     Get the output properties for the transformation.
public  StringgetOutputProperty(String name)
     Get the value of an output property.
public  OutputURIResolvergetOutputURIResolver()
     Get the output URI resolver.
public  ObjectgetParameter(String expandedName)
     Get a parameter to the transformation.
public  ResultgetPrincipalResult()
     Get the principal result destination.
public  DocumentInfogetPrincipalSourceDocument()
     Get the principal source document.
public  intgetRecoveryPolicy()
     Get the policy for handling recoverable errors.

This method is intended for internal use the current policy.

public  intgetRememberedNumber(NodeInfo node)
     Get the number of a node if it is the last remembered one.
public  RuleManagergetRuleManager()
     Get the Rule Manager.
public  URIResolvergetStandardURIResolver()
     Get the fallback URI resolver.
public  TraceListenergetTraceListener()
     Get the TraceListener.
public  URIResolvergetURIResolver()
     Get the URI resolver.

This method changed in Saxon 8.5, to conform to the JAXP specification.

public  ObjectgetUserData(Object key, String name)
     Get user data associated with a key.
public  voidinitializeController()
     Initialize the controller ready for a new transformation.
final public  booleanisTracing()
     Test whether instruction execution is being traced.
public  BuildermakeBuilder()
     Make a builder for the selected tree model.
public  CharacterMapExpandermakeCharacterMapExpander(String useMaps)
     Make a CharacterMapExpander to handle the character map definitions in the serialization properties.

This method is intended for internal use only.
Parameters:
  useMaps - the expanded use-character-maps property: a space-separated list of namesof character maps to be used, each one expressed as an expanded-QName in Clark notation(that is, {uri}local-name).

public  EmittermakeMessageEmitter()
     Make an Emitter to be used for xsl:message output.
public  PipelineConfigurationmakePipelineConfiguration()
     Make a PipelineConfiguration based on the properties of this Controller.
public  StrippermakeStripper(Receiver b)
     Make a Stripper configured to implement the whitespace stripping rules. In the case of XSLT the whitespace stripping rules are normally defined by xsl:strip-space and xsl:preserve-space
public  XPathContextMajornewXPathContext()
     Make an XPathContext object for expression evaluation.
final public  voidpauseTracing(boolean pause)
     Pause or resume tracing.
public  voidpreEvaluateGlobals(XPathContext context)
     Pre-evaluate global variables (when debugging/tracing).
public  NodeInfoprepareInputTree(Source source)
     Prepare an input tree for processing.
public  ResultprepareNextStylesheet(String href, String baseURI, Result result)
     Prepare another stylesheet to handle the output of this one.
public  voidrecoverableError(XPathException err)
     Report a recoverable error.
public  voidregisterDocument(DocumentInfo doc, String systemId)
     Add a document to the document pool.
public  voidremoveTraceListener(TraceListener trace)
     Removes the specified trace listener so that the listener will no longer receive trace events.
public  voidreportFatalError(XPathException err)
    
public  voidreset()
    

Reset this Transformer to its original configuration.

Transformer is reset to the same state as when it was created with javax.xml.transform.TransformerFactory.newTransformer , javax.xml.transform.TransformerFactory.newTransformer(javax.xml.transform.Source source) or javax.xml.transform.Templates.newTransformer . reset() is designed to allow the reuse of existing Transformers thus saving resources associated with the creation of new Transformers.

The above is from the JAXP specification.

public  voidsetBaseOutputURI(String uri)
     Set the base output URI. This defaults to the system ID of the principal Result object, but a different value can be set for use where there is no principal result. The command line interface sets this to the current working directory.

The concept of the base output URI is new in XSLT 2.0: it defines the base URI for resolving relative URIs in the href attribute of the xsl:result-document instruction.

public  voidsetClassLoader(ClassLoader loader)
     Set a ClassLoader to be used when loading external classes.
public  voidsetCurrentDateTime(DateTimeValue dateTime)
     Set the current date and time for this query or transformation. This method is provided primarily for testing purposes, to allow tests to be run with a fixed date and time.
public  voidsetErrorListener(ErrorListener listener)
     Set the error listener.
public  voidsetExecutable(Executable exec)
     Associate this Controller with an Executable.
public  voidsetInitialMode(String expandedModeName)
     Set the initial mode for the transformation.

XSLT 2.0 allows a transformation to be started in a mode other than the default mode. The transformation then starts by looking for the template rule in this mode that best matches the initial context node.

This method may eventually be superseded by a standard JAXP method.
Parameters:
  expandedModeName - the name of the initial mode.

public  voidsetInitialTemplate(String expandedName)
     Set the initial named template to be used as the entry point.

XSLT 2.0 allows a transformation to start by executing a named template, rather than by matching an initial context node in a source document.

public  voidsetMessageEmitter(Emitter emitter)
     Set the Emitter to be used for xsl:message output.

Recent versions of the JAXP interface specify that by default the output of xsl:message is sent to the registered ErrorListener.

public  voidsetOutputProperties(Properties properties)
     Set the output properties for the transformation.
public  voidsetOutputProperty(String name, String value)
     Set an output property for the transformation.
public  voidsetOutputURIResolver(OutputURIResolver resolver)
     Set the URI resolver for secondary output documents.

XSLT 2.0 introduces the xsl:result-document

public  voidsetParameter(String expandedName, Object value)
     Set a parameter for the transformation.

The following table shows some of the classes that are supported by this method.

public  voidsetPreparedStylesheet(PreparedStylesheet sheet)
     Associate this Controller with a compiled stylesheet.
public  voidsetPrincipalSourceDocument(DocumentInfo doc)
     Set the principal source document (used for evaluating global variables). When a transformation is invoked using the Controller.transform method, the principal source document is set automatically.
public  voidsetRememberedNumber(NodeInfo node, int number)
     Set the last remembered node, for node numbering purposes.
public  voidsetRuleManager(RuleManager r)
     Set the RuleManager, used to manage template rules for each mode.
public  voidsetTreeModel(int model)
     Set the tree data model to use.
public  voidsetURIResolver(URIResolver resolver)
     Set an object that will be used to resolve URIs used in document(), etc.
public  voidsetUserData(Object key, String name, Object data)
     Set user data associated with a key.
public  voidtransform(Source source, Result result)
     Perform a transformation from a Source document to a Result document.
exception:
  XPathException - if the transformation fails.
public  voidtransformDocument(NodeInfo startNode, Result result)
     Transform a source XML document supplied as a tree.
public static  NodeInfounravel(Source source, Configuration config)
     Get a NodeInfo corresponding to a DOM Node, either by wrapping or unwrapping the DOM Node.


Constructor Detail
Controller
public Controller(Configuration config)(Code)
Create a Controller and initialise variables. Constructor is protected, the Controller should be created using newTransformer() in the PreparedStylesheet class.
Parameters:
  config - The Configuration used by this Controller



Controller
public Controller(Configuration config, Executable executable)(Code)
Create a Controller and initialise variables. Constructor is protected, the Controller should be created using newTransformer() in the PreparedStylesheet class.
Parameters:
  config - The Configuration used by this Controller
Parameters:
  executable - The executable used by this Controller




Method Detail
addTraceListener
public void addTraceListener(TraceListener trace)(Code)
Adds the specified trace listener to receive trace events from this instance. Note that although TraceListeners can be added or removed dynamically, this has no effect unless the stylesheet or query has been compiled with tracing enabled. This is achieved by calling Configuration.setTraceListener or by setting the attribute FeatureKeys.TRACE_LISTENER on the TransformerFactory. Conversely, if this property has been set in the Configuration or TransformerFactory, the TraceListener will automatically be added to every Controller that uses that Configuration.
Parameters:
  trace - the trace listener.
since:
   8.4



checkUniqueOutputDestination
public boolean checkUniqueOutputDestination(String uri)(Code)
Check that an output destination has not been used before.

This method is intended for internal use only.




clearDocumentPool
public void clearDocumentPool()(Code)
Clear the document pool. This is sometimes useful when re-using the same Transformer for a sequence of transformations, but it isn't done automatically, because when the transformations use common look-up documents, the caching is beneficial.



clearParameters
public void clearParameters()(Code)
Reset the parameters to a null list.



defineGlobalParameters
public void defineGlobalParameters(Bindery bindery) throws XPathException(Code)
Define the global parameters of the transformation or query.

This method is intended for internal use only
Parameters:
  bindery - The Bindery, which holds values of global variables and parameters




getBaseOutputURI
public String getBaseOutputURI()(Code)
Get the base output URI. This defaults to the system ID of the principal Result object, but a different value can be set for use where there is no principal result. The command line interface sets this to the current working directory.

The concept of the base output URI is new in XSLT 2.0: it defines the base URI for resolving relative URIs in the href attribute of the xsl:result-document instruction. This method may be superseded by a standard JAXP method when JAXP is updated to support XSLT 2.0. the base output URI
since:
   8.4




getBindery
public Bindery getBindery()(Code)
Get the current bindery.

This method is intended for internal use only. the Bindery (in which values of all variables are held)




getClassLoader
public ClassLoader getClassLoader()(Code)
Get the ClassLoader supplied using the method Controller.setClassLoader . If none has been supplied, return null.

This method is for application use, but is experimental and subject to change. the ClassLoader in use.




getConfiguration
public Configuration getConfiguration()(Code)
Get the Configuration associated with this Controller. The Configuration holds settings that potentially apply globally to many different queries and transformations. the Configuration object
since:
   8.4



getCurrentDateTime
public DateTimeValue getCurrentDateTime()(Code)
Get the current date and time for this query or transformation. All calls during one transformation return the same answer.

This method is intended for internal use. Get the current date and time. This will deliver the same valuefor repeated calls within the same transformation




getDocumentPool
public DocumentPool getDocumentPool()(Code)
Get the document pool. This is used only for source documents, not for stylesheet modules.

This method is intended for internal use only. the source document pool




getErrorListener
public ErrorListener getErrorListener()(Code)
Get the error listener. the ErrorListener in use



getExecutable
public Executable getExecutable()(Code)
Get the Executable object.

This method is intended for internal use only. the Executable (which represents the compiled stylesheet)




getInstructionInfo
public InstructionInfo getInstructionInfo()(Code)
Get diagnostic information about this context.

This method is intended for internal use.




getKeyManager
public KeyManager getKeyManager()(Code)
Get the KeyManager.

This method is intended for internal use only. the KeyManager, which holds details of all key declarations




getMessageEmitter
public Emitter getMessageEmitter()(Code)
Get the Emitter used for xsl:message output. This returns the emitter previously supplied to the Controller.setMessageEmitter method, or the default message emitter otherwise. the Emitter being used for xsl:message output



getNamePool
public NamePool getNamePool()(Code)
Get the name pool in use. The name pool is responsible for mapping QNames used in source documents and compiled stylesheets and queries into numeric codes. All source documents used by a given transformation or query must use the same name pool as the compiled stylesheet or query. the name pool in use
since:
   8.4



getOutputProperties
public Properties getOutputProperties()(Code)
Get the output properties for the transformation.

As well as the properties defined in the JAXP OutputKeys class, Saxon defines an additional set of properties in SaxonOutputKeys . These fall into two categories: Constants representing serialization properties defined in XSLT 2.0 (which are not yet supported by JAXP), and constants supporting Saxon extensions to the set of serialization properties. the output properties being used for the transformation,including properties defined in the stylesheet for the unnamedoutput format
See Also:   SaxonOutputKeys
since:
   8.4




getOutputProperty
public String getOutputProperty(String name)(Code)
Get the value of an output property.

As well as the properties defined in the JAXP OutputKeys class, Saxon defines an additional set of properties in SaxonOutputKeys . These fall into two categories: Constants representing serialization properties defined in XSLT 2.0 (which are not yet supported by JAXP), and constants supporting Saxon extensions to the set of serialization properties.
Parameters:
  name - the name of the requested property the value of the requested property
See Also:   SaxonOutputKeys
since:
   8.4




getOutputURIResolver
public OutputURIResolver getOutputURIResolver()(Code)
Get the output URI resolver. the user-supplied URI resolver if there is one, or thesystem-defined one otherwise.
See Also:   Controller.setOutputURIResolver
since:
   8.4



getParameter
public Object getParameter(String expandedName)(Code)
Get a parameter to the transformation. This returns the value of a parameter that has been previously set using the Controller.setParameter method. The value is returned exactly as supplied, that is, before any conversion to an XPath value.
Parameters:
  expandedName - the name of the required parameter, in"{uri}local-name" format the value of the parameter, if it exists, or null otherwise



getPrincipalResult
public Result getPrincipalResult()(Code)
Get the principal result destination.

This method is intended for internal use only.




getPrincipalSourceDocument
public DocumentInfo getPrincipalSourceDocument()(Code)
Get the principal source document. This returns the document previously supplied to the Controller.setPrincipalSourceDocument method, or the principal source document set implicitly using methods such as Controller.transform . the principal source document
since:
   8.4



getRecoveryPolicy
public int getRecoveryPolicy()(Code)
Get the policy for handling recoverable errors.

This method is intended for internal use the current policy. This is obtained from the error listener; if the error listener isnot a StandardErrorListener, the value RECOVER_WITH_WARNINGS is returned.




getRememberedNumber
public int getRememberedNumber(NodeInfo node)(Code)
Get the number of a node if it is the last remembered one.

This method is strictly for internal use only.
Parameters:
  node - the node for which remembered information is required the number of this node if known, else -1.




getRuleManager
public RuleManager getRuleManager()(Code)
Get the Rule Manager.

This method is intended for internal use only. the Rule Manager, used to hold details of template rules forall modes




getStandardURIResolver
public URIResolver getStandardURIResolver()(Code)
Get the fallback URI resolver. This is the URIResolver that Saxon uses when the user-supplied URI resolver returns null.

This method is intended for internal use only. the the system-defined URIResolver




getTraceListener
public TraceListener getTraceListener()(Code)
Get the TraceListener. By default, there is no TraceListener, and this method returns null. A TraceListener may be added using the method Controller.addTraceListener . If more than one TraceListener has been added, this method will return a composite TraceListener. Because this form this takes is implementation-dependent, this method is not part of the stable Saxon public API. the TraceListener used for XSLT or XQuery instruction tracing



getURIResolver
public URIResolver getURIResolver()(Code)
Get the URI resolver.

This method changed in Saxon 8.5, to conform to the JAXP specification. If there is no user-specified URIResolver, it now returns null; previously it returned the system default URIResolver.

the user-supplied URI resolver if there is one, or null otherwise.



getUserData
public Object getUserData(Object key, String name)(Code)
Get user data associated with a key. To retrieve user data, two objects are required: an arbitrary object that may be regarded as the container of the data (originally, and typically still, a node in a tree), and a name. The name serves to distingush data objects associated with the same node by different client applications.

This method is intended primarily for internal use, though it may also be used by advanced applications.
Parameters:
  key - an object acting as a key for this user data value. This must be equal(in the sense of the equals() method) to the key supplied when the data value wasregistered using Controller.setUserData.
Parameters:
  name - the name of the required property the value of the required property




initializeController
public void initializeController() throws XPathException(Code)
Initialize the controller ready for a new transformation. This method should not normally be called by users (it is done automatically when transform() is invoked). However, it is available as a low-level API especially for use with XQuery.



isTracing
final public boolean isTracing()(Code)
Test whether instruction execution is being traced. This will be true if (a) at least one TraceListener has been registered using the Controller.addTraceListener method, and (b) tracing has not been temporarily paused using the Controller.pauseTracing method. true if tracing is active, false otherwise
since:
   8.4



makeBuilder
public Builder makeBuilder()(Code)
Make a builder for the selected tree model. an instance of the Builder for the chosen tree model
since:
   8.4



makeCharacterMapExpander
public CharacterMapExpander makeCharacterMapExpander(String useMaps) throws XPathException(Code)
Make a CharacterMapExpander to handle the character map definitions in the serialization properties.

This method is intended for internal use only.
Parameters:
  useMaps - the expanded use-character-maps property: a space-separated list of namesof character maps to be used, each one expressed as an expanded-QName in Clark notation(that is, {uri}local-name). a CharacterMapExpander if one is required, or null if not (for example, if theuseMaps argument is an empty string).
throws:
  XPathException - if a name in the useMaps property cannot be resolved to a declaredcharacter map.




makeMessageEmitter
public Emitter makeMessageEmitter() throws XPathException(Code)
Make an Emitter to be used for xsl:message output.

This method is intended for internal use only.
exception:
  XPathException - if any dynamic error occurs; inparticular, if the registered MessageEmitter class is not anEmitter The newly constructed message Emitter




makePipelineConfiguration
public PipelineConfiguration makePipelineConfiguration()(Code)
Make a PipelineConfiguration based on the properties of this Controller.

This interface is intended primarily for internal use, although it may be necessary for applications to call it directly for use in conjunction with the experimental pull API.




makeStripper
public Stripper makeStripper(Receiver b)(Code)
Make a Stripper configured to implement the whitespace stripping rules. In the case of XSLT the whitespace stripping rules are normally defined by xsl:strip-space and xsl:preserve-spaceConfiguration.setStripsAllWhiteSpace(boolean) .
Parameters:
  b - the Receiver to which the events filtered by this stripper areto be sent (often a Builder). May be null if the stripper is not being used for filteringinto a Builder or other Receiver. the required Stripper. A Stripper may be used in two ways. It acts asa filter applied to an event stream, that can be used to remove the eventsrepresenting whitespace text nodes before they reach a Builder. Alternatively,it can be used to define a view of an existing tree in which the whitespacetext nodes are dynamically skipped while navigating the XPath axes.
since:
   8.4 - Generalized in 8.5 to accept any Receiver as an argument



newXPathContext
public XPathContextMajor newXPathContext()(Code)
Make an XPathContext object for expression evaluation.

This method is intended for internal use. the new XPathContext




pauseTracing
final public void pauseTracing(boolean pause)(Code)
Pause or resume tracing. While tracing is paused, trace events are not sent to any of the registered TraceListeners.
Parameters:
  pause - true if tracing is to pause; false if it is to resume
since:
   8.4



preEvaluateGlobals
public void preEvaluateGlobals(XPathContext context) throws XPathException(Code)
Pre-evaluate global variables (when debugging/tracing).

This method is intended for internal use.




prepareInputTree
public NodeInfo prepareInputTree(Source source)(Code)
Prepare an input tree for processing. This is used when either the initial input, or a Source returned by the document() function, is a NodeInfo or a DOMSource. The preparation consists of wrapping a DOM document inside a wrapper that implements the NodeInfo interface, and/or adding a space-stripping wrapper if the stylesheet strips whitespace nodes.

This method is intended for internal use.
Parameters:
  source - the input tree. Must be either a DOMSource or a NodeInfo the NodeInfo representing the input node, suitably wrapped.




prepareNextStylesheet
public Result prepareNextStylesheet(String href, String baseURI, Result result) throws TransformerException(Code)
Prepare another stylesheet to handle the output of this one.

This method is intended for internal use, to support the saxon:next-in-chain extension.
exception:
  XPathException - if any dynamic error occurs
Parameters:
  href - URI of the next stylesheet to be applied
Parameters:
  baseURI - base URI for resolving href if it's a relativeURI
Parameters:
  result - the output destination of the current stylesheet a replacement destination for the current stylesheet




recoverableError
public void recoverableError(XPathException err) throws DynamicError(Code)
Report a recoverable error. This is an XSLT concept: by default, such an error results in a warning message, and processing continues. In XQuery, however, there are no recoverable errors so a fatal error is reported.

This method is intended for internal use only.
Parameters:
  err - An exception holding information about the error
exception:
  DynamicError - if the error listener decides not torecover from the error




registerDocument
public void registerDocument(DocumentInfo doc, String systemId)(Code)
Add a document to the document pool.

This method is intended for internal use only.
Parameters:
  doc - the root node of the document to be added
Parameters:
  systemId - thesystem ID of this document




removeTraceListener
public void removeTraceListener(TraceListener trace)(Code)
Removes the specified trace listener so that the listener will no longer receive trace events.
Parameters:
  trace - the trace listener.
since:
   8.4



reportFatalError
public void reportFatalError(XPathException err)(Code)
Report a fatal error



reset
public void reset()(Code)

Reset this Transformer to its original configuration.

Transformer is reset to the same state as when it was created with javax.xml.transform.TransformerFactory.newTransformer , javax.xml.transform.TransformerFactory.newTransformer(javax.xml.transform.Source source) or javax.xml.transform.Templates.newTransformer . reset() is designed to allow the reuse of existing Transformers thus saving resources associated with the creation of new Transformers.

The above is from the JAXP specification. With Saxon, it's unlikely that reusing a Transformer will give any performance benefits over creating a new one. The one case where it might be beneficial is to reuse the document pool (the set of documents that have been loaded using the doc() or document() functions). Therefore, this method does not clear the document pool. If you want to clear the document pool, call the method Controller.clearDocumentPool as well.

The reset Transformer is not guaranteed to have the same javax.xml.transform.URIResolver or javax.xml.transform.ErrorListener Objects, e.g. Object.equals(Object obj) . It is guaranteed to have a functionally equal URIResolver and ErrorListener.


since:
   1.5



setBaseOutputURI
public void setBaseOutputURI(String uri)(Code)
Set the base output URI. This defaults to the system ID of the principal Result object, but a different value can be set for use where there is no principal result. The command line interface sets this to the current working directory.

The concept of the base output URI is new in XSLT 2.0: it defines the base URI for resolving relative URIs in the href attribute of the xsl:result-document instruction. This method may be superseded by a standard JAXP method when JAXP is updated to support XSLT 2.0.
Parameters:
  uri - the base output URI
since:
   8.4




setClassLoader
public void setClassLoader(ClassLoader loader)(Code)
Set a ClassLoader to be used when loading external classes. Examples of classes that are loaded include SAX parsers, localization modules for formatting numbers and dates, extension functions, external object models. In an environment such as Eclipse that uses its own ClassLoader, this ClassLoader should be nominated to ensure that any class loaded by Saxon is identical to a class of the same name loaded by the external environment.

This method is for application use, but is experimental and subject to change.
Parameters:
  loader - the ClassLoader to be used.




setCurrentDateTime
public void setCurrentDateTime(DateTimeValue dateTime) throws XPathException(Code)
Set the current date and time for this query or transformation. This method is provided primarily for testing purposes, to allow tests to be run with a fixed date and time. The supplied date/time must include a timezone, which is used as the implicit timezone. Calls are ignored if a current date/time has already been established by calling getCurrentDateTime().

Note that comparisons of date/time values currently use the implicit timezone taken from the system clock, not from the value supplied here.




setErrorListener
public void setErrorListener(ErrorListener listener)(Code)
Set the error listener.
Parameters:
  listener - the ErrorListener to be used



setExecutable
public void setExecutable(Executable exec)(Code)
Associate this Controller with an Executable. This method is used by the XQuery processor. The Executable object is overkill in this case - the only thing it currently holds are copies of the collation table.

This method is intended for internal use only
Parameters:
  exec - the Executable




setInitialMode
public void setInitialMode(String expandedModeName)(Code)
Set the initial mode for the transformation.

XSLT 2.0 allows a transformation to be started in a mode other than the default mode. The transformation then starts by looking for the template rule in this mode that best matches the initial context node.

This method may eventually be superseded by a standard JAXP method.
Parameters:
  expandedModeName - the name of the initial mode. The mode issupplied as an expanded QName, that is "localname" if there is nonamespace, or "{uri}localname" otherwise
since:
   8.4




setInitialTemplate
public void setInitialTemplate(String expandedName) throws XPathException(Code)
Set the initial named template to be used as the entry point.

XSLT 2.0 allows a transformation to start by executing a named template, rather than by matching an initial context node in a source document. This method may eventually be superseded by a standard JAXP method once JAXP supports XSLT 2.0.

Although the Saxon command line interface does not allow both a source document and an initial template to be specified, this API has no such restriction.

Note that any parameters supplied using Controller.setParameter are used as the values of global stylesheet parameters. There is no way to supply values for local parameters of the initial template.
Parameters:
  expandedName - The expanded name of the template in {uri}local format
throws:
  XPathException - if there is no named template with this name
since:
   8.4




setMessageEmitter
public void setMessageEmitter(Emitter emitter)(Code)
Set the Emitter to be used for xsl:message output.

Recent versions of the JAXP interface specify that by default the output of xsl:message is sent to the registered ErrorListener. Saxon does not yet implement this convention. Instead, the output is sent to a default message emitter, which is a slightly customised implementation of the standard Saxon Emitter interface.

This interface can be used to change the way in which Saxon outputs xsl:message output.

It is not necessary to use this interface in order to change the destination to which messages are written: that can be achieved by obtaining the standard message emitter and calling its Emitter.setWriter method.

This method is intended for use by advanced applications. The Emitter interface itself is not part of the stable Saxon public API.
Parameters:
  emitter - The emitter to receive xsl:message output.




setOutputProperties
public void setOutputProperties(Properties properties)(Code)
Set the output properties for the transformation. These properties will override properties set in the templates with xsl:output.

As well as the properties defined in the JAXP OutputKeys class, Saxon defines an additional set of properties in SaxonOutputKeys . These fall into two categories: Constants representing serialization properties defined in XSLT 2.0 (which are not yet supported by JAXP), and constants supporting Saxon extensions to the set of serialization properties.
Parameters:
  properties - the output properties to be used for thetransformation. If the value is null, the properties are reset tobe the properties of the Templates object (that is, for XSLT 2.0,the properties set in the unnamed xsl:output object).
See Also:   SaxonOutputKeys
since:
   8.4




setOutputProperty
public void setOutputProperty(String name, String value)(Code)
Set an output property for the transformation.

As well as the properties defined in the JAXP OutputKeys class, Saxon defines an additional set of properties in SaxonOutputKeys . These fall into two categories: Constants representing serialization properties defined in XSLT 2.0 (which are not yet supported by JAXP), and constants supporting Saxon extensions to the set of serialization properties.
Parameters:
  name - the name of the property
Parameters:
  value - the value of the property
See Also:   SaxonOutputKeys
since:
   8.4




setOutputURIResolver
public void setOutputURIResolver(OutputURIResolver resolver)(Code)
Set the URI resolver for secondary output documents.

XSLT 2.0 introduces the xsl:result-document This method may eventually be superseded by a standard JAXP method.
Parameters:
  resolver - An object that implements the OutputURIResolverinterface, or null.
since:
   8.4




setParameter
public void setParameter(String expandedName, Object value)(Code)
Set a parameter for the transformation.

The following table shows some of the classes that are supported by this method. (Others may also be supported, but continued support is not guaranteed.) Each entry in the table shows first the Java class of the supplied object, and then the type of the resulting XPath value.

Java ClassXPath 2.0 type
Stringxs:string
Booleanxs:boolean
Integerxs:integer
Longxs:integer
Doublexs:double
Floatxs:float
BigDecimalxs:decimal
BigIntegerxs:integer
Datexs:dateTime
Array or List of any of the abovesequence of the above
nullempty sequence

A node may be supplied as a NodeInfo object, a sequence of nodes as an array or List of NodeInfo objects.

In addition, any object that implements the Saxon net.sf.saxon.value.Value interface may be supplied, and will be used without conversion.

A node belong to an external object model (such as DOM, JDOM, or XOM) may be supplied provided (a) that the external object model is registered with the Configuration, and (b) that the node is part of a document tree that has been registered in the document pool.
Parameters:
  expandedName - The name of the parameter in {uri}local format
Parameters:
  value - The value object. This must follow the rules above.Other formats in addition to those listed above may be accepted.
since:
   8.4




setPreparedStylesheet
public void setPreparedStylesheet(PreparedStylesheet sheet)(Code)
Associate this Controller with a compiled stylesheet.

This method is intended for internal use only.
Parameters:
  sheet - the compiled stylesheet




setPrincipalSourceDocument
public void setPrincipalSourceDocument(DocumentInfo doc)(Code)
Set the principal source document (used for evaluating global variables). When a transformation is invoked using the Controller.transform method, the principal source document is set automatically. This method is useful in XQuery, to define an initial context node for evaluating global variables, and also in XSLT 2.0, when the transformation is started by invoking a named template.
Parameters:
  doc - The principal source document
since:
   8.4



setRememberedNumber
public void setRememberedNumber(NodeInfo node, int number)(Code)
Set the last remembered node, for node numbering purposes.

This method is strictly for internal use only.
Parameters:
  node - the node in question
Parameters:
  number - the number of this node




setRuleManager
public void setRuleManager(RuleManager r)(Code)
Set the RuleManager, used to manage template rules for each mode.

This method is intended for internal use only.
Parameters:
  r - the Rule Manager




setTreeModel
public void setTreeModel(int model)(Code)
Set the tree data model to use. This affects all source documents subsequently constructed using a Builder obtained from this Controller. This includes a document built from a StreamSource or SAXSource supplied as a parameter to the Controller.transform method.
Parameters:
  model - the required tree model: Builder.STANDARD_TREE orBuilder.TINY_TREE
See Also:   net.sf.saxon.event.Builder
since:
   8.4



setURIResolver
public void setURIResolver(URIResolver resolver)(Code)
Set an object that will be used to resolve URIs used in document(), etc.
Parameters:
  resolver - An object that implements the URIResolver interface, ornull.



setUserData
public void setUserData(Object key, String name, Object data)(Code)
Set user data associated with a key. To store user data, two objects are required: an arbitrary object that may be regarded as the container of the data (originally, and typically still, a node in a tree), and a name. The name serves to distingush data objects associated with the same node by different client applications.

This method is intended primarily for internal use, though it may also be used by advanced applications.
Parameters:
  key - an object acting as a key for this user data value. This must be equal(in the sense of the equals() method) to the key supplied when the data value wasregistered using Controller.setUserData. If data for the given object and name alreadyexists, it is overwritten.
Parameters:
  name - the name of the required property
Parameters:
  data - the value of the required property




transform
public void transform(Source source, Result result) throws TransformerException(Code)
Perform a transformation from a Source document to a Result document.
exception:
  XPathException - if the transformation fails. As aspecial case, the method throws a TerminationException (a subclassof XPathException) if the transformation was terminated usingxsl:message terminate="yes".
Parameters:
  source - The input for the source tree. May be null if and only if aninitial template has been supplied.
Parameters:
  result - The destination for the result tree.



transformDocument
public void transformDocument(NodeInfo startNode, Result result) throws TransformerException(Code)
Transform a source XML document supplied as a tree.
A new output destination should be created for each source document, by using setOutputDetails().

This method is intended for internal use. External applications should use the Controller.transform method, which is part of the JAXP interface. Note that NodeInfo implements the JAXP Source interface, so it may be supplied directly to the transform() method.
exception:
  XPathException - if any dynamic error occurs
Parameters:
  startNode - A Node that identifies the source document to betransformed and the node where the transformation should start.May be null if the transformation is to start using an initial template.
Parameters:
  result - The output destination




unravel
public static NodeInfo unravel(Source source, Configuration config)(Code)
Get a NodeInfo corresponding to a DOM Node, either by wrapping or unwrapping the DOM Node.

This method is intended for internal use.




Methods inherited from javax.xml.transform.Transformer
abstract public void clearParameters()(Code)(Java Doc)
abstract public ErrorListener getErrorListener()(Code)(Java Doc)
abstract public Properties getOutputProperties()(Code)(Java Doc)
abstract public String getOutputProperty(String name) throws IllegalArgumentException(Code)(Java Doc)
abstract public Object getParameter(String name)(Code)(Java Doc)
abstract public URIResolver getURIResolver()(Code)(Java Doc)
public void reset()(Code)(Java Doc)
abstract public void setErrorListener(ErrorListener listener) throws IllegalArgumentException(Code)(Java Doc)
abstract public void setOutputProperties(Properties oformat)(Code)(Java Doc)
abstract public void setOutputProperty(String name, String value) throws IllegalArgumentException(Code)(Java Doc)
abstract public void setParameter(String name, Object value)(Code)(Java Doc)
abstract public void setURIResolver(URIResolver resolver)(Code)(Java Doc)
abstract public void transform(Source xmlSource, Result outputTarget) throws TransformerException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.