Multiple choice technology web technology

How will you select type attribute in the document

  1. a. /type

  2. b. /@type

  3. c. //@type

  4. d. type

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

To select the type attribute anywhere in an XML document using XPath, you use //@type. The // operator selects nodes throughout the document, and the @ prefix selects attributes. Option A (/type) would select a type element, option B (/@type) would only select type attributes of the root element, and option D (type) is not valid XPath syntax.