On

1 min read

The annotation qualifier on is used to indicate which element will receive an annotation when there is more than one possibility.

Overview #

The on qualifier may be specified for any annotation. It is used to specify which element is to receive the annotation when there is more than one possibility. Recall that it is the rule’s condition which identifies elements in your content for the purposes of annotation. But, sometimes, there is more than one element identified by the condition. This is when you need to use on.

The uses of the on qualifier are twofold:

  • in conjunction with the contains element test
  • to annotation spans created by parsing data content with regular expressions
  • The type ahead feature of the annotation entry box is sensitive to the content element type. The list of available annotations differs for paragraphs, spans, tables, etc. So, it is a good idea to first set the on attribute if you need it, and then enter the annotation.

Use with contains element test #

A contains element test, by its nature, identifies more than one element – an outer element, and one or more nested elements. The on qualifier can be used on an annotation to indicate that it is the inner elements (all the matching ones), rather than the outer element, which should receive the annotation.

Span creation with patterns #

Patterns may be used to split up textual content and create span content elements around the various portions that have been teased apart. The purpose of this, of course, is to allow your rule to place annotations on the newly created spans. Use the on qualifier on annotations that are meant to apply to these created spans.