public class Compilation extends Object
Modifier and Type | Field and Description |
---|---|
static boolean |
TIMING |
Constructor and Description |
---|
Compilation(Configuration config,
CompilerInfo info)
Create a compilation object ready to perform an XSLT compilation
|
Modifier and Type | Method and Description |
---|---|
PrincipalStylesheetModule |
compilePackage(Source source)
Compile a stylesheet package
|
static PreparedStylesheet |
compileSingletonPackage(Configuration config,
CompilerInfo compilerInfo,
Source source)
Static factory method: Compile an XSLT stylesheet consisting of a single package
|
void |
declareStaticVariable(StructuredQName name,
GroundedValue value,
NestedIntegerValue precedence)
Declare a static variable
|
CompilerInfo |
getCompilerInfo()
Get the compilation options used by this compilation
|
Configuration |
getConfiguration()
Get the Saxon Configuration used by this Compilation
|
int |
getErrorCount()
Get the number of errors reported so far
|
Stack<DocumentURI> |
getImportStack()
Get the stack of include/imports, used to detect circularities
|
PackageData |
getPackageData()
Get information about the package that was compiled in the course of this Compilation
|
PrincipalStylesheetModule |
getPrincipalStylesheetModule()
Get the (most recent) stylesheet package compiled using this Compilation
|
int |
getProcessorVersion()
Get the XSLT processor version, determining whether processing should be done according to the XSLT 2.0
or XSLT 3.0 specification.
|
QNameParser |
getQNameParser()
Get the QNameParser for parsing QNames in this compilation
Note that the namespaceResolver will be unitialized
|
GroundedValue |
getStaticVariable(StructuredQName name)
Get the value of a static variable
|
StyleNodeFactory |
getStyleNodeFactory(boolean topLevel)
Get the StyleNodeFactory used to build the stylesheet tree
|
Map<DocumentURI,TreeInfo> |
getStylesheetModules()
Get the map of stylesheet modules.
|
boolean |
isSchemaAware()
Ask whether this compilation is schema-aware.
|
void |
reportError(XPathException err)
Report a compile time error.
|
void |
reportWarning(XPathException err)
Report a compile time warning.
|
void |
setMinimalPackageData() |
void |
setPackageData(PackageData pack) |
void |
setProcessorVersion(int v)
Set the XSLT processor version, determining whether processing should be done according to the XSLT 2.0
or XSLT 3.0 specification.
|
void |
setSchemaAware(boolean schemaAware)
Say that this compilation is schema-aware.
|
public static final boolean TIMING
public Compilation(Configuration config, CompilerInfo info)
config
- the Saxon Configurationinfo
- compilation optionspublic static PreparedStylesheet compileSingletonPackage(Configuration config, CompilerInfo compilerInfo, Source source) throws XPathException
config
- the Saxon ConfigurationcompilerInfo
- the compilation optionssource
- the source of the root stylesheet module in the package to be compiled. This may
contain an xsl:package element at its root, or it may be a conventional xsl:stylesheet or xsl:transform,
or a "simplified stylesheet" rooted at a literal result elementXPathException
- if any errors occur. The errors will have been reported to the ErrorListener
contained in the CompilerInfo.public void setPackageData(PackageData pack)
public void setMinimalPackageData()
public PrincipalStylesheetModule compilePackage(Source source) throws XPathException
source
- the XML document containing the top-level stylesheet module in the package,
which may be an xsl:package element, an xsl:stylesheet or xsl:transform element, or a
"simplified stylesheet" rooted at a literal result elementXPathException
- if any error occurs while compiling the packagepublic Configuration getConfiguration()
public CompilerInfo getCompilerInfo()
public PackageData getPackageData()
public void setProcessorVersion(int v)
v
- the version number times ten as an integer value. If the value is set to 3.0, an XSLT 3.0 processor will
be used; if any other value is supplied, an XSLT 2.0 processor is used.public int getProcessorVersion()
public boolean isSchemaAware()
xsl:import-schema
declaration or a
validation
attributepublic void setSchemaAware(boolean schemaAware)
xsl:import-schema
declaration is encountered.schemaAware
- true if the compilation is schema-aware.public StyleNodeFactory getStyleNodeFactory(boolean topLevel)
topLevel
- true if the factory is for the top-level (package) module of a packagepublic PrincipalStylesheetModule getPrincipalStylesheetModule()
public void reportError(XPathException err)
err
- the exception containing details of the errorpublic int getErrorCount()
public void reportWarning(XPathException err)
err
- an exception holding details of the warning condition to be
reportedpublic void declareStaticVariable(StructuredQName name, GroundedValue value, NestedIntegerValue precedence) throws XPathException
name
- the name of the variablevalue
- the value of the variableprecedence
- the import precedence in the form of a "decimal" value (e.g. 2.14.6)XPathException
- if, for example, the value of the variable is incompatible with other
variables having the same namepublic GroundedValue getStaticVariable(StructuredQName name)
name
- the name of the required variablepublic Map<DocumentURI,TreeInfo> getStylesheetModules()
public Stack<DocumentURI> getImportStack()
public QNameParser getQNameParser()
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.