|
||||||||||
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. |
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. |
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 |
addQueryLibraryModule(StaticQueryContext module)
Add an XQuery library module to the configuration |
void |
addSchema(SchemaMarker schema)
Add a schema to the cache |
SchemaType |
getAttributeType(SchemaComponentMarker attributeDecl)
Get the schema type corresponding to an attribute declaration |
ValidationContext |
getContainedValidationContext(ValidationContext outer,
int fingerprint,
boolean isType)
Get a validation context nested within an existing validation context (XQuery only) |
Receiver |
getDocumentValidator(Receiver receiver,
String systemId,
NamePool namePool,
int validationMode)
Get a document-level validator to add to a Receiver pipeline |
SchemaType |
getElementType(SchemaComponentMarker attributeDecl)
Get the schema type corresponding to an element declaration |
Receiver |
getElementValidator(Receiver receiver,
int nameCode,
SchemaType schemaType,
int validation,
ValidationContext context,
NamePool pool)
Get a Receiver that can be used to validate an element |
ErrorListener |
getErrorListener()
Get the ErrorListener used in this configuration. |
int |
getHostLanguage()
Get the host language used in this configuration. |
static Locale |
getLocale(String lang)
Get a locale given a language code in XML format |
String |
getMessageEmitterClass()
Get the name of the class that will be instantiated to create a MessageEmitter, to process the output of xsl:message instructions. |
OutputURIResolver |
getOutputURIResolver()
Get the OutputURIResolver that will be used to resolve URIs used in the href attribute of the xsl:result-document instruction. |
StaticQueryContext |
getQueryLibraryModule(String namespace)
Locate an XQuery library module in the configuration. |
int |
getRecoveryPolicy()
Determine how recoverable run-time errors are to be handled. |
SchemaMarker |
getSchema(String namespace)
Get a schema from the cache. |
XMLReader |
getSourceParser()
Get the parser for source documents |
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). |
XMLReader |
getStyleParser()
Get the parser for stylesheet documents |
String |
getStyleParserClass()
Get the name of the class that will be instantiated to create an XML parser for parsing stylesheet modules. |
NamePool |
getTargetNamePool()
Get the target namepool to be used for stylesheets/queries and for source documents. |
TraceListener |
getTraceListener()
Get the TraceListener used for run-time tracing of instruction execution. |
int |
getTreeModel()
Get the Tree Model used by this Configuration. |
URIResolver |
getURIResolver()
Get the URIResolver used in this configuration |
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 |
isSchemaAware()
Determine if the configuration is schema-aware |
boolean |
isSchemaValidation()
Determine whether source documents (supplied as a StreamSource or SAXSource) should be subjected to schema validation |
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 |
static XMLReader |
makeParser(String className)
Create a new SAX XMLReader object using the class name provided. |
NodeTest |
makeSubstitutionGroupTest(SchemaComponentMarker elementDecl)
Make a test for elements corresponding to a give element declaration |
String |
readSchema(String baseURI,
String schemaLocation,
String expected)
Read a schema from a given schema location |
void |
setAllowExternalFunctions(boolean allowExternalFunctions)
Determine whether calls to external Java functions are permitted. |
void |
setErrorListener(ErrorListener listener)
Set the ErrorListener to be used in this configuration. |
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(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 |
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 |
setSchemaValidation(boolean validate)
Indicate whether source documents (supplied as a StreamSource or SAXSource) should be subjected to schema validation |
void |
setSourceParserClass(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(String styleParserClass)
Set the name of the class that will be instantiated to create an XML parser for parsing stylesheet modules. |
void |
setTargetNamePool(NamePool targetNamePool)
Set the NamePool to be used for stylesheets/queries and for source documents. |
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(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 |
int |
validateAttribute(int nameCode,
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 |
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
Constructor Detail |
public Configuration()
Method Detail |
public boolean isSchemaAware()
public int getHostLanguage()
public void setHostLanguage(int hostLanguage)
hostLanguage
- Configuration.XSLT or Configuration.XQUERYpublic URIResolver getURIResolver()
public void setURIResolver(URIResolver resolver)
resolver
- The URIResolver to be used.public ErrorListener getErrorListener()
public void setErrorListener(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 int getRecoveryPolicy()
public void setRecoveryPolicy(int recoveryPolicy)
recoveryPolicy
- the recovery policy to be used.public String getMessageEmitterClass()
public void setMessageEmitterClass(String messageEmitterClass)
messageEmitterClass
- the full class name of the message emitter class. This
must implement net.sf.saxon.event.Emitter.public String getSourceParserClass()
public void setSourceParserClass(String sourceParserClass)
sourceParserClass
- the fully qualified name of the XML parser class. This must implement
the SAX2 XMLReader interface.public String getStyleParserClass()
public void setStyleParserClass(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 isAllowExternalFunctions()
public void setAllowExternalFunctions(boolean allowExternalFunctions)
allowExternalFunctions
- true if external function calls are to be
permitted.public boolean isTraceExternalFunctions()
public void setTraceExternalFunctions(boolean traceExternalFunctions)
traceExternalFunctions
- true if tracing is to be enabled
for calls to external Java functionspublic boolean isValidation()
public void setValidation(boolean validation)
validation
- true if DTD validation is to be requested.public boolean isSchemaValidation()
public void setSchemaValidation(boolean validate)
validate
- true if source documents should be validatedpublic NamePool getTargetNamePool()
public void setTargetNamePool(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 XMLReader getSourceParser() throws TransformerFactoryConfigurationError
TransformerFactoryConfigurationError
public XMLReader getStyleParser() throws TransformerFactoryConfigurationError
TransformerFactoryConfigurationError
public String readSchema(String baseURI, String schemaLocation, String expected) throws TransformerConfigurationException
TransformerConfigurationException
public void addSchema(SchemaMarker schema) throws TransformerConfigurationException
TransformerConfigurationException
public SchemaMarker getSchema(String namespace)
public Receiver getDocumentValidator(Receiver receiver, 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
public Receiver getElementValidator(Receiver receiver, int nameCode, SchemaType schemaType, int validation, ValidationContext context, NamePool pool) throws TransformerException
receiver
- nameCode
- schemaType
- validation
- pool
-
TransformerException
public ValidationContext getContainedValidationContext(ValidationContext outer, int fingerprint, boolean isType) throws XPathException
XPathException
public int validateAttribute(int nameCode, 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 SchemaType getAttributeType(SchemaComponentMarker attributeDecl)
public SchemaType getElementType(SchemaComponentMarker attributeDecl)
public NodeTest makeSubstitutionGroupTest(SchemaComponentMarker elementDecl)
public void addQueryLibraryModule(StaticQueryContext module)
public StaticQueryContext getQueryLibraryModule(String namespace)
namespace
- the module namespace URI
public static XMLReader makeParser(String className) throws TransformerFactoryConfigurationError
className
- A string containing the name of the
SAX parser class, for example "com.microstar.sax.LarkDriver"
TransformerFactoryConfigurationError
public static Locale getLocale(String lang)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |