Clicky

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
ImageGallery.xml (4 KB)
xml (text/xml)

asked 10/24/2011 03:49

tia_kamakshi's gravatar image

tia_kamakshi ♦♦


2 Answers:
//Albums[@isCurrent = 'True']/Album[@sno = '1']/@id
link

answered

Gertone's gravatar image

Gertone

If I understood your question correctly, you need an XPath expression like this?

//Albums[@isCurrent="True"]/Album[@sno="1"]/@id
link

answered 2011-10-24 at 13:38:51

zc2's gravatar image

zc2

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

Asked: 10/24/2011 03:49

Seen: 765 times

Last updated: 10/25/2011 04:43