Altova RecordsManager

The XPath language is used to locate nodes in a hierarchical document, and it is used in RecordsManager to locate field values within the hierarchical structure of your RecordsManager database. For a description of this hierarchical database structure, see the topic How Data Is Stored.

 

For more information about XPath, see the following links:

 

XPath 3.1 Recommandation of the W3C

XPath 3.1 Functions and Operators

Altova's "A Gentle Introduction to XPath"

Altova's "XPath 3.1 Training"

 

XPath expressions in RecordsManager

In addition to standard XPath procedures, RecordsManager uses the additional features listed below.

 

The $CurrentUser variable

The $CurrentUser variable holds data about the current user, such as the username and email address. To access this data, you would use the variable as given below.

 

$CurrentUser/Name returns the user's name as a string  

$CurrentUser/Email returns the user's email address as a string  

$CurrentUser/Group returns the names of the user groups to which the user belongs*

$CurrentUser/Role returns the names of the roles to which the user belongs*

 

*     Since the user could belong to more than one user group or role, an XPath expression that returns these would return a sequence of items. You would need to adjust your expression to take this into account. For example, if you want to choose an item from such a sequence, you could use a predicate filter. In the following example, the EditedBy field of the current data table is of type User, which is special in that it has the child properties Group and Role, both of which can have multiple values (not a single value)

 

EditedBy/Role[contains(., 'Admin')]

 

Locating the fields of ancestor or child records

In the XPath expressions of entry forms, you can use locator expressions to select the fields of ancestor records and child records. The first step of the locator expression would be the name of the data table followed by the text _fields. The second step of the expression is the name of the field that you want to locate. The expression would have the following form:

 

<DataTableName>_fields/<FieldName>

 

Note:If a field has a space in its name, use the underscore character for the space. For example, for a field named Expiry Date, use Expiry_Date in XPath expressions.

 

In the following examples, the Person data table has an Address field (first example below). It also has an EditedBy field, which is of type User and is therefore special in that it has the child properties Group and Role, both of which can have multiple values (not a single value); (the Name and Email properties of a User type field, on the other hand, each have a single string value); see the second and third examples below.

 

Person_fields/Address

Person_fields/EditedBy/Name

Person_fields/EditedBy/Role[.='Admin']

 

 

 

© 2018-2024 Altova GmbH