This version is out of date, covering development from v7.0.0 to v7.5.6. It is maintained here only for inbound reference links from elsewhere. It is no longer actively updated.

Jump to the current version of aTbRef

Tinderbox 7 Icon

contains(item)


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator Altered: 

 Function   [other Function type actions]

 Item   [operators of similar scope]

 Query Boolean   [other Query Boolean operators]

 Baseline

 


contains("item")

Returns Boolean true if the note evaluated from item is a direct child of the current note or, put conversely, if the note is the parent of item. Thus it can be thought of as an "is parent of" operator - and as such a counterpart to the "is a child of" operator inside().

The item parameter must be quoted unless an attribute reference. Ways to define item.

Legacy support: this replaces the legacy #contains query operator.

Examples:

contains(/foo) 

This is a full path so can match only the root-level note 'foo'. But:

contains("bar") 

could match any note with the name 'bar' of which there may be more than one. If there is more that one, Tinderbox chooses one. This is fine if one match was desired but if there are known to be multiple 'bar' notes and it is desired to locate parent container of every one, then a different approach is needed, using any() - the process is described under any().

NOTE: Checking attribute values, as opposed to object containment

There are a range of other tools to check if a String-, List- or Set-type attribute's value contains a desired search pattern.