- 3 minutes to read

XPath search field expression type plugin

Easily extract unique values from XML messages using the Nodinite XPath Search Field Expression plugin. This page shows you how to configure XPath expressions to quickly retrieve data from large XML payloads, with clear, step-by-step examples.

✅ Extract single or multiple unique values from XML messages
✅ High-performance, forward-only stream reader for large payloads
✅ Supports multiple XPath expressions using the | character

Use this plugin to make your log data more actionable and searchable.


What You Will Learn

  • How to configure the XPath plugin in Nodinite
  • How to extract and transform XML data using XPath
  • How to interpret results and troubleshoot common issues

How It Works

The XPath plugin lets you:

  • Use XPath 1.0 to select elements or attributes from your XML messages
  • Return unique values for use in Search Fields and Log Views
  • Efficiently process large XML payloads with a high-performance, forward-only stream reader based on Microsoft's XPathReader

Not all XPath expressions are supported—only forward navigation is allowed due to the stream reader.


Example 1: Extracting Order IDs from XML

Goal: Extract all order IDs from an XML message.

Input:

<Orders>  
    <Order>  
        <Id>101</Id>  
    </Order>  
    <Order>  
        <Id>102</Id>  
    </Order>  
</Orders>  

Expression:

Orders/Order/Id  

Result:

101  
102  

Example 2: Extracting Order IDs from Multiple Message Types

Goal: Use a single XPath expression to extract order IDs from both Orders and OrderResponse message types.

Input 1:

<ns0:Orders xmlns:ns0="Common.Schemas/Nodinite/1.0">  
    <Order>  
        <Id>101</Id>  
        <Amount>1000</Amount>  
        <City>Karlstad</City>  
    </Order>  
    <Order>  
        <Id>102</Id>  
        <Amount>10</Amount>  
        <City>Stockholm</City>  
    </Order>  
</ns0:Orders>  

Input 2:

<ns0:OrderResponse xmlns:ns0="Common.Schemas/Nodinite/1.0">  
    <Order>  
        <Id>101</Id>  
        <Status>OK</Status>  
    </Order>  
    <Order>  
        <Id>102</Id>  
        <Status>Failed</Status>  
    </Order>  
</ns0:OrderResponse>  

Expression:

node()/Order/Id  

Result:

101  
102  

How to Configure the Plugin

  1. Select the XPath expression type plugin when adding or editing a Search Field.
  2. Enter your XPath expression to select the XML element or attribute.
  3. Finalize remaining steps, including selection of Message Types and optional re-index operation.
  4. Test your configuration using the Test Expression tab.
  5. Save and apply the Search Field to your Message Types.

Testing and Troubleshooting

  • Use the Test Expression feature to validate your XPath before saving.
  • If your expression returns no result, check for typos or unsupported XPath features.
  • The actual result (values) are extracted by the Logging Service and then presented together with the evaluated processing state and the number of unique matches.

Select XPath Plugin
Selecting the XPath plugin in the Search Field configuration.

Test expression
A valid expression with state output, unique values, and total count.

No result
Example of an invalid expression, which yields no result.


Visual Overview

graph LR subgraph "Search Fields" sf(fal:fa-magnifying-glass-plus Order Number) end subgraph "Search Field Expressions" sfe(fal:fa-flask XPath plugin) end subgraph "MessageTypes" mt1(fal:fa-file Orders) end sf --- sfe sfe ---|Expression| mt1

Diagram: How Search Fields, Expressions, and Message Types connect in Nodinite.