net.sf.saxon.instruct
public class Executable extends Object implements Serializable
Constructor Summary | |
---|---|
Executable(Configuration config)
Create a new Executable (a collection of stylesheet modules and/or query modules) |
Method Summary | |
---|---|
void | addQueryLibraryModule(QueryModule module)
Add an XQuery library module to the configuration. |
void | addRequiredParam(StructuredQName qName)
Add a required parameter |
void | checkAllRequiredParamsArePresent(GlobalParameterSet params)
Check that all required parameters have been supplied |
boolean | createsSecondaryResult()
Ask whether this executable represents a stylesheet that uses xsl:result-document
to create secondary output documents |
void | explainGlobalVariables(ExpressionPresenter presenter)
Explain (that is, output an expression tree) the global variables |
void | explainNamedTemplates(ExpressionPresenter presenter)
Explain the expression tree for named templates in a stylesheet |
void | fixupQueryModules(QueryModule main)
Fix up global variables and functions in all query modules. |
HashMap<StructuredQName,IntHashMap<String>> | getCharacterMapIndex()
Get the index of named character maps
|
CollationMap | getCollationTable()
Get the table of collations
|
HashMap<StructuredQName,GlobalVariable> | getCompiledGlobalVariables()
Get the index of global variables
|
Configuration | getConfiguration()
Get the configuration |
Properties | getDefaultOutputProperties()
Get the default output properties
|
FunctionLibrary | getFunctionLibrary()
Get the library containing all the in-scope functions in the static context
|
GlobalVariable | getGlobalVariable(StructuredQName name)
Get the global variable with a given name |
SlotManager | getGlobalVariableMap()
Get the global variable map
|
int | getHostLanguage()
Get the host language
|
StructuredQName | getInitialContextItemVariableName()
Get the the name of the variable that will implicitly contain the value of the
initial context item. |
KeyManager | getKeyManager()
Get the KeyManager which handles key definitions
|
int | getLargestPatternStackFrame()
Determine the size of the stack frame needed for evaluating match patterns |
LocationMap | getLocationMap()
Get the location map |
StringCollator | getNamedCollation(String name)
Find a named collation.
|
Template | getNamedTemplate(StructuredQName qName)
Get the named template with a given name.
|
Properties | getOutputProperties(StructuredQName qName)
Get a named output format
|
List<QueryModule> | getQueryLibraryModules(String namespace)
Locate the known XQuery library modules for a given module namespace.
|
Iterator | getQueryLibraryModules()
Get an iterator over all the query library modules (does not include the main module) |
QueryModule | getQueryModuleWithSystemId(String systemId, QueryModule topModule)
Get the query library module with a given systemID |
String | getReasonUnableToCompile()
Determine whether this executable can be compiled; and if it can't, return the reason why
|
RuleManager | getRuleManager()
Get the RuleManager which handles template rules
|
Mode | getStripperRules()
Get the rules determining which nodes are to be stripped from the tree
|
void | initializeBindery(Bindery bindery)
Allocate space in bindery for all the variables needed
|
boolean | isSchemaAware()
Ask whether this executable is schema-aware, that is, whether the query or transformation
imports a schema. |
Iterator<Template> | iterateNamedTemplates()
Iterate over all the named templates defined in this Executable |
Stripper | newStripper()
Create a Stripper which handles whitespace stripping definitions
|
void | putNamedTemplate(StructuredQName templateName, Template template)
Register the named template with a given name |
void | registerGlobalVariable(GlobalVariable variable)
Register a global variable |
void | setCharacterMapIndex(HashMap<StructuredQName,IntHashMap<String>> cmi)
Set the index of named character maps
|
void | setCollationTable(CollationMap table)
Set the table of collations
|
void | setConfiguration(Configuration config)
Set the configuration |
void | setCreatesSecondaryResult(boolean flag)
Set whether this executable represents a stylesheet that uses xsl:result-document
to create secondary output documents |
void | setDefaultOutputProperties(Properties properties)
Set the default output properties (the properties for the unnamed output format)
|
void | setFunctionLibrary(FunctionLibrary functionLibrary)
Set the library containing all the in-scope functions in the static context
|
void | setHostLanguage(int language)
Set the host language |
void | setInitialContextItemVariableName(StructuredQName name)
Set the name of the variable that will implicitly contain the value of the
initial context item. |
void | setKeyManager(KeyManager km)
Set the KeyManager which handles key definitions |
void | setLocationMap(LocationMap map)
Set the location map |
void | setOutputProperties(StructuredQName qName, Properties properties)
Add a named output format
|
void | setPatternSlotSpace(int patternLocals)
Set the space requirements for variables used in template match patterns
|
void | setReasonUnableToCompile(String reason)
If this Executable can't be compiled, set a message explaining why |
void | setRuleManager(RuleManager rm)
Set the RuleManager that handles template rules
|
void | setSchemaAware(boolean aware)
Set whether this executable is schema-aware. |
void | setStripperRules(Mode rules)
Set the rules determining which nodes are to be stripped from the tree
|
void | setStripsInputTypeAnnotations(boolean strips)
Set whether source documents are to have their type annotations stripped |
void | setStripsWhitespace(boolean strips)
Indicate that the stylesheet does some whitespace stripping
|
boolean | stripsInputTypeAnnotations()
Ask whether source documents are to have their type annotations stripped |
boolean | stripsWhitespace()
Determine whether this stylesheet does any whitespace stripping
|
Parameters: config the Saxon Configuration
Parameters: module the library module to be added to this executable
Parameters: qName the name of the required parameter
Parameters: params the set of parameters that have been supplied
Throws: XPathException if there is a required parameter for which no value has been supplied
Returns: true if the executable uses xsl:result-document
Parameters: presenter the destination for the explanation of the global variables
Parameters: presenter destination for the explanatory output
Parameters: main the main query module
Returns: the hash table that maps the names of character maps to the IntHashMap objects representing the character maps
Returns: a hash table that maps collation names (URIs) to objects representing the collation information
Returns: the index of global variables. This is a HashMap in which the key is the StructuredQName of the variable name, and the value is the GlobalVariable object representing the compiled global variable. If there are no global variables, the method may return null.
Returns: the Configuration
Returns: the properties for the unnamed output format
Returns: the function libary
Parameters: name the name of the required variable
Returns: the GlobalVariable with this name, or null if not found
Returns: the SlotManager defining the allocation of slots to global variables
Returns: a value identifying the host language: XQUERY or XSLT or JAVA_APPLICATION
Returns: the name of the global variable that mirrors the initial context item
Returns: the KeyManager containing the xsl:key definitions
Returns: the size of the largest stack frame needed for evaluating the match patterns that appear in XSLT template rules
Returns: the location map, which is used to identify the locations of errors
Parameters: name identifies the name of the collation required; null indicates that the default collation is required
Returns: the requested collation, or null if the collation is not found
Parameters: qName The template name
Returns: The template (of highest import precedence) with this name if there is one; null if none is found.
Parameters: qName the name of the output format
Returns: properties the properties of the output format. Return null if there are no output properties with the given name
Parameters: namespace the module namespace URI
Returns: a list of items each of which is the StaticQueryContext representing a module, or null if the module namespace is unknown
Returns: an iterator whose returned items are instances of QueryModule
Parameters: systemId the SystemId of the required module topModule the top-level query module (usually a main module, except when importing library modules into XSLT)
Returns: the module with that system id if found, otherwise null
Returns: null if the executable can be compiled, or a message otherwise
Returns: the RuleManager registered with setRuleManager
Returns: a Mode object containing the whitespace stripping rules. A Mode is generally a collection of template rules, but it is reused here to represent a collection of stripping rules.
Parameters: bindery The bindery to be initialized
Returns: true if the executable is schema-aware, false if not.
Returns: an iterator, the items returned being of class Template
Returns: the constructed Stripper object
Parameters: templateName the name of a named XSLT template template the template
Parameters: variable the global variable to be registered
Parameters: cmi a hash table that maps the names of character maps to the HashMap objects representing the character maps
Parameters: table a hash table that maps collation names (URIs) to objects representing the collation information
Parameters: config the Configuration
Parameters: flag true if the executable uses xsl:result-document
Parameters: properties the output properties to be used when the unnamed output format is selected
Parameters: functionLibrary the function libary
Parameters: name the name of the global variable that mirrors the initial context item
Parameters: km the KeyManager containing the xsl:key definitions
Parameters: map the location map, which is used to identify the module URI and line number of locations of errors
Parameters: qName the structured QName of the output format properties the properties of the output format
Parameters: patternLocals The largest number of local variables used in the match pattern of any template rule
Parameters: reason a message explaining why compilation is not possible
Parameters: rm the RuleManager containing details of all the template rules
Parameters: aware true if the executable is schema-aware
Throws: IllegalArgumentException if schema-aware processing is requested in a Configuration that is not schema-aware
Parameters: rules a Mode object containing the whitespace stripping rules. A Mode is generally a collection of template rules, but it is reused here to represent a collection of stripping rules.
Parameters: strips true if type annotations are to be stripped
Parameters: strips true if the stylesheet performs whitespace stripping of one or more elements.
Returns: true if type annotations are stripped from source documents
Returns: true if the stylesheet performs whitespace stripping of one or more elements.