|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.saxon.Configuration
This class holds details of user-selected configuration options for a transformation or query. When running XSLT, the preferred way of setting configuration options is via the JAXP TransformerFactory interface, but the Configuration object provides a finer level of control. As yet there is no standard API for XQuery, so the only way of setting Configuration information is to use the methods on this class directly.
Since Saxon 8.4, the JavaDoc documentation for Saxon attempts to identify interfaces that are considered stable, and will only be changed in a backwards-incompatible way if there is an overriding reason to do so. These interfaces and methods are labelled with the JavaDoc "since" tag. The value 8.n indicates a method in this category that was introduced in Saxon version 8.n: or in the case of 8.4, that was present in Saxon 8.4 and possibly in earlier releases. (In some cases, these methods have been unchanged for a long time.) Methods without a "since" tag, although public, are provided for internal use or for use by advanced users, and are subject to change from one release to the next. The presence of a "since" tag on a class or interface indicates that there are one or more methods in the class that are considered stable; it does not mean that all methods are stable.
Field Summary | |
static int |
DO_NOT_RECOVER
Constant indicating that when a recoverable error occurs, the processor should not attempt to take the defined recovery action, but should terminate with an error. |
static int |
JAVA_APPLICATION
Constant indicating that the host language is Java: that is, this is a free-standing Java application with no XSLT or XQuery content |
protected javax.xml.transform.ErrorListener |
listener
|
protected Optimizer |
optimizer
|
static int |
RECOVER_SILENTLY
Constant indicating that the processor should take the recovery action when a recoverable error occurs, with no warning message. |
static int |
RECOVER_WITH_WARNINGS
Constant indicating that the processor should produce a warning when a recoverable error occurs, and should then take the recovery action and continue. |
protected int |
recoveryPolicy
|
protected VendorFunctionLibrary |
vendorFunctionLibrary
|
static int |
XML_SCHEMA
Constant indicating that the "host language" is XML Schema |
static int |
XML10
Constant indicating the XML Version 1.0 |
static int |
XML11
Constant indicating the XML Version 1.1 |
static int |
XPATH
Constant indicating that the host language is XPATH itself - that is, a free-standing XPath environment |
static int |
XQUERY
Constant indicating that the host language is XQuery |
static int |
XSLT
Constant indicating that the host language is XSLT |
Constructor Summary | |
Configuration()
Create a configuration object with default settings for all options. |
Method Summary | |
void |
addSchema(java.lang.Object schema)
Add a schema to the cache. |
void |
addSchemaSource(javax.xml.transform.Source schemaSource)
Load a schema, which will be available for use by all subsequent operations using this Configuration. |
boolean |
areAllNodesUntyped()
Determine whether all nodes encountered within this query or transformation are guaranteed to be untyped |
void |
displayLicenseMessage()
Display a message about the license status |
ExternalObjectModel |
findExternalObjectModel(java.lang.Object node)
Find the external object model corresponding to a given node. |
Receiver |
getAnnotationStripper(Receiver destination)
Add to a pipeline a receiver that strips all type annotations. |
SchemaDeclaration |
getAttributeDeclaration(int fingerprint)
Get a global attribute declaration. |
java.lang.Class |
getClass(java.lang.String className,
boolean tracing,
java.lang.ClassLoader classLoader)
Load a class using the class name provided. |
java.lang.ClassLoader |
getClassLoader()
Get the ClassLoader supplied using the method setClassLoader(java.lang.ClassLoader) . |
CollationURIResolver |
getCollationURIResolver()
Get the collation URI resolver associated with this configuration. |
CollectionURIResolver |
getCollectionURIResolver()
Get the collection URI resolver associated with this configuration. |
static Configuration |
getConfiguration(XPathContext context)
Get the configuration, given the context. |
java.lang.Object |
getConfigurationProperty(java.lang.String name)
Get a property of the configuration |
XPathContext |
getConversionContext()
Get an XPathContext object with sufficient capability to perform comparisons and conversions |
Debugger |
getDebugger()
Get the debugger in use. |
DocumentNumberAllocator |
getDocumentNumberAllocator()
Get the document number allocator. |
Receiver |
getDocumentValidator(Receiver receiver,
java.lang.String systemId,
NamePool namePool,
int validationMode,
int stripSpace,
SchemaType schemaType)
Get a document-level validator to add to a Receiver pipeline. |
SchemaDeclaration |
getElementDeclaration(int fingerprint)
Get a global element declaration. |
Receiver |
getElementValidator(Receiver receiver,
int nameCode,
int locationId,
SchemaType schemaType,
int validation,
NamePool pool)
Get a Receiver that can be used to validate an element, and that passes the validated element on to a target receiver. |
javax.xml.transform.ErrorListener |
getErrorListener()
Get the ErrorListener used in this configuration. |
FunctionLibrary |
getExtensionBinder()
Get the FunctionLibrary used to bind calls on extension functions. |
ExtensionFunctionFactory |
getExtensionFunctionFactory()
Get an ExtensionFunctionFactory. |
java.util.List |
getExternalObjectModels()
Get all the registered external object models. |
int |
getHostLanguage()
Get the host language used in this configuration. |
int |
getImplicitTimezone()
Get the implicit timezone, as a positive or negative offset from UTC in minutes. |
java.util.Set |
getImportedNamespaces()
Get the set of namespaces of imported schemas |
java.lang.Object |
getInstance(java.lang.String className,
java.lang.ClassLoader classLoader)
Instantiate a class using the class name provided. |
static java.util.Locale |
getLocale(java.lang.String lang)
Get a locale given a language code in XML format. |
java.lang.String |
getMessageEmitterClass()
Get the name of the class that will be instantiated to create a MessageEmitter, to process the output of xsl:message instructions in XSLT. |
ModuleURIResolver |
getModuleURIResolver()
Get the user-defined ModuleURIResolver for resolving URIs used in "import module" declarations in the XQuery prolog; returns null if none has been explicitly set. |
NameChecker |
getNameChecker()
Get a class that can be used to check names against the selected XML version |
NamePool |
getNamePool()
Get the target namepool to be used for stylesheets/queries and for source documents. |
Optimizer |
getOptimizer()
Factory method to get an Optimizer. |
Receiver |
getOutputMethod(java.lang.String clarkName)
Get a configuration-defined output method. |
OutputURIResolver |
getOutputURIResolver()
Get the OutputURIResolver that will be used to resolve URIs used in the href attribute of the xsl:result-document instruction. |
Platform |
getPlatform()
Get the Platform to be used for platform-dependent methods |
java.lang.String |
getProductTitle()
Get a message used to identify this product when a transformation is run using the -t option |
int |
getRecoveryPolicy()
Determine how recoverable run-time errors are to be handled. |
java.lang.Object |
getSchema(java.lang.String namespace)
Get a schema from the cache. |
SchemaType |
getSchemaType(int fingerprint)
Get the top-level schema type definition with a given fingerprint. |
SchemaURIResolver |
getSchemaURIResolver()
Get the user-defined SchemaURIResolver for resolving URIs used in "import schema" declarations; if none has been explicitly set, returns null. |
int |
getSchemaValidationMode()
Determine whether source documents (supplied as a StreamSource or SAXSource) should be subjected to schema validation |
org.xml.sax.XMLReader |
getSourceParser()
Get a parser for source documents. |
java.lang.String |
getSourceParserClass()
Get the name of the class that will be instantiated to create an XML parser for parsing source documents (for example, documents loaded using the document() or doc() functions). |
SourceResolver |
getSourceResolver()
Get the current SourceResolver. |
ModuleURIResolver |
getStandardModuleURIResolver()
Get the standard system-defined ModuleURIResolver for resolving URIs used in "import module" declarations in the XQuery prolog. |
int |
getStripsWhiteSpace()
Set which kinds of whitespace-only text node should be stripped. |
org.xml.sax.XMLReader |
getStyleParser()
Get the parser for stylesheet documents. |
java.lang.String |
getStyleParserClass()
Get the name of the class that will be instantiated to create an XML parser for parsing stylesheet modules. |
StandardURIResolver |
getSystemURIResolver()
Get the system-defined URI Resolver. |
TraceListener |
getTraceListener()
Get the TraceListener used for run-time tracing of instruction execution. |
int |
getTreeModel()
Get the Tree Model used by this Configuration. |
javax.xml.transform.URIResolver |
getURIResolver()
Get the URIResolver used in this configuration |
VendorFunctionLibrary |
getVendorFunctionLibrary()
Get the FunctionLibrary used to bind calls on Saxon-defined extension functions. |
int |
getXMLVersion()
Get the XML version to be used by default for validating characters and names |
protected void |
init()
|
boolean |
isAllowExternalFunctions()
Determine whether calls to external Java functions are permitted. |
boolean |
isLazyConstructionMode()
Determine whether lazy construction mode is on or off. |
boolean |
isLineNumbering()
Determine whether source documents will maintain line numbers, for the benefit of the saxon:line-number() extension function as well as run-time tracing. |
boolean |
isMultiThreading()
Determine whether multithreading optimizations are allowed |
boolean |
isRetainDTDAttributeTypes()
Determine whether attribute types obtained from a DTD are to be used to set type annotations on the resulting nodes |
boolean |
isSchemaAware(int language)
Determine if the configuration is schema-aware, for the given host language |
boolean |
isSealedNamespace(java.lang.String namespace)
Test whether a schema namespace is sealed. |
boolean |
isStripsAllWhiteSpace()
Determine whether whitespace-only text nodes are to be stripped unconditionally from source documents. |
boolean |
isTiming()
Determine whether brief progress messages and timing information will be output to System.err. |
boolean |
isTraceExternalFunctions()
Determine whether calls on external functions are to be traced for diagnostic purposes. |
boolean |
isValidation()
Determine whether the XML parser for source documents will be asked to perform DTD validation of source documents |
boolean |
isValidationWarnings()
Determine whether schema validation failures on result documents are to be treated as fatal errors or as warnings. |
boolean |
isVersionWarning()
Determine whether a warning is to be output when running against a stylesheet labelled as version="1.0". |
java.util.Comparator |
makeCollator(java.lang.String className)
Load a named collator class and check it is OK. |
org.xml.sax.XMLReader |
makeParser(java.lang.String className)
Create a new SAX XMLReader object using the class name provided. |
PipelineConfiguration |
makePipelineConfiguration()
Make a PipelineConfiguration from the properties of this Configuration |
static Configuration |
makeSchemaAwareConfiguration(java.lang.ClassLoader classLoader)
Static method to instantiate a schema-aware configuration. |
SlotManager |
makeSlotManager()
Factory method to create a SlotManager. |
NodeTest |
makeSubstitutionGroupTest(SchemaDeclaration elementDecl)
Make a test for elements corresponding to a give element declaration. |
TraceListener |
makeTraceListener(java.lang.String className)
Create an instance of a TraceListener with a specified class name |
javax.xml.transform.URIResolver |
makeURIResolver(java.lang.String className)
Create an instance of a URIResolver with a specified class name |
java.lang.String |
readInlineSchema(NodeInfo root,
java.lang.String expected)
Read an inline schema from a stylesheet. |
void |
readMultipleSchemas(PipelineConfiguration pipe,
java.lang.String baseURI,
java.util.List schemaLocations,
java.lang.String expected)
Read schemas from a list of schema locations. |
java.lang.String |
readSchema(PipelineConfiguration pipe,
java.lang.String baseURI,
java.lang.String schemaLocation,
java.lang.String expected)
Read a schema from a given schema location |
void |
registerExternalObjectModel(ExternalObjectModel model)
Register an external object model with this Configuration. |
void |
reportFatalError(XPathException err)
Report a fatal error |
javax.xml.transform.Source |
resolveSource(javax.xml.transform.Source source,
Configuration config)
Implement the SourceResolver interface |
void |
reuseSourceParser(org.xml.sax.XMLReader parser)
Return a source parser to the pool, for reuse |
void |
reuseStyleParser(org.xml.sax.XMLReader parser)
Return a stylesheet (or schema) parser to the pool, for reuse |
void |
sealNamespace(java.lang.String namespace)
Mark a schema namespace as being sealed. |
void |
setAllNodesUntyped(boolean allUntyped)
Specify that all nodes encountered within this query or transformation will be untyped |
void |
setAllowExternalFunctions(boolean allowExternalFunctions)
Determine whether calls to external Java functions are permitted. |
void |
setClassLoader(java.lang.ClassLoader loader)
Set a ClassLoader to be used when loading external classes. |
void |
setCollationURIResolver(CollationURIResolver resolver)
Set a CollationURIResolver to be used to resolve collation URIs (that is, to take a URI identifying a collation, and return the corresponding collation). |
void |
setCollectionURIResolver(CollectionURIResolver resolver)
Set a CollectionURIResolver to be used to resolve collection URIs (that is, the URI supplied in a call to the collection() function). |
void |
setConfigurationProperty(java.lang.String name,
java.lang.Object value)
Set a property of the configuration. |
void |
setDebugger(Debugger debugger)
Set the debugger to be used. |
void |
setErrorListener(javax.xml.transform.ErrorListener listener)
Set the ErrorListener to be used in this configuration. |
void |
setExtensionBinder(FunctionLibrary binder)
Set the FunctionLibrary used to bind calls on extension functions. |
void |
setExtensionFunctionFactory(ExtensionFunctionFactory factory)
Set an ExtensionFunctionFactory. |
void |
setHostLanguage(int hostLanguage)
Set the host language used in this configuration. |
void |
setImplicitTimezone(int minutes)
Set the implicit timezone, as a positive or negative offset from UTC in minutes. |
void |
setLazyConstructionMode(boolean lazy)
Set lazy construction mode on or off. |
void |
setLineNumbering(boolean lineNumbering)
Determine whether source documents will maintain line numbers, for the benefit of the saxon:line-number() extension function as well as run-time tracing. |
void |
setMessageEmitterClass(java.lang.String messageEmitterClass)
Set the name of the class that will be instantiated to create a MessageEmitter, to process the output of xsl:message instructions in XSLT. |
void |
setModuleURIResolver(ModuleURIResolver resolver)
Set a user-defined ModuleURIResolver for resolving URIs used in "import module" declarations in an XQuery prolog. |
void |
setModuleURIResolver(java.lang.String className)
Create and register an instance of a ModuleURIResolver with a specified class name. |
void |
setMultiThreading(boolean multithreading)
Set whether multithreading optimizations are allowed |
void |
setNamePool(NamePool targetNamePool)
Set the NamePool to be used for stylesheets/queries and for source documents. |
void |
setOutputURIResolver(OutputURIResolver outputURIResolver)
Set the OutputURIResolver that will be used to resolve URIs used in the href attribute of the xsl:result-document instruction. |
void |
setPlatform(Platform platform)
Set the Platform to be used for platform-dependent methods |
void |
setRecoveryPolicy(int recoveryPolicy)
Determine how recoverable run-time errors are to be handled. |
void |
setRetainDTDAttributeTypes(boolean useTypes)
Determine whether attribute types obtained from a DTD are to be used to set type annotations on the resulting nodes. |
void |
setSchemaURIResolver(SchemaURIResolver resolver)
Set a user-defined SchemaURIResolver for resolving URIs used in "import schema" declarations. |
void |
setSchemaValidationMode(int validationMode)
Indicate whether source documents (supplied as a StreamSource or SAXSource) should be subjected to schema validation |
void |
setSourceParserClass(java.lang.String sourceParserClass)
Set the name of the class that will be instantiated to create an XML parser for parsing source documents (for example, documents loaded using the document() or doc() functions). |
void |
setSourceResolver(SourceResolver resolver)
Supply a SourceResolver |
void |
setStripsAllWhiteSpace(boolean stripsAllWhiteSpace)
Determine whether whitespace-only text nodes are to be stripped unconditionally from source documents. |
void |
setStripsWhiteSpace(int kind)
Set which kinds of whitespace-only text node should be stripped. |
void |
setStyleParserClass(java.lang.String styleParserClass)
Set the name of the class that will be instantiated to create an XML parser for parsing stylesheet modules. |
void |
setTiming(boolean timing)
Determine whether brief progress messages and timing information will be output to System.err. |
void |
setTraceExternalFunctions(boolean traceExternalFunctions)
Determine whether calls on external functions are to be traced for diagnostic purposes. |
void |
setTraceListener(TraceListener traceListener)
Set the TraceListener to be used for run-time tracing of instruction execution. |
void |
setTreeModel(int treeModel)
Set the Tree Model used by this Configuration. |
void |
setURIResolver(javax.xml.transform.URIResolver resolver)
Set the URIResolver to be used in this configuration. |
void |
setValidation(boolean validation)
Determine whether the XML parser for source documents will be asked to perform DTD validation of source documents |
void |
setValidationWarnings(boolean warn)
Indicate whether schema validation failures on result documents are to be treated as fatal errors or as warnings. |
void |
setVersionWarning(boolean warn)
Determine whether a warning is to be output when running against a stylesheet labelled as version="1.0". |
void |
setXMLVersion(int version)
Set the XML version to be used by default for validating characters and names |
int |
validateAttribute(int nameCode,
java.lang.CharSequence value,
int validation)
Validate an attribute value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected transient javax.xml.transform.ErrorListener listener
protected VendorFunctionLibrary vendorFunctionLibrary
protected int recoveryPolicy
protected Optimizer optimizer
public static final int RECOVER_SILENTLY
public static final int RECOVER_WITH_WARNINGS
public static final int DO_NOT_RECOVER
public static final int XML10
public static final int XML11
public static final int XSLT
public static final int XQUERY
public static final int XML_SCHEMA
public static final int JAVA_APPLICATION
public static final int XPATH
Constructor Detail |
public Configuration()
new Configuration(true)
.
Method Detail |
protected void init()
public static Configuration makeSchemaAwareConfiguration(java.lang.ClassLoader classLoader) throws java.lang.RuntimeException
classLoader
- - the class loader to be used. If null, the context class loader for the current
thread is used.
java.lang.RuntimeException
- if the Saxon-SA
product cannot be loaded or if no license key is available.public java.lang.String getProductTitle()
public boolean isSchemaAware(int language)
language
- the required host language: XSLT, XQUERY, or XML_SCHEMApublic void displayLicenseMessage()
public int getHostLanguage()
This method is problematic because it is possible to run multiple transformations
or queries within the same configuration. The method is therefore best avoided.
Instead, use Executable.getHostLanguage()
.
Internally its only use is in deciding (in Saxon-SA only) which error listener to
use by default at compile time, and since the standard XSLT and XQuery listeners have
no differences when used for static errors, the choice is immaterial.
public void setHostLanguage(int hostLanguage)
hostLanguage
- Configuration.XSLT or Configuration.XQUERYpublic void setPlatform(Platform platform)
platform
- the platform to be usedpublic Platform getPlatform()
public javax.xml.transform.URIResolver getURIResolver()
public void setURIResolver(javax.xml.transform.URIResolver resolver)
resolver
- The URIResolver to be used.public StandardURIResolver getSystemURIResolver()
public javax.xml.transform.URIResolver makeURIResolver(java.lang.String className) throws javax.xml.transform.TransformerException
className
- The fully-qualified name of the URIResolver class
javax.xml.transform.TransformerException
- if the requested class does not
implement the javax.xml.transform.URIResolver interfacepublic javax.xml.transform.ErrorListener getErrorListener()
public void setErrorListener(javax.xml.transform.ErrorListener listener)
listener
- the ErrorListener to be usedpublic void reportFatalError(XPathException err)
public void setMultiThreading(boolean multithreading)
public boolean isMultiThreading()
public void setXMLVersion(int version)
version
- one of the constants XML10 or XML11public int getXMLVersion()
public NameChecker getNameChecker()
public XPathContext getConversionContext()
public int getTreeModel()
public void setTreeModel(int treeModel)
treeModel
- the selected Tree Modelpublic boolean isLineNumbering()
public void setLineNumbering(boolean lineNumbering)
lineNumbering
- true if line numbers are maintained in source documentspublic TraceListener getTraceListener()
public void setTraceListener(TraceListener traceListener)
traceListener
- The TraceListener to be used.public TraceListener makeTraceListener(java.lang.String className) throws XPathException
className
- The fully qualified class name of the TraceListener to
be constructed
XPathException
- if the requested class does not
implement the net.sf.saxon.trace.TraceListener interfacepublic void setExtensionBinder(FunctionLibrary binder)
When an application supplies its own FunctionLibrary for binding extension functions,
this replaces the default binding mechanism for Java extension functions, namely
JavaExtensionLibrary
. It thus disables the function libraries
for built-in Saxon extensions and for EXSLT extensions. It is possible to create a
function library that adds to the existing mechanisms, rather than replacing them,
by supplying as the FunctionLibrary a FunctionLibraryList
that itself contains two FunctionLibrary objects: a JavaExtensionLibrary, and a user-written
FunctionLibrary.
binder
- The FunctionLibrary object used to locate implementations of extension
functions, based on their name and aritysetExtensionFunctionFactory(net.sf.saxon.functions.ExtensionFunctionFactory)
public FunctionLibrary getExtensionBinder()
This mechanism is for advanced users only, and the details are subject to change.
public VendorFunctionLibrary getVendorFunctionLibrary()
This method is intended for internal use only.
public void setCollationURIResolver(CollationURIResolver resolver)
Note that it is undefined whether collation URIs are resolved at compile time or at run-time. It is therefore inadvisable to change the CollationURIResolver after compiling a query or stylesheet and before running it.
resolver
- the collation URI resolver to be used. This replaces any collation
URI resolver previously registered.public CollationURIResolver getCollationURIResolver()
setCollationURIResolver(net.sf.saxon.sort.CollationURIResolver)
method; if this has not been called, it returns the system-defined collation URI resolver
public void setCollectionURIResolver(CollectionURIResolver resolver)
Collection URIs are always resolved at run-time, using the CollectionURIResolver in force at the time the collection() function is called.
resolver
- the collection URI resolver to be used. This replaces any collection
URI resolver previously registered.public CollectionURIResolver getCollectionURIResolver()
setCollectionURIResolver(net.sf.saxon.CollectionURIResolver)
method; if this has not been called, it returns the system-defined collection URI resolver
public void setModuleURIResolver(ModuleURIResolver resolver)
public void setModuleURIResolver(java.lang.String className) throws javax.xml.transform.TransformerException
className
- The fully-qualified name of the LocationHintResolver class
javax.xml.transform.TransformerException
- if the requested class does not
implement the net.sf.saxon.LocationHintResolver interfacepublic ModuleURIResolver getModuleURIResolver()
public ModuleURIResolver getStandardModuleURIResolver()
public void setSchemaURIResolver(SchemaURIResolver resolver)
public SchemaURIResolver getSchemaURIResolver()
public int getRecoveryPolicy()
RECOVER_SILENTLY
,
RECOVER_WITH_WARNINGS
, or DO_NOT_RECOVER
.public void setRecoveryPolicy(int recoveryPolicy)
recoveryPolicy
- the recovery policy to be used. The options are RECOVER_SILENTLY
,
RECOVER_WITH_WARNINGS
, or DO_NOT_RECOVER
.public java.lang.String getMessageEmitterClass()
public void setMessageEmitterClass(java.lang.String messageEmitterClass)
messageEmitterClass
- the full class name of the message emitter class. This
must implement net.sf.saxon.event.Emitter.public java.lang.String getSourceParserClass()
This method is retained in Saxon for backwards compatibility, but the preferred way of choosing an XML parser is to use JAXP interfaces, for example by supplying a JAXP Source object initialized with an appropriate implementation of org.xml.sax.XMLReader.
public void setSourceParserClass(java.lang.String sourceParserClass)
This method is retained in Saxon for backwards compatibility, but the preferred way of choosing an XML parser is to use JAXP interfaces, for example by supplying a JAXP Source object initialized with an appropriate implementation of org.xml.sax.XMLReader.
sourceParserClass
- the fully qualified name of the XML parser class. This must implement
the SAX2 XMLReader interface.public java.lang.String getStyleParserClass()
This method is retained in Saxon for backwards compatibility, but the preferred way of choosing an XML parser is to use JAXP interfaces, for example by supplying a JAXP Source object initialized with an appropriate implementation of org.xml.sax.XMLReader.
public void setStyleParserClass(java.lang.String styleParserClass)
This method is retained in Saxon for backwards compatibility, but the preferred way of choosing an XML parser is to use JAXP interfaces, for example by supplying a JAXP Source object initialized with an appropriate implementation of org.xml.sax.XMLReader.
styleParserClass
- the fully qualified name of the XML parser classpublic OutputURIResolver getOutputURIResolver()
public void setOutputURIResolver(OutputURIResolver outputURIResolver)
outputURIResolver
- the OutputURIResolver to be used.public boolean isTiming()
This method is provided largely for internal use. Progress messages are normally controlled directly from the command line interfaces, and are not normally used when driving Saxon from the Java API.
public void setTiming(boolean timing)
This method is provided largely for internal use. Progress messages are normally controlled directly from the command line interfaces, and are not normally used when
timing
- true if these messages are to be output.public boolean isVersionWarning()
public void setVersionWarning(boolean warn)
warn
- true if these messages are to be output.public boolean isAllowExternalFunctions()
public void setAllowExternalFunctions(boolean allowExternalFunctions)
allowExternalFunctions
- true if external function calls are to be
permitted.public boolean isTraceExternalFunctions()
public void setRetainDTDAttributeTypes(boolean useTypes) throws javax.xml.transform.TransformerFactoryConfigurationError
useTypes
- set to true if DTD types are to be taken into account
javax.xml.transform.TransformerFactoryConfigurationError
public boolean isRetainDTDAttributeTypes()
public void setTraceExternalFunctions(boolean traceExternalFunctions)
traceExternalFunctions
- true if tracing is to be enabled
for calls to external Java functionspublic ExtensionFunctionFactory getExtensionFunctionFactory()
This mechanism is intended for advanced use only, and is subject to change.
public void setExtensionFunctionFactory(ExtensionFunctionFactory factory)
This mechanism is intended for advanced use only, and is subject to change.
setExtensionBinder(net.sf.saxon.functions.FunctionLibrary)
public boolean isValidation()
public void setValidation(boolean validation)
validation
- true if DTD validation is to be requested.public void setAllNodesUntyped(boolean allUntyped)
public boolean areAllNodesUntyped()
public int getSchemaValidationMode()
Validation.STRIP
otherwise.public void setSchemaValidationMode(int validationMode)
validationMode
- the validation (or construction) mode to be used for source documents.
One of Validation.STRIP
, Validation.PRESERVE
, Validation.STRICT
,
Validation.LAX
public void setValidationWarnings(boolean warn)
warn
- true if schema validation failures are to be treated as warnings; false if they
are to be treated as fatal errors.public boolean isValidationWarnings()
public NamePool getNamePool()
public void setNamePool(NamePool targetNamePool)
Normally all transformations and queries run under a single Java VM share the same NamePool. This creates a potential bottleneck, since changes to the namepool are synchronized. It is possible therefore to allocate a distinct NamePool to each Configuration. This requires considerable care and should only be done when the default arrangement is found to cause problems. There is a basic rule to follow: any compiled stylesheet or query must use the same NamePool as its source and result documents.
targetNamePool
- The NamePool to be used.public DocumentNumberAllocator getDocumentNumberAllocator()
This is intended primarily for internal use
public boolean isStripsAllWhiteSpace()
public void setStripsAllWhiteSpace(boolean stripsAllWhiteSpace)
stripsAllWhiteSpace
- if all whitespace-only text nodes are to be stripped.public void setStripsWhiteSpace(int kind)
kind
- the kind of whitespace-only text node that should be stripped when building
a source tree. One of Whitespace.NONE
(none), Whitespace.ALL
(all),
or Whitespace.IGNORABLE
(element-content whitespace as defined in a DTD or schema)public int getStripsWhiteSpace()
Whitespace.NONE
(none), Whitespace.ALL
(all),
or Whitespace.IGNORABLE
(element-content whitespace as defined in a DTD or schema)public org.xml.sax.XMLReader getSourceParser() throws javax.xml.transform.TransformerFactoryConfigurationError
This method is intended primarily for internal use.
setValidation(boolean)
setting.
javax.xml.transform.TransformerFactoryConfigurationError
public void reuseSourceParser(org.xml.sax.XMLReader parser)
parser
- The parser: the caller must not supply a parser that was obtained by any
mechanism other than calling the getSourceParser() method.public org.xml.sax.XMLReader getStyleParser() throws javax.xml.transform.TransformerFactoryConfigurationError
This method is intended for internal use only.
javax.xml.transform.TransformerFactoryConfigurationError
public void reuseStyleParser(org.xml.sax.XMLReader parser)
parser
- The parser: the caller must not supply a parser that was obtained by any
mechanism other than calling the getStyleParser() method.public java.lang.String readSchema(PipelineConfiguration pipe, java.lang.String baseURI, java.lang.String schemaLocation, java.lang.String expected) throws javax.xml.transform.TransformerConfigurationException
This method is intended for internal use.
javax.xml.transform.TransformerConfigurationException
public void readMultipleSchemas(PipelineConfiguration pipe, java.lang.String baseURI, java.util.List schemaLocations, java.lang.String expected) throws SchemaException
This method is intended for internal use.
SchemaException
public java.lang.String readInlineSchema(NodeInfo root, java.lang.String expected) throws SchemaException
This method is intended for internal use.
root
- the xs:schema element in the stylesheetexpected
- the target namespace expected; null if there is no
expectation.
SchemaException
public void addSchemaSource(javax.xml.transform.Source schemaSource) throws SchemaException
schemaSource
- the JAXP Source object identifying the schema document to be loaded
SchemaException
- if the schema cannot be read or parsed or if it is invalid
java.lang.UnsupportedOperationException
- if the configuration is not schema-awarepublic void addSchema(java.lang.Object schema) throws javax.xml.transform.TransformerConfigurationException
This method is intended for internal use
schema
- an object of class javax.xml.validation.schema, which is not declared as such
to avoid creating a dependency on this JDK 1.5 class
javax.xml.transform.TransformerConfigurationException
public java.lang.Object getSchema(java.lang.String namespace)
This method is intended for internal use.
public java.util.Set getImportedNamespaces()
public void sealNamespace(java.lang.String namespace)
namespace
- the namespace URI of the components to be sealedpublic boolean isSealedNamespace(java.lang.String namespace)
namespace
- the namespace URI of the components to be tested
public SchemaDeclaration getElementDeclaration(int fingerprint)
This method is intended for internal use.
public SchemaDeclaration getAttributeDeclaration(int fingerprint)
This method is intended for internal use
public SchemaType getSchemaType(int fingerprint)
This method is intended for internal use and for use by advanced applications. (The SchemaType object returned cannot yet be considered a stable API, and may be superseded when a JAXP API for schema information is defined.)
fingerprint
- the fingerprint of the schema type
public Receiver getDocumentValidator(Receiver receiver, java.lang.String systemId, NamePool namePool, int validationMode, int stripSpace, SchemaType schemaType)
This method is intended for internal use.
receiver
- The receiver to which events should be sent after validationsystemId
- the base URI of the document being validatednamePool
- the namePool to be used by the validatorvalidationMode
- for example Validation.STRICT or Validation.STRIP. The integer may
also have the bit Validation.VALIDATE_OUTPUT set, indicating that the strean being validated
is to be treated as a final output stream (which means multiple errors can be reported)stripSpace
- schemaType
- The type against which the outermost element of the document must be validated
(null if there is no constraint)
public Receiver getElementValidator(Receiver receiver, int nameCode, int locationId, SchemaType schemaType, int validation, NamePool pool) throws XPathException
This method is intended for internal use.
receiver
- the target receiver tp receive the validated elementnameCode
- the nameCode of the element to be validated. This must correspond to the
name of an element declaration in a loaded schemaschemaType
- the schema type (typically a complex type) against which the element is to
be validatedvalidation
- The validation mode, for example Validation.STRICT or Validation.LAXpool
- The name pool
XPathException
public int validateAttribute(int nameCode, java.lang.CharSequence value, int validation) throws ValidationException
This method is intended for internal use.
nameCode
- the name of the attributevalue
- the value of the attribute as a stringvalidation
- STRICT or LAX
ValidationException
- if the value is invalidpublic Receiver getAnnotationStripper(Receiver destination)
This method is intended for internal use.
public NodeTest makeSubstitutionGroupTest(SchemaDeclaration elementDecl)
This method is intended for internal use.
public org.xml.sax.XMLReader makeParser(java.lang.String className) throws javax.xml.transform.TransformerFactoryConfigurationError
The named class must exist and must implement the
org.xml.sax.XMLReader or Parser interface.
This method returns an instance of the parser named.
This method is intended for internal use.
className
- A string containing the name of the
SAX parser class, for example "com.microstar.sax.LarkDriver"
javax.xml.transform.TransformerFactoryConfigurationError
public static java.util.Locale getLocale(java.lang.String lang)
This method is intended for internal use.
public void setDebugger(Debugger debugger)
This method is provided for advanced users only, and is subject to change.
public Debugger getDebugger()
This method is provided for advanced users only, and is subject to change.
public SlotManager makeSlotManager()
This method is provided for advanced users only, and is subject to change.
public Optimizer getOptimizer()
This method is intended for internal use only.
public void setClassLoader(java.lang.ClassLoader loader)
This method is intended for external use by advanced users, but should be regarded as experimental.
public java.lang.ClassLoader getClassLoader()
setClassLoader(java.lang.ClassLoader)
.
If none has been supplied, return null.
This method is intended for external use by advanced users, but should be regarded as experimental.
public java.lang.Class getClass(java.lang.String className, boolean tracing, java.lang.ClassLoader classLoader) throws XPathException
This method is intended for internal use only.
className
- A string containing the name of the
class, for example "com.microstar.sax.LarkDriver"classLoader
- The ClassLoader to be used to load the class. If this is null, then
the classLoader used will be the first one available of: the classLoader registered
with the Configuration using setClassLoader(java.lang.ClassLoader)
; the context class loader for
the current thread; or failing that, the class loader invoked implicitly by a call
of Class.forName() (which is the ClassLoader that was used to load the Configuration
object itself).
XPathException
- if the class cannot be loaded.public java.lang.Object getInstance(java.lang.String className, java.lang.ClassLoader classLoader) throws XPathException
This method is intended for internal use only.
className
- A string containing the name of the
class, for example "com.microstar.sax.LarkDriver"classLoader
- The ClassLoader to be used to load the class. If this is null, then
the classLoader used will be the first one available of: the classLoader registered
with the Configuration using setClassLoader(java.lang.ClassLoader)
; the context class loader for
the current thread; or failing that, the class loader invoked implicitly by a call
of Class.forName() (which is the ClassLoader that was used to load the Configuration
object itself).
XPathException
- if the class cannot be loaded.public java.util.Comparator makeCollator(java.lang.String className) throws XPathException
This method is intended for internal use only.
XPathException
public void setLazyConstructionMode(boolean lazy)
lazy
- true to switch lazy construction mode on, false to switch it off.public boolean isLazyConstructionMode()
public void registerExternalObjectModel(ExternalObjectModel model)
model
- The external object model.
This can either be one of the system-supplied external
object models for JDOM, XOM, or DOM, or a user-supplied external object model.
This method is intended for advanced users only, and is subject to change.
public ExternalObjectModel findExternalObjectModel(java.lang.Object node)
This method is intended for internal use only.
node
- a Node as implemented in some external object model
public java.util.List getExternalObjectModels()
This method is intended for internal use only.
public PipelineConfiguration makePipelineConfiguration()
public void setImplicitTimezone(int minutes)
public int getImplicitTimezone()
setImplicitTimezone(int)
, or failing that
the timezone from the system clock at the time the Configuration was created.public static Configuration getConfiguration(XPathContext context)
public void setSourceResolver(SourceResolver resolver)
public SourceResolver getSourceResolver()
public javax.xml.transform.Source resolveSource(javax.xml.transform.Source source, Configuration config) throws XPathException
resolveSource
in interface SourceResolver
source
- A source object, typically the source supplied as the first
argument to Transformer.transform(javax.xml.transform.Source, javax.xml.transform.Result)
or similar methods.config
- The Configuration. This provides the SourceResolver with access to
configuration information; it also allows the SourceResolver to invoke the
resolveSource() method on the Configuration object as a fallback implementation.
NodeInfo
,
or PullSource
. Return null if the Source object is not
recognized
XPathException
- if the Source object is recognized but cannot be processedpublic Receiver getOutputMethod(java.lang.String clarkName)
public void setConfigurationProperty(java.lang.String name, java.lang.Object value)
name
- the URI identifying the property to be setvalue
- the value of the property
java.lang.IllegalArgumentException
- if the property name is not recognizedpublic java.lang.Object getConfigurationProperty(java.lang.String name)
name
- the name of the required property
java.lang.IllegalArgumentException
- thrown if the property is not one that Saxon recognizes.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |