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.