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 |
---|---|
StylesheetPackage |
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
|
LocationMap |
getLocationMap()
Get the LocationMap which keeps track of module and line number information
for diagnostics
|
PackageData |
getPackageData()
Get information about the package that was compiled in the course of this Compilation
|
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,DocumentInfo> |
getStylesheetModules()
Get the map of stylesheet modules.
|
StylesheetPackage |
getStylesheetPackage()
Get the (most recent) stylesheet package compiled using this Compilation
|
DecimalValue |
getVersion()
Get the XSLT version number that appeared at the outermost level of the root module (typically the
version attribute on the xsl:package or xsl:stylesheet element)
|
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 |
setSchemaAware(boolean schemaAware)
Say that this compilation is schema-aware.
|
void |
setVersion(DecimalValue v)
Internal method called during the compilation of a package to register the XSLT version number that
appeared at the outermost level of the root module (typically the version attribute on the xsl:package or
xsl:stylesheet element)
|
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 StylesheetPackage 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 LocationMap getLocationMap()
public CompilerInfo getCompilerInfo()
public PackageData getPackageData()
public void setVersion(DecimalValue v)
v
- the version number as a decimal valuepublic DecimalValue getVersion()
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 StylesheetPackage getStylesheetPackage()
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,DocumentInfo> getStylesheetModules()
public Stack<DocumentURI> getImportStack()
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.