Class WstxInputProperties
XMLInputFactory
.
TODO: - CHECK_CHAR_VALIDITY (separate for white spaces?) - CATALOG_RESOLVER? (or at least, ENABLE_CATALOGS)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Inner class used for creating type-safe enumerations (prior to JDK 1.5). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Allow all XML 1.1 characters escapes even if input document is described as XML 1.0 (in addition to ones allowed in 1.l0).static final String
Property of typeURL
, that will allow specifying context URL to use when resolving relative references, for the main-level entities (external DTD subset, references from the internal DTD subset).static final String
Whether readers will try to cache parsed external DTD subsets or not.static final String
Whether reader is to cache DTDs (when caching enabled) based on public id or not: if not, system id will be primarily used.static final String
Property of typeMap
, that defines explicit set of internal (generic) entities that will define of override any entities defined in internal or external subsets; except for the 5 pre-defined entities (lt, gt, amp, apos, quot).static final String
Property of typeXMLResolver
, that will allow overriding of default DTD and external parameter entity resolution.static final String
Property of typeXMLResolver
, that will allow overriding of default external general entity resolution.static final String
Size of input buffer (in chars), to use for reading XML content from input stream/reader.static final String
Three-valued property (one ofPARSING_MODE_DOCUMENT
,PARSING_MODE_FRAGMENT
orPARSING_MODE_DOCUMENTS
; default being the document mode) that can be used to handle "non-standard" XML content.static final String
Deprecated.static final String
Maximum length of of individual attribute values (in characters)static final String
Maximum number of attributes allowed for single XML element.static final String
Maximum length of input document, in characters.static final String
Maximum number of child elements for any given element.static final String
Maximum number of all elements in a single document.static final String
Maximum level of nesting of XML elements, starting with root element.static final String
Maximum number of total (general parsed) entity expansions within input.static final String
Maximum depth of nested (general parsed) entity expansions.static final String
Maximum length of individual text (cdata) segments in input, in characters.static final String
Property to specify shortest non-complete text segment (part of CDATA section or text content) that parser is allowed to return, if not required to coalesce text.static final String
Feature that controls whether linefeeds are normalized into canonical linefeed as mandated by xml specification.static final String
This read-only property indicates whether null is returned for default name space prefix; Boolean.TRUE indicates it does, Boolean.FALSE that it does not.static final String
Deprecated.Never implement, let's phase this out (deprecated in 4.2)static final String
Whether the Reader will treat character references as entities while parsing XML documents.static final String
Property of typeXMLResolver
, that will allow graceful handling of references to undeclared (general) entities.static final String
Whether readers will verify that characters in text content are fully valid XML characters (not just Unicode).static final WstxInputProperties.ParsingMode
static final WstxInputProperties.ParsingMode
static final WstxInputProperties.ParsingMode
static final String
Constants used when no DTD handling is done, and we do not know the 'real' type of an attribute. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
UNKNOWN_ATTR_TYPE
Constants used when no DTD handling is done, and we do not know the 'real' type of an attribute. Seems like CDATA is the safe choice.- See Also:
-
P_NORMALIZE_LFS
Feature that controls whether linefeeds are normalized into canonical linefeed as mandated by xml specification.Note that disabling this property (from its default enabled state) will result in non-conforming XML processing. It may be useful for use cases where changes to input content should be minimized.
Note: this property was initially removed from Woodstox 4.0, but was reintroduced in 4.0.8 due to user request.
- See Also:
-
P_VALIDATE_TEXT_CHARS
Whether readers will verify that characters in text content are fully valid XML characters (not just Unicode). If true, will check that they are valid (including white space); if false, will not check.Note that this property will NOT have effect on all encoding problems, specifically:
- UTF-8 decoder will still report invalid UTF-8 byte sequences (and same for other character encodings).
- XML Name character rules follow separate validation which will not be affected
Turning this option off may improve parsing performance; leaving it on guarantees compatibility with XML 1.0 specification regarding character validity rules.
- See Also:
-
P_ALLOW_XML11_ESCAPED_CHARS_IN_XML10
Allow all XML 1.1 characters escapes even if input document is described as XML 1.0 (in addition to ones allowed in 1.l0).Since this is non-standard option (that is, deviates from XML specification), it is disabled by default.
- Since:
- 5.2
- See Also:
-
P_CACHE_DTDS
Whether readers will try to cache parsed external DTD subsets or not.- See Also:
-
P_CACHE_DTDS_BY_PUBLIC_ID
Whether reader is to cache DTDs (when caching enabled) based on public id or not: if not, system id will be primarily used. Although theoretically public IDs should be unique, and should be good caching keys, sometimes broken documents use 'wrong' public IDs, and such by default caching keys are based on system id only.- See Also:
-
P_LAZY_PARSING
Deprecated.As of Woodstox 4.0 useXMLInputFactory2.P_LAZY_PARSING
instead (from Stax2 extension API, v3.0)Whether stream readers are allowed to do lazy parsing, meaning to parse minimal part of the event whenXMLStreamReader.next()
is called, and only parse the rest as needed (or skip remainder of no extra information is needed). Alternative to lazy parsing is called "eager parsing", and is what most xml parsers use by default.Enabling lazy parsing can improve performance for tasks where number of textual events are skipped. The downside is that not all well-formedness problems are reported when
XMLStreamReader.next()
is called, but only when the rest of event are read or skipped.Default value for Woodstox is such that lazy parsing is enabled.
- See Also:
-
P_RETURN_NULL_FOR_DEFAULT_NAMESPACE
This read-only property indicates whether null is returned for default name space prefix; Boolean.TRUE indicates it does, Boolean.FALSE that it does not.Default value for 4.1 is 'false'; this will most likely change for 5.0 since Stax API actually specifies null to be used.
- Since:
- 4.1.2
- See Also:
-
P_SUPPORT_DTDPP
Deprecated.Never implement, let's phase this out (deprecated in 4.2)Whether the Reader will recognized DTD++ extensions when parsing DTD subsets.Note: not implemented by Woodstox.
- See Also:
-
P_TREAT_CHAR_REFS_AS_ENTS
Whether the Reader will treat character references as entities while parsing XML documents.- See Also:
-
P_INPUT_BUFFER_LENGTH
Size of input buffer (in chars), to use for reading XML content from input stream/reader.- See Also:
-
P_MIN_TEXT_SEGMENT
Property to specify shortest non-complete text segment (part of CDATA section or text content) that parser is allowed to return, if not required to coalesce text.- See Also:
-
P_MAX_ATTRIBUTES_PER_ELEMENT
Maximum number of attributes allowed for single XML element.- Since:
- 4.2
- See Also:
-
P_MAX_ATTRIBUTE_SIZE
Maximum length of of individual attribute values (in characters)- Since:
- 4.2
- See Also:
-
P_MAX_CHILDREN_PER_ELEMENT
Maximum number of child elements for any given element.- Since:
- 4.2
- See Also:
-
P_MAX_ELEMENT_COUNT
Maximum number of all elements in a single document.- Since:
- 4.2
- See Also:
-
P_MAX_ELEMENT_DEPTH
Maximum level of nesting of XML elements, starting with root element.- Since:
- 4.2
- See Also:
-
P_MAX_CHARACTERS
Maximum length of input document, in characters.- Since:
- 4.2
- See Also:
-
P_MAX_TEXT_LENGTH
Maximum length of individual text (cdata) segments in input, in characters.- Since:
- 4.2
- See Also:
-
P_MAX_ENTITY_COUNT
Maximum number of total (general parsed) entity expansions within input.- Since:
- 4.3
- See Also:
-
P_MAX_ENTITY_DEPTH
Maximum depth of nested (general parsed) entity expansions.- Since:
- 4.3
- See Also:
-
P_CUSTOM_INTERNAL_ENTITIES
Property of typeMap
, that defines explicit set of internal (generic) entities that will define of override any entities defined in internal or external subsets; except for the 5 pre-defined entities (lt, gt, amp, apos, quot). Can be used to explicitly define entities that would normally come from a DTD.- See Also:
-
P_DTD_RESOLVER
Property of typeXMLResolver
, that will allow overriding of default DTD and external parameter entity resolution.- See Also:
-
P_ENTITY_RESOLVER
Property of typeXMLResolver
, that will allow overriding of default external general entity resolution. Note that using this property overrides settings done usingXMLInputFactory.RESOLVER
(and vice versa).- See Also:
-
P_UNDECLARED_ENTITY_RESOLVER
Property of typeXMLResolver
, that will allow graceful handling of references to undeclared (general) entities.- See Also:
-
P_BASE_URL
Property of typeURL
, that will allow specifying context URL to use when resolving relative references, for the main-level entities (external DTD subset, references from the internal DTD subset).- See Also:
-
P_INPUT_PARSING_MODE
Three-valued property (one ofPARSING_MODE_DOCUMENT
,PARSING_MODE_FRAGMENT
orPARSING_MODE_DOCUMENTS
; default being the document mode) that can be used to handle "non-standard" XML content. The default mode (PARSING_MODE_DOCUMENT
) allows parsing of only well-formed XML documents, but the other two modes allow more lenient parsing. Fragment mode allows parsing of XML content that does not have a single root element (can have zero or more), nor can have XML or DOCTYPE declarations: this may be useful if parsing a subset of a full XML document. Multi-document (PARSING_MODE_DOCUMENTS
) mode on the other hand allows parsing of a stream that contains multiple consequtive well-formed documents, with possibly multiple XML and DOCTYPE declarations.The main difference from the API perspective is that in first two modes, START_DOCUMENT and END_DOCUMENT are used as usual (as the first and last events returned), whereas the multi-document mode can return multiple pairs of these events: although it is still true that the first event (one cursor points to when reader is instantiated or returned by the event reader), there may be intervening pairs that signal boundary between two adjacent enclosed documents.
- See Also:
-
PARSING_MODE_DOCUMENT
-
PARSING_MODE_FRAGMENT
-
PARSING_MODE_DOCUMENTS
-
-
Constructor Details
-
WstxInputProperties
public WstxInputProperties()
-
XMLInputFactory2.P_LAZY_PARSING
instead (from Stax2 extension API, v3.0)