Path selector

The path selector uses CSS3. In addition to the standard CSS selectors we have added a few additional selectors and tools to make it even more powerful, which are listed below.

Using inputs and outputs

You can include your input and output variables in your dexi.io CSS3 selectors:

$in['input field'] / $out['output field']
Includes the input or output variable without any added quotes.
Example:
Input field1 value shoes
Element path article > p:text_contains("sport $in['field1']")
Resulting path article > p:text_contains("sport shoes")
@in['input field'] / @out['output field']
Includes the input or output variable with added quotes.
Example:
Input field1 value sporting goods
Element path article > p:text_contains(@in['field1'])
Resulting path article > p:text_contains("sporting goods")

Dexi-specific selectors

:visible
Filters elements to only be those that are visible. Visibility is determined by wether an element has both width and height greater than 0 (like jQuery).
:eq($index)
Get specific element in the matched elements (like jQuery).
:first / :last
Gets the first / last element in the matched elements.
:self
Matches the element itself. Useful when matching current scope in a loop or similar.
:prev / :next
Matches the previous or next element for every matched element.
:parent
Matches the parent of every matched element.
:closest($selector)
Matches the closest parent element that matches $selector.
:text_contains("$text")
Filters the matched elements by those that contains $text. Will only match on inner text (not tags / attributes).
:text_matches("$regex")
Filters the matched elements by those that matches the regular expression $regex. Will only match on inner text (not tags / attributes).
:text_is("$text")
Filters the matched elements by those that match $text exactly. Will only match on inner text (not tags / attributes).
:text_start("$text")
Filters the matched elements by those that start with $text. Will only match on inner text (not tags / attributes).
:text_end("$text")
Filters the matched elements by those that end with $text. Will only match on inner text (not tags / attributes).
:text_bestmatch("$text")
Chooses the element within the matched elements that is the best match for the text provided in $text. The best match is calculated using Levenshtein.
:text_bestmatch_numeric("$number")
Chooses the element within the matched elements that has the numeric value closest to the number provided in $number. The best match is considered the number closest (in either direction) from the provided value.

Further reading

W3Schools introduction to CSS selectors:
http://www.w3schools.com/cssref/css_selectors.asp

Mozilla Guide to CSS selectors:
https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_started/Selectors

jQuery selectors:
http://api.jquery.com/category/selectors/