2

https://www.w3schools.com/xml/xpath_axes.asp

In every XPath Axis, it says "Current node".

What is the current node in XPath? Is it same as the context node?

<html>
  <body>
    <div id="id1">
      <p>First paragraph</p>
      <div>
        <p>Second paragraph</p>
      </div>
    </div>
    <p>Third paragraph</p>
  </body>
</html>

.//p and //p will select different elements? why?

nick
  • 51
  • 5
  • Well, if you are turning to w3schools to find precise terminology you are on the wrong track, look into the relevant W3C specifications, for instance https://www.w3.org/TR/xpath-31/#eval_context. As for the concrete example of the two expressions, without telling us how you evaluate the path expressions we can't tell what the context node is. – Martin Honnen Oct 23 '20 at 18:30

0 Answers0