A compiled stylesheet or a query in executable form.
Note that the original stylesheet tree is not retained.
addQueryLibraryModule
public void addQueryLibraryModule(QueryModule module)
Add an XQuery library module to the configuration. The Executable maintains a table indicating
for each module namespace, the set of modules that have been loaded from that namespace. If a
module import is encountered that specifies no location hint, all the known modules for that
namespace are imported.
module
- the library module to be added to this executable
addRequiredParam
public void addRequiredParam(StructuredQName qName)
Add a required parameter
qName
- the name of the required parameter
checkAllRequiredParamsArePresent
public void checkAllRequiredParamsArePresent(GlobalParameterSet params)
throws XPathException
Check that all required parameters have been supplied
params
- the set of parameters that have been supplied
XPathException
- if there is a required parameter for which no value has been supplied
explainGlobalVariables
public void explainGlobalVariables(ExpressionPresenter presenter)
Explain (that is, output an expression tree) the global variables
presenter
- the destination for the explanation of the global variables
explainNamedTemplates
public void explainNamedTemplates(ExpressionPresenter presenter)
Explain the expression tree for named templates in a stylesheet
presenter
- destination for the explanatory output
fixupQueryModules
public void fixupQueryModules(QueryModule main)
throws XPathException
Fix up global variables and functions in all query modules. This is done right at the end, because
recursive imports are permitted
main
- the main query module
getCharacterMapIndex
public HashMap getCharacterMapIndex()
Get the index of named character maps
- the hash table that maps the names of character maps
to the HashMap objects representing the character maps
getCollationTable
public CollationMap getCollationTable()
Get the table of collations
- a hash table that maps collation names (URIs) to objects representing the
collation information
getCompiledGlobalVariables
public HashMap getCompiledGlobalVariables()
Get the index of global variables
- 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.
getConfiguration
public Configuration getConfiguration()
Get the configuration
getDecimalFormatManager
public DecimalFormatManager getDecimalFormatManager()
Get the DecimalFormatManager which handles decimal-format definitions
- the DecimalFormatManager containing the named xsl:decimal-format definitions
getDefaultCollation
public StringCollator getDefaultCollation()
Get the default collation
- a StringCollator that implements the default collation
getDefaultCollationName
public String getDefaultCollationName()
Get the name of the default collation
- the name of the default collation; this is the code point collation URI if no other default
has been set up.
getDefaultOutputProperties
public Properties getDefaultOutputProperties()
Get the default output properties
- the properties for the unnamed output format
getFunctionLibrary
public FunctionLibrary getFunctionLibrary()
Get the library containing all the in-scope functions in the static context
getGlobalVariableMap
public SlotManager getGlobalVariableMap()
Get the global variable map
- the SlotManager defining the allocation of slots to global variables
getHostLanguage
public int getHostLanguage()
Get the host language
getKeyManager
public KeyManager getKeyManager()
Get the KeyManager which handles key definitions
- the KeyManager containing the xsl:key definitions
getLargestPatternStackFrame
public int getLargestPatternStackFrame()
Determine the size of the stack frame needed for evaluating match patterns
- the size of the largest stack frame needed for evaluating the match patterns
that appear in XSLT template rules
getLocationMap
public LocationMap getLocationMap()
Get the location map
- the location map, which is used to identify the locations of errors
getNamedCollation
public StringCollator getNamedCollation(String name)
Find a named collation.
name
- identifies the name of the collation required; null indicates that the default
collation is required
- the requested collation, or null if the collation is not found
getNamedTemplate
public Template getNamedTemplate(StructuredQName qName)
Get the named template with a given name.
qName
- The template name
- The template (of highest import precedence) with this name if there is one;
null if none is found.
getOutputProperties
public Properties getOutputProperties(StructuredQName qName)
Get a named output format
qName
- the name of the output format
- properties the properties of the output format. Return null if there are
no output properties with the given name
getQueryLibraryModules
public Iterator getQueryLibraryModules()
Get an iterator over all the query library modules (does not include the main module)
- an iterator whose returned items are instances of
QueryModule
getQueryLibraryModules
public List getQueryLibraryModules(String namespace)
Locate the known XQuery library modules for a given module namespace.
namespace
- the module namespace URI
- a list of items each of which is the StaticQueryContext representing a module, or
null if the module namespace is unknown
getQueryModuleWithSystemId
public QueryModule getQueryModuleWithSystemId(String systemId,
QueryModule topModule)
Get the query library module with a given systemID
systemId
- the SystemId of the required moduletopModule
-
- the module with that system id if found, otherwise null
getReasonUnableToCompile
public String getReasonUnableToCompile()
Determine whether this executable can be compiled; and if it can't, return the reason why
- null if the executable can be compiled, or a message otherwise
getRuleManager
public RuleManager getRuleManager()
Get the RuleManager which handles template rules
- the RuleManager registered with setRuleManager
getStripperRules
public Mode getStripperRules()
Get the rules determining which nodes are to be stripped from the tree
- 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.
initializeBindery
public void initializeBindery(Bindery bindery)
Allocate space in bindery for all the variables needed
bindery
- The bindery to be initialized
iterateNamedTemplates
public Iterator iterateNamedTemplates()
Iterate over all the named templates defined in this Executable
- an iterator, the items returned being of class
Template
newStripper
public Stripper newStripper()
Create a Stripper which handles whitespace stripping definitions
- the constructed Stripper object
putNamedTemplate
public void putNamedTemplate(StructuredQName templateName,
Template template)
Register the named template with a given name
templateName
- the name of a named XSLT templatetemplate
- the template
registerGlobalVariable
public void registerGlobalVariable(GlobalVariable variable)
Register a global variable
variable
- the global variable to be registered
setCharacterMapIndex
public void setCharacterMapIndex(HashMap cmi)
Set the index of named character maps
cmi
- a hash table that maps the names of character maps
to the HashMap objects representing the character maps
setCollationTable
public void setCollationTable(CollationMap table)
Set the table of collations
table
- a hash table that maps collation names (URIs) to objects representing the
collation information
setConfiguration
public void setConfiguration(Configuration config)
Set the configuration
config
- the Configuration
setDecimalFormatManager
public void setDecimalFormatManager(DecimalFormatManager dfm)
Set the DecimalFormatManager which handles decimal-format definitions
dfm
- the DecimalFormatManager containing the named xsl:decimal-format definitions
setDefaultCollationName
public void setDefaultCollationName(String name)
Set the default collation
name
- the name of the default collation
setDefaultOutputProperties
public void setDefaultOutputProperties(Properties properties)
Set the default output properties (the properties for the unnamed output format)
properties
- the output properties to be used when the unnamed output format
is selected
setFunctionLibrary
public void setFunctionLibrary(FunctionLibrary functionLibrary)
Set the library containing all the in-scope functions in the static context
functionLibrary
- the function libary
setHostLanguage
public void setHostLanguage(int language)
Set the host language
setKeyManager
public void setKeyManager(KeyManager km)
Set the KeyManager which handles key definitions
km
- the KeyManager containing the xsl:key definitions
setLocationMap
public void setLocationMap(LocationMap map)
Set the location map
map
- the location map, which is used to identify the module URI and line number of locations of errors
setOutputProperties
public void setOutputProperties(StructuredQName qName,
Properties properties)
Add a named output format
qName
- the structured QName of the output formatproperties
- the properties of the output format
setPatternSlotSpace
public void setPatternSlotSpace(int patternLocals)
Set the space requirements for variables used in template match patterns
patternLocals
- The largest number of local variables used in the match pattern of any template rule
setReasonUnableToCompile
public void setReasonUnableToCompile(String reason)
If this Executable can't be compiled, set a message explaining why
reason
- a message explaining why compilation is not possible
setRuleManager
public void setRuleManager(RuleManager rm)
Set the RuleManager that handles template rules
rm
- the RuleManager containing details of all the template rules
setStripperRules
public void setStripperRules(Mode rules)
Set the rules determining which nodes are to be stripped from the tree
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.
setStripsInputTypeAnnotations
public void setStripsInputTypeAnnotations(boolean strips)
Set whether source documents are to have their type annotations stripped
strips
- true if type annotations are to be stripped
setStripsWhitespace
public void setStripsWhitespace(boolean strips)
Indicate that the stylesheet does some whitespace stripping
strips
- true if the stylesheet performs whitespace stripping
of one or more elements.
stripsInputTypeAnnotations
public boolean stripsInputTypeAnnotations()
Ask whether source documents are to have their type annotations stripped
- true if type annotations are stripped from source documents
stripsWhitespace
public boolean stripsWhitespace()
Determine whether this stylesheet does any whitespace stripping
- true if the stylesheet performs whitespace stripping
of one or more elements.