Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Property

Macro Enabled?

Description

Input field to parse as an XML record

Yes

Required. The field in the input record that is the source of the XML event or record.

XML encoding

Yes

Required. The source XML character set encoding.

Default is UTF-8.

XPath Mappings

No

Required. Mapping of the field names to the XPaths of the XML record. A comma-separated list, each element of which is a field name, followed by a colon, followed by an XPath expression. XPath location paths can include predicates and supports XPath 1.0. Example : <field-name>:<XPath expression>.

Field Name Schema Type Mapping

No

Required. Mapping of field names in the output schema to data types. Consists of a comma-separated list, each element of which is a field name followed by a colon and a type, where the field names are the same as used in the xPathMappings, and the type is one of: boolean, int, long, float, double, bytes, or string. Example : <field-name>:<data-type>.

Error handling

No

Required. The action to take in case of an error. - "

  • Ignore error and continue

" - "
  • Exit on error

"
  • : Stops processing upon encountering an error

- "
  • Write to error dataset

"
  • : Writes the error record to an error dataset and continues.

Fail on Array

No

Optional. Whether to allow xpaths XPaths that are arrays. If false, the first element will be chosen.

Default is false.

Output Schema

No

Required. The output schema for the data.

...

This example parses an XML record received in the "body" field of the input record following the xPathMappings for XPath Mappings for each field name. The output structured record will be created using the type specified for each field in the "fieldTypeMapping" Field Name Schema Type Mapping. Only years and prices will be passed on for books with a price over 35.00:

...