ValidateXml

Description:

Validates XML contained in a FlowFile. By default, the XML is contained in the FlowFile content. If the 'XML Source Attribute' property is set, the XML to be validated is contained in the specified attribute. It is not recommended to use attributes to hold large XML documents; doing so could adversely affect system performance. Full schema validation is performed if the processor is configured with the XSD schema details. Otherwise, the only validation performed is to ensure the XML syntax is correct and well-formed, e.g. all opening tags are properly closed.

Additional Details...

Tags:

xml, schema, validation, xsd

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Schema FileSchema FileThe file path or URL to the XSD Schema file that is to be used for validation. If this property is blank, only XML syntax/structure will be validated.

This property requires exactly one resource to be provided. That resource may be any of the following types: URL, file.

Supports Expression Language: true (will be evaluated using variable registry only)
XML Source AttributeXML Source AttributeThe name of the attribute containing XML to be validated. If this property is blank, the FlowFile content will be validated.
Supports Expression Language: true (will be evaluated using variable registry only)

Relationships:

NameDescription
validFlowFiles that are successfully validated against the schema, if provided, or verified to be well-formed XML are routed to this relationship
invalidFlowFiles that are not valid according to the specified schema or contain invalid XML are routed to this relationship

Reads Attributes:

None specified.

Writes Attributes:

NameDescription
validatexml.invalid.errorIf the flow file is routed to the invalid relationship the attribute will contain the error message resulting from the validation failure.

State management:

This component does not store state.

Restricted:

This component is not restricted.

Input requirement:

This component requires an incoming relationship.

System Resource Considerations:

ResourceDescription
MEMORYWhile this processor supports processing XML within attributes, it is strongly discouraged to hold large amounts of data in attributes. In general, attribute values should be as small as possible and hold no more than a couple hundred characters.