What difference does a leading / (slash) make in XPath?

Viewed 36

What is the difference (if exists) between the following expressions ?

  1. /descendant-or-self::node()
  2. descendant-or-self::node()

I don't understand what is the meaning of the / in this case in the beginning of the first expression.

According to the explanation from the class, the meaning of / is go down a level in the tree.

So how is this reflected here?

(According to checks that I did, it's seen that a difference does not exist, but I don't understand why according to the explain mentioned above given by my lecturer.)

1 Answers
Related