public class Executable
extends java.lang.Object
PreparedStylesheet
, which is a subclass.Modifier and Type | Field and Description |
---|---|
protected boolean |
schemaAware |
Constructor and Description |
---|
Executable(Configuration config)
Create a new Executable (a collection of stylesheet modules and/or query modules)
|
Modifier and Type | Method and Description |
---|---|
void |
addPackage(PackageData data)
Add information about a package
|
void |
addQueryLibraryModule(QueryModule module)
Add an XQuery library module to the configuration.
|
void |
addQueryLocationHintProcessed(java.lang.String uri)
Add a name to the list of query module location hints that have been
processed during the construction of this executable
|
Item |
checkInitialContextItem(Item contextItem,
XPathContext context)
Check that the supplied global context item meets all requirements, and perform any required
conversions or defaulting
|
void |
checkSuppliedParameters(GlobalParameterSet params)
Check the supplied parameters.
|
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 |
fixupQueryModules(QueryModule main)
Fix up global variables and functions in all query modules.
|
CharacterMapIndex |
getCharacterMapIndex()
Get the index of named character maps
|
Configuration |
getConfiguration()
Get the configuration
|
FunctionLibraryList |
getFunctionLibrary()
Get the library containing all the in-scope functions in the static context
|
GlobalContextRequirement |
getGlobalContextRequirement()
Get the constraints on the initial global context item
|
GlobalParam |
getGlobalParameter(StructuredQName name)
Get the global parameter with a given name, if there is one
|
java.util.Map<StructuredQName,GlobalParam> |
getGlobalParameters()
Get all the registered global parameters
|
int |
getHostLanguage()
Get the host language
|
java.util.Properties |
getOutputProperties()
Get the properties for xsl:output.
|
java.util.Properties |
getOutputProperties(StructuredQName qName)
Get a named output format
|
java.lang.Iterable<PackageData> |
getPackages()
Get information about the packages in this executable
|
SerializationProperties |
getPrimarySerializationProperties()
Get the primary output properties, that is, the output properties for the primary
result destination.
|
java.util.Iterator |
getQueryLibraryModules()
Get an iterator over all the query library modules (does not include the main module)
|
java.util.List<QueryModule> |
getQueryLibraryModules(java.lang.String namespace)
Locate the known XQuery library modules for a given module namespace.
|
QueryModule |
getQueryModuleWithSystemId(java.lang.String systemId,
QueryModule topModule)
Get the query library module with a given systemID
|
PackageData |
getTopLevelPackage() |
boolean |
isQueryLocationHintProcessed(java.lang.String uri)
Ask whether a query module location hint has already been processed
|
boolean |
isSchemaAware()
Ask whether this executable is schema-aware, that is, whether the query or transformation
imports a schema.
|
void |
registerGlobalParameter(GlobalParam param)
Register a global parameter
|
void |
setCharacterMapIndex(CharacterMapIndex cmi)
Set the index of named character maps
|
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(java.util.Properties properties)
Set the default output properties (the properties for the unnamed output format)
|
void |
setFunctionLibrary(FunctionLibraryList functionLibrary)
Set the library containing all the in-scope functions in the static context
|
void |
setGlobalContextRequirement(GlobalContextRequirement requirement)
Set the accumulators declared on xsl:global-context-item
|
void |
setHostLanguage(int language)
Set the host language
|
void |
setOutputProperties(StructuredQName qName,
java.util.Properties properties)
Add a named output format
|
void |
setSchemaAware(boolean aware)
Set whether this executable is schema-aware.
|
void |
setTopLevelPackage(PackageData topLevelPackage) |
public Executable(Configuration config)
config
- the Saxon Configurationpublic void setConfiguration(Configuration config)
config
- the Configurationpublic Configuration getConfiguration()
public PackageData getTopLevelPackage()
public void setTopLevelPackage(PackageData topLevelPackage)
public void addPackage(PackageData data)
data
- information about a packagepublic java.lang.Iterable<PackageData> getPackages()
public void setHostLanguage(int language)
language
- the host language, as a constant such as Configuration.XSLT
or
Configuration.XQUERY
public int getHostLanguage()
Configuration.XQUERY
or Configuration.XSLT
or Configuration.JAVA_APPLICATION
public FunctionLibraryList getFunctionLibrary()
public void setFunctionLibrary(FunctionLibraryList functionLibrary)
functionLibrary
- the function libarypublic void setCharacterMapIndex(CharacterMapIndex cmi)
cmi
- a hash table that maps the names of character maps
to the HashMap objects representing the character mapspublic CharacterMapIndex getCharacterMapIndex()
public void setDefaultOutputProperties(java.util.Properties properties)
properties
- the output properties to be used when the unnamed output format
is selectedpublic SerializationProperties getPrimarySerializationProperties()
xsl:output
declarations in the top-level stylesheet package; in XQuery they are the properties
defined using "declare option output:x = 'value'"
.public void setOutputProperties(StructuredQName qName, java.util.Properties properties)
qName
- the structured QName of the output formatproperties
- the properties of the output formatpublic java.util.Properties getOutputProperties()
The returned 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.
This method gets the output properties for the unnamed output format in the stylesheet.
Transformer.setOutputProperties(java.util.Properties)
public java.util.Properties getOutputProperties(StructuredQName qName)
qName
- the name of the output formatpublic void addQueryLibraryModule(QueryModule module)
module
- the library module to be added to this executablepublic java.util.List<QueryModule> getQueryLibraryModules(java.lang.String namespace)
namespace
- the module namespace URIpublic QueryModule getQueryModuleWithSystemId(java.lang.String systemId, QueryModule topModule)
systemId
- the SystemId of the required moduletopModule
- the top-level query module (usually a main module, except when
importing library modules into XSLT)public java.util.Iterator getQueryLibraryModules()
QueryModule
public void addQueryLocationHintProcessed(java.lang.String uri)
uri
- the name to be added (the location URI as it appears in the
"import module" declaration, expanded to an absolute URI by resolving against
the base URI, but before passing to the Module Resolver)public boolean isQueryLocationHintProcessed(java.lang.String uri)
uri
- the query location hint (the location URI as it appears in the
"import module" declaration, expanded to an absolute URI by resolving against
the base URI, but before passing to the Module Resolver)public void fixupQueryModules(QueryModule main) throws XPathException
main
- the main query moduleXPathException
- if an error occurspublic void explainGlobalVariables(ExpressionPresenter presenter) throws XPathException
presenter
- the destination for the explanation of the global variablesXPathException
public void registerGlobalParameter(GlobalParam param)
param
- the stylesheet parameter (XSLT) or external variable (XQuery) to be registeredpublic java.util.Map<StructuredQName,GlobalParam> getGlobalParameters()
public GlobalParam getGlobalParameter(StructuredQName name)
name
- the parameter namepublic void checkSuppliedParameters(GlobalParameterSet params) throws XPathException
Used in XSLT only.
params
- the set of parameters that have been supplied (null represents an empty set)XPathException
- if there is a required parameter for which no value has been suppliedpublic void setCreatesSecondaryResult(boolean flag)
flag
- true if the executable uses xsl:result-documentpublic boolean createsSecondaryResult()
public void setGlobalContextRequirement(GlobalContextRequirement requirement)
requirement
- the requirements on the global context itempublic GlobalContextRequirement getGlobalContextRequirement()
public Item checkInitialContextItem(Item contextItem, XPathContext context) throws XPathException
contextItem
- the supplied context itemcontext
- a context for evaluation (in which the context item will be absent)XPathException
- if the supplied item does not meet requirements, for example if it is the
wrong type.public void setSchemaAware(boolean aware)
aware
- true if the executable is schema-awarejava.lang.IllegalArgumentException
- if schema-aware processing is requested in a Configuration
that is not schema-awarepublic boolean isSchemaAware()
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.