Selectors provide a consistent way to work with information in a Kodexa Document

Working with a document in Kodexa you often want to select specific nodes on which to apply an action. This similar to how you might use an XPath to select content from an XML document.

We use a derivative of an XPath to allow you to do this directly against documents. The key here is that we do not try handle extracting specific information from a document, we use this form of path to allow you to select one or more nodes that you want to work with.

The reason for this is to ensure that you are always working with real nodes in the document.


Let's take a look at a few examples.




All nodes in the document


Current node


Select all nodes of type paragraph


Select all nodes with feature spatial:bbox


Select all nodes with tag cheese

//*[contentRegex('.*Hello World.*')]

Select all nodes where the content matches the regular expression '.*Hello World.*'

//page[contentRegex('.*Hello World.*', true)]

Select a page node whether the content of itself and all its children combined matches a regex

//*[content='Hello World']

Select all nodes where the content exactly matches 'Hello World'


Match all nodes where the tag name matches the regex


Match all nodes where the type of the node is limited by the type regex predicate


Match the node with that UUID

//title | //header

Match all title type nodes and union with all header type nodes

//page intersect *[hasTag('ORG')]

Return a list of nodes that intersect the two selectors