XPath filter
Filters XML messages based on an XPath expression.
Defines an XPath-based message filter.
If the XPath expression will evaluate to a boolean, no configuration attributes are required. If the XPath expression will evaluate to a string, a match value should be provided against which the evaluation result will be matched.
There are three options for the match value: exact, case-insensitive and regex. These correspond to the equals, equals-ignore-case and matches operations on java.lang.String
, respectively. When providing a match type value of regex, the value provided in match value must be a valid regular expression.
Match value
String value to be matched against the XPath evaluation result.
If this is not provided, then the XPath evaluation must produce a boolean result directly.
Match type
Type of match to apply between the XPath evaluation result and the match value.
exact
- case-sensitive string comparison
case-insensitive
- case-insensitive string comparison
regex
- comparison using a regular expression
Default is exact
.
Discard channel
Channel where messages should be sent if the filter rejects the message. If no discard channel is set, rejected messages are silently dropped.
Optional
Namespace URI of the XML nodes in the XPath expression.
Optional, but required when namespace prefix is set
Example:
XPath expression : /ns1:one/@type
Namespace prefix : ns1
Namespace URI: http://www.example.org
Throw exception on rejection
Throw an exception when the input message is invalid. This will cause any error handling on the current message flow to trigger.
Note that when set to true
, no messages will be send to the discard channel.
Namespace prefix of the XML nodes in the XPath expression
Optional, but required when namespace URI is set
Example:
XPath expression : /ns1:one/@type
Namespace prefix : ns1
Namespace URI: http://www.example.org
XPath expression that returns a value (boolean or string) used for filtering the message. In case of a boolean value, true
accepts the message and false
discards it. In case of a string value, this decision depends on the value of the match value and match type settings.
Required
Example:
XPath expression : /ns1:one/@type
Namespace prefix : ns1
Namespace URI: http://www.example.org
Output channel
Channel where output messages should be sent after (successfully) processing the input message.
You can select the nullChannel
here to silently drop the output messages.
Required
Input channel
Channel to consume the input messages from.
Required
Id
Name that uniquely identifies this flow component.
Required