Next Tag

The <Next/> element can include an optional match attribute and an optional offset attribute. The match attribute has a default value of “1”, and the offset attribute has a default value of “0.” Each <Next/> element retrieves the next level of the IAccessible hierarchy, and scans it for a match between the inner text and the Name of each IAccessible node.

  • Match: Returns the nth matching attribute.
  • Offset: Returns the nth attribute after the matching attribute.
  • Culture: Uses the culture tag.

The match="2" attribute specifies how many times a text match has to occur for the criteria to be satisfied. When this number is reached, the offset attribute can be used to select an IAccessible node adjacent to the node that was successfully matched. This can be useful if matching text is impractical (for example, because there are unprintable characters that are difficult to discover). The offset value wraps around, so it is not possible to reference outside of the child IAccessible array. The culture tag allows you to search for language-specific attributes.

The sample binding below searches for the Close button in an application in three different cultures, English, German and French.

<AccControl name="closeButton">
   <Path>
      <Next culture="en-us">Close</Next>
      <Next culture="de-de">Beenden</Next>
      <Next culture="fr-fr">Fermer</Next>
   </Path>
</AccControl>

The sample below searches for the control that is two positions after the forth control with the caption “Name”.

<AccControl name="NameBox">
   <Path>
      <Next match="4", offset="4">Name</Next>
   </Path>
</AccControl>