The elements presented in the content panel are quite flat, but there is a certain amount of nesting possible. For example, a span element may appear within a paragraph element or nested within another span element. Sometimes, this nesting is significant in correctly identifying content to convert.
The contains element test allows for a nested element to be tested. Thus, your rule can test outer and nested elements in combination. As well, your rule can place annotations on either the outer element or the nested elements. Be default, annotations are placed on the outer elements, but you can provide a label for the nested element, and place the annotation on them explicitly.
Example: contains element test
The following rule attempts to identify content that should be tagged as uicontrol. It is not enough for the term to be bold in the input document. However, bold text found in a paragraph styled as Step is determined to reliably identify a uicontrol.
Example: annotating both the inner and outer elements
The following applies an annotation to the paragraph as well as the nested span.