Skip to main content

XmlStreamSplitter

Splits XML document on a specific element.

Notes

This class is suited for large XML documents. It will read the XML as a stream and split as it is read, preserving memory during parsing. For this reason, element matching is not as flexible as DOM-based XML parsers, such as DOMSplitter, but is more efficient on large documents.

Examples

The following example will create one document per animals, based on the sample XML given above.

handler:
class: XmlStreamSplitter
path: /animals/species/animal

Usage

Full configuration skeleton, with every option and its default
class: XmlStreamSplitter
contentTypeMatcher:
ignoreCase: false
ignoreDiacritic: false
matchEmpty: false
method: BASIC
negateMatches: false
partial: false
pattern: string
replaceAll: false
trim: false
discardOriginal: false
fieldMatcher:
ignoreCase: false
ignoreDiacritic: false
matchEmpty: false
method: BASIC
negateMatches: false
partial: false
pattern: string
replaceAll: false
trim: false
label: string
path: string

Properties

PropertyTypeRequiredDefault
contentTypeMatcherTextMatcherNoTextMatcher
discardOriginalbooleanNofalse
fieldMatcherTextMatcherNoTextMatcher
labelstringNo-
pathstringNo-

Property Details

contentTypeMatcher

The content type of the XML document.

discardOriginal

Discard the original document after the split is performed.

fieldMatcher

Matches document fields based on specified patterns and methods

label

An optional, user-supplied label for this step in the importer pipeline. It has no effect on processing — it exists purely to help identify this step, for example in large configurations or in the visual configurator.

path

The path to the element to split on.