How to extract CorrelationId using Regular Expression and XPath without the results containg the XML markup in TIBCO BusinessWorks ProcessMonitor?

How to extract CorrelationId using Regular Expression and XPath without the results containg the XML markup in TIBCO BusinessWorks ProcessMonitor?

book

Article ID: KB0089376

calendar_today

Updated On:

Products Versions
TIBCO BusinessWorks ProcessMonitor -
Not Applicable -

Description

Description:
If you want to extract CorrelationId using Regular Expression and XPath without the results containing the XML markup then use the generic Regular Expression and XPath as mentioned in the Resolution below.

Issue/Introduction

How to extract CorrelationId using Regular Expression and XPath without the results containg the XML markup in TIBCO BusinessWorks ProcessMonitor?

Resolution

Extracting the value of  CorrelationId can be achieved by using this Regular Expression: “:CorrelationId>([0-9]*?)</” or this XPath (recommended): “//*:CorrelationId[1]”
The correct Regular Expression posted above will (a) ignore the namespace prefix, and (b) return only the value between the XML element markup.

For XPath, the namespace must be a part of the XPath expression. To accept any namespace prefix in XPath you can use “*:” in front of the element name, such as “//*:CorrelationId[1]”. The XPath processor searches for all “CorrelationId” elements in all namespaces and returns the value of the first result.