Skip to content

XPath query

ryannewington edited this page Jun 23, 2016 · 1 revision

XPath Query

Summary

This transform allows you to apply an XPath expression to an XML element stored in a string attribute

Parameters

Parameter Description
XPath expression A valid XPath expression that can be used to find or transform the value within the xml structure
When no match is found If the input value wasn't found in the file, you can return a specific value, return null, or return the original input value
Default value When return a specific value is selected for the When no match is found parameter, and the input value wasn't found in the text file, this static value will be returned by the transform
Return data type Specifies the return type of the data matched by the XPath expression. The value stored in the XML must be convertible to the type specified

Input Type

The transform supports string values

Multiple input values

The transform accepts multiple input values, and processes each of them individually

Return Type

The transform returns a string value for each input value

Usage

Sample XML attribute

<?xml version="1.0" encoding="utf-8" ?>
<departments>
   <department>
     <name>Finance</name>
     <code>1333221</code>
   </department>
   <department>
     <name>IT</name>
     <code>9933322</code>
   </department>
</departments>

Xpath Expression

/departments/department/code

Output results

Output value
1333221
9933322