Xpath to find attribute id from album node

Hi Experts,

Please help me in writting xpath query to find id attrbute of the Album node

<Album name="Burj Gallery" sno="1" id="tcm:601-632210">

where attribute "isCurrent" value is "True" from node <Albums> as below

<Albums name="2011 Media Gallery" isCurrent="True">

There are many <Album> node in <Albums> node

so I wanted value of attribute id from Album node where sno="1"

I mean id of first album from Albums node where Albums  has attribute isCurrent="True"

Please help me writing xpath

Many Thanks
Who is Participating?
Geert BormansConnect With a Mentor Information ArchitectCommented:
//Albums[@isCurrent = 'True']/Album[@sno = '1']/@id
zc2Connect With a Mentor Commented:
If I understood your question correctly, you need an XPath expression like this?

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.