Multiple choice technology programming languages

Which built-in XPATH function is used to know the run-time size of a data sequence?

  1. getCount

  2. . count

  3. generateGUID

  4. num

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

The count() function in XPath calculates the number of nodes in a node-set or sequence. Option B represents this function. getCount and num are not standard XPath functions, and generateGUID creates unique identifiers.

AI explanation

XPath's built-in count() function returns the number of nodes in a node-set (sequence) at runtime, e.g. count(//book) returns how many book elements matched. It's one of XPath's core node-set functions. 'getCount', 'generateGUID', and 'num' are not standard XPath functions -- generateGUID sounds like it belongs to a different API (e.g. BPEL/XSLT extension functions), and 'num'/'getCount' aren't part of the XPath function library, so count() is the only real answer.