|
||||||||||
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
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. |
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 |
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 |
Debugger |
getDebugger()
Get the debugger in use. |
Receiver |
getDocumentValidator(Receiver receiver,
java.lang.String systemId,
NamePool namePool,
int validationMode)
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. |
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. |
NamePool |
getNamePool()
Get the target namepool to be used for stylesheets/queries and for source documents. |
Optimizer |
getOptimizer()
Factory method to get an Optimizer |
OutputURIResolver |
getOutputURIResolver()
Get the OutputURIResolver that will be used to resolve URIs used in the href attribute of the xsl:result-document instruction. |
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 with a given fingerprint. |
int |
getSchemaValidationMode()
Determine whether source documents (supplied as a StreamSource or SAXSource) should be subjected to schema validation |
org.xml.sax.XMLReader |
getSourceParser()
Get the 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). |
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. |
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 |
boolean |
isAllowExternalFunctions()
Determine whether calls to external Java functions are permitted. |
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 |
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 |
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 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". |
static 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 |
SlotManager |
makeSlotManager()
Factory method to create a SlotManager |
NodeTest |
makeSubstitutionGroupTest(SchemaDeclaration elementDecl)
Make a test for elements corresponding to a give element declaration |
java.lang.String |
readInlineSchema(PipelineConfiguration pipe,
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 |
void |
registerStandardObjectModels()
Register the standard Saxon-supplied object models |
void |
reportValidationError(ValidationException err,
javax.xml.transform.ErrorListener listener,
boolean isOutput)
Report a validation error. |
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 |
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 |
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. |
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 |
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 |
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 |
setStripsAllWhiteSpace(boolean stripsAllWhiteSpace)
Determine whether whitespace-only text nodes are to be stripped unconditionally from source documents. |
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 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". |
long |
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 XSLT
public static final int XQUERY
public static final int XML_SCHEMA
Constructor Detail |
public Configuration()
Method Detail |
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()
public void setHostLanguage(int hostLanguage)
hostLanguage
- Configuration.XSLT or Configuration.XQUERYpublic javax.xml.transform.URIResolver getURIResolver()
public void setURIResolver(javax.xml.transform.URIResolver resolver)
resolver
- The URIResolver to be used.public javax.xml.transform.ErrorListener getErrorListener()
public void setErrorListener(javax.xml.transform.ErrorListener listener)
listener
- the ErrorListener to be usedpublic 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 void setExtensionBinder(FunctionLibrary binder)
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()
public VendorFunctionLibrary getVendorFunctionLibrary()
public int getRecoveryPolicy()
public void setRecoveryPolicy(int recoveryPolicy)
recoveryPolicy
- the recovery policy to be used.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()
public void setSourceParserClass(java.lang.String sourceParserClass)
sourceParserClass
- the fully qualified name of the XML parser class. This must implement
the SAX2 XMLReader interface.public java.lang.String getStyleParserClass()
public void setStyleParserClass(java.lang.String styleParserClass)
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()
public void setTiming(boolean timing)
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
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()
public void setExtensionFunctionFactory(ExtensionFunctionFactory factory)
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()
public void setSchemaValidationMode(int validationMode)
validationMode
- true if source documents should be validatedpublic void setValidationWarnings(boolean warn)
public boolean isValidationWarnings()
public void reportValidationError(ValidationException err, javax.xml.transform.ErrorListener listener, boolean isOutput) throws ValidationException
ValidationException
public NamePool getNamePool()
public void setNamePool(NamePool targetNamePool)
targetNamePool
- The NamePool to be used.public boolean isStripsAllWhiteSpace()
public void setStripsAllWhiteSpace(boolean stripsAllWhiteSpace)
stripsAllWhiteSpace
- if all whitespace-only text nodes are to be stripped.public org.xml.sax.XMLReader getSourceParser() throws javax.xml.transform.TransformerFactoryConfigurationError
javax.xml.transform.TransformerFactoryConfigurationError
public org.xml.sax.XMLReader getStyleParser() throws javax.xml.transform.TransformerFactoryConfigurationError
javax.xml.transform.TransformerFactoryConfigurationError
public java.lang.String readSchema(PipelineConfiguration pipe, java.lang.String baseURI, java.lang.String schemaLocation, java.lang.String expected) throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
public void readMultipleSchemas(PipelineConfiguration pipe, java.lang.String baseURI, java.util.List schemaLocations, java.lang.String expected) throws SchemaException
SchemaException
public java.lang.String readInlineSchema(PipelineConfiguration pipe, NodeInfo root, java.lang.String expected) throws SchemaException
pipe
- 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 invalidpublic void addSchema(java.lang.Object schema) throws javax.xml.transform.TransformerConfigurationException
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)
public SchemaDeclaration getElementDeclaration(int fingerprint)
public SchemaDeclaration getAttributeDeclaration(int fingerprint)
public SchemaType getSchemaType(int fingerprint)
fingerprint
- the fingerprint of the schema type
public Receiver getDocumentValidator(Receiver receiver, java.lang.String systemId, NamePool namePool, int validationMode)
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)
public Receiver getElementValidator(Receiver receiver, int nameCode, int locationId, SchemaType schemaType, int validation, NamePool pool) throws XPathException
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 long validateAttribute(int nameCode, java.lang.CharSequence value, int validation) throws ValidationException
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)
public NodeTest makeSubstitutionGroupTest(SchemaDeclaration elementDecl)
public static org.xml.sax.XMLReader makeParser(java.lang.String className) throws javax.xml.transform.TransformerFactoryConfigurationError
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)
public void setDebugger(Debugger debugger)
public Debugger getDebugger()
public SlotManager makeSlotManager()
public Optimizer getOptimizer()
public void registerStandardObjectModels()
public void registerExternalObjectModel(ExternalObjectModel model)
public ExternalObjectModel findExternalObjectModel(java.lang.Object node)
node
- a Node as implemented in some external object model
public java.util.List getExternalObjectModels()
public PipelineConfiguration makePipelineConfiguration()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |