Error: Execute Xpath

Hi there,

Can anyone please kindly look through the problem and assist me with these problem?

I assigned
wgn = MMBA
biz = “*Business/Employer’s Company Name”

and for the xml expression
“string(//wg[contains(wgn,’”+var1.ToString+“’)]//item[contains(pfd,’”+var2.ToString+“’)]//pfv)”

Does any ways to solve this error?

Thanks and best regards.

Please download the example from here and check where you are doing wrong

https://docs.uipath.com/activities/docs/execute-xpath

Please enter single slash in the expression as shown below. Sample xpath expression -

"string(/catalog/book/author/text()[1])"

Regards,
Karthik Byggari

Hi @KarthikByggari

I have done research on this. By the way my aim is to use if condition inside the xml expression. Do you know any on this?

@yushinchan
The Better Support WE can do, once you Share Details to the used XML with us.

Sorry no idea how to use if.

Regards,
Karthik Byggari

Hi,

Here are both of my xml an xaml files. test.xml (1.9 KB) testtest.xaml (5.6 KB)

My concern is about to use writeline activities to show up my result as follow:
biz : ABC Enterprise
There are two nodes including this biz which is CTBG and MMBA. But I want to output only one biz which is under MMBA node.

Thanks and best regards.

@yushinchan
OK, thanks. Give US some time to have a Look on it

@yushinchan

I changed the XPATH statement:
“string(//wgn[./text()=‘MMBA’]/following-sibling::item[1]/flag/pfv/text())”

For RnD I hardcoded MMBA but you can quickly adopt this. About the statement:
the Idea is to fetch the siblings from particular wgn and retrieve from first item the flag/pfv

Find attached demo xaml here yushinchan.xaml (6.3 KB)

Let us know your feedback and flag the solving post as solution. So others can benefit from it

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.