net.sf.saxon.event
public class ParseOptions extends Object implements Serializable
Constructor Summary | |
---|---|
ParseOptions()
Create a ParseOptions object with default options set | |
ParseOptions(ParseOptions p)
Create a ParseOptions object as a copy of another ParseOptions |
Method Summary | |
---|---|
void | addFilter(ProxyReceiver filter)
Add a filter to the list of filters to be applied to the raw input |
void | applyDefaults(Configuration config)
Merge settings from the Configuration object into these parseOptions |
static void | close(Source source)
Close any resources held by a given Source. |
int | getDTDValidationMode()
Get whether or not DTD validation of this source is required |
EntityResolver | getEntityResolver()
Get the EntityResolver that will be used when parsing |
ErrorListener | getErrorListener()
Get the ErrorListener that will be used when parsing |
List | getFilters()
Get the list of filters to be applied to the input. |
TreeModel | getModel()
Get the tree model that will be used. |
int | getSchemaValidationMode()
Get whether or not schema validation of this source is required |
int | getStripSpace()
Get the space-stripping action to be applied to the source document |
StructuredQName | getTopLevelElement()
Get the name of the top-level element for validation.
|
SchemaType | getTopLevelType()
Get the type of the document element for validation.
|
int | getTreeModel()
Get the tree model that will be used. |
Boolean | getWrapDocument()
Assuming that the contained Source is a node in a tree, determine whether a tree will be created
as a view of this supplied tree, or as a copy. |
XMLReader | getXMLReader()
Get the SAX parser (XMLReader) to be used |
boolean | isContinueAfterValidationErrors()
Ask whether processing should continue after a validation error (true when the output is a final
output) |
boolean | isExpandAttributeDefaults()
Ask whether to expand default attributes defined in a DTD or schema.
|
boolean | isLineNumbering()
Get whether line numbers are to be maintained in the constructed document |
boolean | isLineNumberingSet()
Determine whether setLineNumbering() has been called |
boolean | isPleaseCloseAfterUse()
Determine whether or not the user of this Source is encouraged to close it as soon as reading is
finished. |
boolean | isUseXsiSchemaLocation()
Ask whether or not to use the xsi:schemaLocation and xsi:noNamespaceSchemaLocation attributes
in an instance document to locate a schema for validation. |
boolean | isXIncludeAware() Get state of XInclude processing. |
boolean | isXIncludeAwareSet() Determine whether setXIncludeAware() has been called. |
void | merge(ParseOptions options)
Merge another set of parseOptions into these parseOptions |
void | setContinueAfterValidationErrors(boolean keepGoing)
Say that processing should continue after a validation error (true when the output is a final
output) |
void | setDTDValidationMode(int option)
Set whether or not DTD validation of this source is required |
void | setEntityResolver(EntityResolver resolver)
Set an EntityResolver to be used when parsing. |
void | setErrorListener(ErrorListener listener)
Set an ErrorListener to be used when parsing |
void | setExpandAttributeDefaults(boolean expand)
Set whether to expand default attributes defined in a DTD or schema.
|
void | setLineNumbering(boolean lineNumbering)
Set whether line numbers are to be maintained in the constructed document |
void | setModel(TreeModel model)
Set the tree model to use. |
void | setPleaseCloseAfterUse(boolean close)
Set whether or not the user of this Source is encouraged to close it as soon as reading is finished.
|
void | setSchemaValidationMode(int option)
Set whether or not schema validation of this source is required |
void | setStripSpace(int stripAction)
Set the space-stripping action to be applied to the source document |
void | setTopLevelElement(StructuredQName elementName)
Set the name of the top-level element for validation.
|
void | setTopLevelType(SchemaType type)
Set the type of the top-level element for validation.
|
void | setTreeModel(int model)
Set the tree model to use. |
void | setUseXsiSchemaLocation(boolean use)
Set whether or not to use the xsi:schemaLocation and xsi:noNamespaceSchemaLocation attributes
in an instance document to locate a schema for validation. |
void | setWrapDocument(Boolean wrap)
Assuming that the contained Source is a node in a tree, indicate whether a tree should be created
as a view of this supplied tree, or as a copy. |
void | setXIncludeAware(boolean state) Set state of XInclude processing. If XInclude markup is found in the document instance, should it be processed as specified in XML Inclusions (XInclude) Version 1.0. XInclude processing defaults to |
void | setXMLReader(XMLReader parser)
Set the SAX parser (XMLReader) to be used |
Parameters: filter the filter to be added
Parameters: config the Configuration. Settings from the Configuration are used only where no setting is present in this ParseOptions object
Parameters: source the source to be closed
Since: 9.2
Returns: the validation mode requested, or DEFAULT to use the default validation mode from the Configuration.
Returns: the EntityResolver, if one has been set using ParseOptions, otherwise null.
Returns: the ErrorListener, if one has been set using ParseOptions, otherwise null.
Returns: the list of filters, if there are any
Returns: typically one of the constants TINY_TREE, TINY_TREE_CONDENSED, or LINKED_TREE. However, in principle a user-defined tree model can be used.
Returns: the validation mode requested, or DEFAULT to use the default validation mode from the Configuration.
Returns: the QName of the required top-level element, or null if no value is set
Since: 9.0
Returns: the type of the required top-level element, or null if no value is set
Returns: one of TINY_TREE, LINKED_TREE, or TINY_TREE_CONDENSED, or {link Builder#UNSPECIFIED_TREE_MODEL} if no call on setTreeModel() has been made
Returns: if true, the node in the supplied Source is wrapped, to create a view. If false, the node and its contained subtree is copied. If null, the system default is chosen.
Since: 8.8
Returns: the parser
Returns: true if processing should continue
Returns: true if missing attribute values are to take the default value supplied in a DTD or schema, false if they are to be left as absent
Returns: true if line numbers are maintained
Returns: true if setLineNumbering() has been called
Returns: true if the source should be closed as soon as it has been consumed
Get state of XInclude processing.
Returns: current state of XInclude processing. Default value is false.
Determine whether setXIncludeAware() has been called.
Returns: true if setXIncludeAware() has been called
Parameters: options the other parseOptions. If both are present, the other parseOptions take precedence
Parameters: keepGoing true if processing should continue
Parameters: resolver the EntityResolver to be used
Parameters: listener the ErrorListener to be used
Parameters: expand true if missing attribute values are to take the default value supplied in a DTD or schema, false if they are to be left as absent
Parameters: lineNumbering true if line numbers are to be maintained
Parameters: model typically one of the constants TINY_TREE, TINY_TREE_CONDENSED, or LINKED_TREE. However, in principle a user-defined tree model can be used.
Since: 9.2
Parameters: close true if the source should be closed as soon as it has been consumed
Parameters: option one of STRICT, LAX, STRIP, PRESERVE, DEFAULT
Parameters: elementName the QName of the required top-level element, or null to unset the value
Parameters: type the schema type required for the document element, or null to unset the value
Parameters: model one of TINY_TREE, LINKED_TREE or TINY_TREE_CONDENSED
Parameters: use true if these attributes are to be used, false if they are to be ignored
Parameters: wrap if true, the node in the supplied Source is wrapped, to create a view. If false, the node and its contained subtree is copied. If null, the system default is chosen.
Set state of XInclude processing.
If XInclude markup is found in the document instance, should it be processed as specified in XML Inclusions (XInclude) Version 1.0.
XInclude processing defaults to false
.
Parameters: state Set XInclude processing to true
or
false
Since: 8.9
Parameters: parser the SAX parser