XPath with RegEx Search Field Expression Type Plugin
Unlock powerful XML data extraction and transformation in Nodinite using the XPath with RegEx Search Field Expression plugin. This page shows you how to combine XPath and RegEx to extract, match, and style values from XML messages—making your log data more actionable and searchable.
✅ Extract single or multiple unique values from XML messages
✅ Apply RegEx to style or filter extracted data
✅ Efficiently process large XML payloads with a high-performance, forward-only stream reader
✅ See clear, step-by-step examples with input, expression, and result
Use this plugin to apply RegEx expressions on values extracted from large XML messages. If you need advanced XPath features, use the Formula plugin instead.
What You Will Learn
- How to configure the XPath with RegEx plugin in Nodinite
- How to extract and transform XML data using XPath and RegEx
- How to interpret results and troubleshoot common issues
How It Works
The XPath with RegEx plugin lets you:
- Use XPath to select elements or attributes from your XML messages
- Apply a RegEx pattern to the extracted value(s) to further filter or style the result
- Return unique values for use in Search Fields and Log Views
This approach is ideal for large XML payloads, as the plugin uses a high-performance, forward-only stream reader based on Microsoft's XPathReader.
Example 1: Extracting a File Name from an XML Message
Goal: Extract just the file name from a full file path in an XML message.
Input
<ns0:Orders xmlns:ns0="Common.Schemas/Nodinite/1.0">
<Header>
<FileName>\\nodinitesrv01\ftp\public\INT001\Order\OrderFile_123.xml</FileName>
</Header>
<Order>
<Id>101</Id>
<Amount>1000</Amount>
<City>Karlstad</City>
</Order>
</ns0:Orders>
Expression 1: XPath
Orders/Header/FileName
Expression 2: RegEx
([^\\]+$)
Result
OrderFile_123.xml
Example 2: Extracting Node Names from XML Content
Goal: Extract all node names from a nested XML structure.
Input
<Envelope>
<Any>
<Nodes>
<node1 id="1">
<node2/>
</node1>
</Nodes>
</Any>
</Envelope>
Expression 1: XPath
Envelope/Any/Nodes
Expression 2: RegEx
<([a-z0-9]{0,})
Result
node1
node2
How to Configure the Plugin
- Select the XPath with RegEx expression type plugin when adding or editing a Search Field.
- Enter your XPath expression to select the XML element or attribute.
- (Optional) Enter a RegEx pattern to further filter or style the extracted value(s).
- Adjust RegEx group and global options as needed.
- Test your configuration using the Test Expression tab.
- Save and apply the Search Field to your Message Types.
Troubleshooting & Tips
- Not all XPath expressions are supported—only forward navigation is allowed due to the stream reader.
- If your expression returns no result, check for typos or unsupported XPath features.
- Use the Test Expression feature to validate your XPath and RegEx before saving.
Visual Overview
Diagram: How Search Fields, Expressions, and Message Types connect in Nodinite.
Screenshots
Selecting the XPath with RegEx plugin in the Search Field configuration.
Valid expression with state output, unique values, and total count.
Example of an invalid expression, which yields no result.
Valid expression with state output, unique values, and total count for node extraction.