Multiple choice technology programming languages

Which of these are not valid path expressions of XPath ?

  1. //

  2. @

  3. $
  4. /

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

To solve this question, the user needs to know the basics of XPath and its path expressions.

Now, let's go through each option and explain why it is right or wrong:

A. //: This is a valid XPath path expression which selects all the nodes with the matching name, regardless of their position in the document.

B. @: This is a valid XPath path expression which selects attributes of the selected element.

C. $: This is not a valid XPath path expression. XPath doesn't use $ to select nodes or attributes.

D. /: This is a valid XPath path expression which selects the root node of the document or the current node if used at the beginning of the expression.

Therefore, the answer is:

The Answer is: C