Pages

Search This Blog

Sunday, July 6, 2014

How to use / and // in xpath

How to use / and // in xpath
Difference between / and //  
/

When / is used at the beginning of a path:

/div
it will define an absolute path to node "a" relative to the root. In this case, it will only find "a" nodes at the root of the XML tree.

//

When // is used at the beginning of a path:

//div

It will define a path to node "div" anywhere within the XML document. In this case, it will find "div" nodes located at any depth within the XML tree.

These XPath expressions can also be used in the middle of an XPath value to define ancestor-descendant relationships. When / is used in the middle of a path:

/div/a

Tt will define a path to node "a" that is a direct descendant (ie. a child) of node "div".

When // used in the middle of a path:

/div//a

It will define a path to node "a" that is any descendant (child node)  of node "div".

When we don't know the immediate parent of a child then we can use "." dot

will still find any node, "div", located anywhere within the XML tree. But, the XPath:

.//div

will find any node, "div", that is a descendant of the node . " In other words, preceding the "//" expression with a "." tells the XML search engine to execute the search relative to the current node reference.

13 comments:

  1. A nice article here with some useful tips for those who are not used-to comment that frequently. Thanks for this helpful information I agree with all points you have given to us. I will follow all of them.

    Some important links here,

    Selenium Training in Velachery | Best Selenium Training Institute in Chennai

    ReplyDelete
  2. Just wanted to say I love reading through your blog .thanks.
    บาคาร่า
    จีคลับ
    gclub

    ReplyDelete
  3. thanks for this beautiful post of blog I really liked your blog, It is very goof for freshers
    Selenium training and Institute
    Selenium Training in Marathalli
    Selenium Course in Bangalore

    ReplyDelete
  4. At Coepd - (Center of Excellence for Professional Development) Manual & Selenium testing training program is designed to give participants the skills & knowledge to gain a competitive advantage in starting/enhancing a career in software testing. We provide the attendee's software testing service which is required to ensure that tested applications meet all application requirements. Participants receive up-to-date training in multiple areas in Software Testing and a thorough understanding of real-world projects. Our collaborative ecosystem comprising of Partnerships with Software Companies enables real time software test life cycle experience.

    http://www.coepd.com/TestingTraining.aspx

    ReplyDelete
  5. ฉีดเผาผลาญไขมัน




    ของใหม่





    ฉีดลดแฟตที่ปลอดภัยแล้วก็







    มีคุณภาพ



    ที่สุดในโลกที่ศิลปิน



    ฮอลลีวู้ดใช้ ยืนยัน









    คำตอบ







    กับการฉีดลดแฟตที่ยอดเยี่ยม









    ได้ผล



    สูงที่สุด





    ในโลกจากอังกฤษ



    ยุโรป อเมริการวมทั้ง







    กาหลีตัวยาที่ทรงพลัง





    ที่สุดในขณะนี้




    ฉีดสลายไขมัน
    meso fat

    ReplyDelete
  6. I read this post two times, I like it so much, please try to keep posting & Let me introduce other material that may be good for our community.
    iWatch service center chennai | apple iphone service center in chennai | Mobile service center in chennai | apple service center chennai | apple iphone service center in chennai | iphone service chennai

    ReplyDelete
  7. Everyone loves it when people come together and share views. Great blog, keep it up!
    UI Development Training in Bangalore
    Reactjs Training in Bangalore

    ReplyDelete
  8. This is how my pal Wesley Virgin's story launches with this shocking and controversial VIDEO.

    As a matter of fact, Wesley was in the military-and soon after leaving-he unveiled hidden, "mind control" secrets that the government and others used to get whatever they want.

    These are the EXACT same SECRETS tons of celebrities (especially those who "come out of nothing") and top business people used to become wealthy and successful.

    You probably know how you only use 10% of your brain.

    Really, that's because most of your brain's power is UNCONSCIOUS.

    Perhaps that conversation has even occurred INSIDE OF YOUR very own brain... as it did in my good friend Wesley Virgin's brain 7 years ago, while riding a non-registered, beat-up trash bucket of a car with a suspended driver's license and $3 in his bank account.

    "I'm very frustrated with going through life check to check! Why can't I become successful?"

    You took part in those thoughts, isn't it so?

    Your success story is going to start. You just have to take a leap of faith in YOURSELF.

    CLICK HERE TO LEARN WESLEY'S SECRETS

    ReplyDelete