occurrence

operator

Return type:
Integer
Returns:
Returns the number of consecutive elements with the same declaration.
Syntax
occurrence (of element-expression)?
    


Purpose

The occurrence operator Returns the number of consecutive elements that have the same declaration as the current element. If element-expression is specified, the specified element is tested instead of the current one.

Inclusions are counted as well as proper elements.

The following element events will always have an occurrence of 1:

  • the first element in a markup stream,
  • the first child element,
  • any element not of the same element declaration as its previous sibling, and
  • an element that immediately follows data content.