Some help with xpath and relevance

I’ve got following xml file

<?xml version="1.0" encoding="UTF-8"?>
<AppStore>
<Version version="4/8/2020" date="4/8/2020" layout="V2"></Version>
<BigFixApps>
<BigFixApp name="7Zip" title="7Zip -- v19.00 SCV6" version="v19.00 SCV6" gm="NO" />
<BigFixApp name="AdobeAIR" title="Adobe AIR -- v32.0.0.125 SCV3" version="v32.0.0.125 SCV3" gm="YES" />
</BigFixApps>
</AppStore>

I would need some help with relevance to return the value of attribute “gm” for specific apps.
I can query all attribute but for one particular item to get value would like some help

Q: (it as text) of xpaths "/AppStore/BigFixApps/BigFixApp/@name" of xml document of file "C:\DEV\AppInfo.XML"
I: Current Selection Evaluation
A: 7Zip
A: AdobeAIR
T: 22.968 ms

i’ve tried below but does not return anything no error either but would like to see result for GM

Q: node values  whose (it as string contains "7Zip") of selects "/AppStore/BigFixApps/BigFixApp/@gm" of xml document of file "C:\DEV\AppInfo.XML"
I: Current Selection Evaluation
T: 20.353 ms

I would like to return value “GM” for 7Zip or any other app for that matter but using relevance. I found various ways using xpath/selects for returning 1 attribute but combination i’m not finding

thx for all help.

found the solution might be useful for other people

(it as text contains "YES") of xpaths "/AppStore/BigFixApps/BigFixApp[@name='7Zip']/@gm" of xml document of file "C:\HP\AppInfo.XML"
2 Likes

This uses more plurals, should be more robust:

exists (it as text) whose(it contains "YES") of xpaths "/AppStore/BigFixApps/BigFixApp[@name='7Zip']/@gm" of xml documents of files "C:\HP\AppInfo.XML"

Also, figuring out the right XPATH is something you can do without using BigFix at all. You can use many XPATH tools, including those in Notepad++ or similar to figure out the XPATH you need, then plug that into the relevance. You can find a lot of helpful tips and tricks to writing XPATH in general out there.

This part definitely took me a while to learn.

Thank you all for the feedback/suggestions much appreciated.