Xpath to find attribute id from album node

Posted on 2011-10-24
Last Modified: 2013-11-18
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
Question by:tia_kamakshi
    LVL 60

    Accepted Solution

    //Albums[@isCurrent = 'True']/Album[@sno = '1']/@id
    LVL 18

    Assisted Solution

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


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
    SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
    Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
    The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now