Retrieve XML element value with conditional attributes - How To xaml


#1

Hi

After spending some hours on how to retrieve a specific value for an Element with conditional Attributes, I finally solved my problem.

In my XML “EntityPage” appered more than 100 times, therefore getting a specific value using attributes was the only way i could keep my robot dynamic. I tried using “deserialize” however it was not a suitable fit for my problem.

I have enclosed a xaml file on how it can be done.
Unfortunately im not allowed to post my xml doc due to confidentiality - therefore i have just taken a screenshot for you so you can get the idea.

Values used: (see the enclosed photo)
Parent Element: "EntityPage"
Attribute1: "name"
Attribute2: "pagename"
Get Element value for: "hostresistate"
Value = “milano”

Furthermore here is a link which may help you with any XML problems in the futureXML - Get Element value with conditional attributes.xaml (10.5 KB)
.
http://www.freeformatter.com/xpath-tester.html#ad-output

Regards
Lasse Hachem

Uploading…