XPath Keywords and System Variables

3 minutes to read Download PDF Edit

In XPath, several keywords and system variables can be used called as a comparison.

Keywords

  • NULL
  • empty

Either of these keywords can be used to check whether an attribute has a value (any value) or if it has been left empty.

System variables

System variables can be used to obtain system or date related values. The following tokens are available:

Token Description
[%CurrentUser%] GUID of the user currently logged on
[%CurrentObject%] GUID of the active object (in the context)

Userroles

These will be created for each userrole in your project. Here is an example:

Token Description
[%UserRole_Administrator%] The userrole Administrator

The following tokens can be used to obtain a date and time value:

Token Description
[%CurrentDateTime%] Current date and time
[%BeginOfCurrentMinute%] Date and time at the beginning of the current minute
[%BeginOfCurrentMinuteUTC%] Date and time at the beginning of the current minute in UTC
[%EndOfCurrentMinute%] Date and time at the end of the current minute
[%EndOfCurrentMinuteUTC%] Date and time at the end of the current minute in UTC
[%BeginOfCurrentHour%] Date and time at the beginning of the current hour
[%BeginOfCurrentHourUTC%] Date and time at the beginning of the current hour in UTC
[%EndOfCurrentHour%] Date and time at the end of the current hour
[%EndOfCurrentHourUTC%] Date and time at the end of the current hour in UTC
[%BeginOfCurrentDay%] Date and time at the beginning of the current day
[%BeginOfCurrentDayUTC%] Date and time at the beginning of the current day in UTC
[%EndOfCurrentDay%] Date and time at the end of the current day
[%EndOfCurrentDayUTC%] Date and time at the end of the current day in UTC
[%BeginOfCurrentWeek%] Date and time at the beginning of the current week
[%BeginOfCurrentWeekUTC%] Date and time at the beginning of the current week in UTC
[%EndOfCurrentWeek%] Date and time at the end of the current week
[%EndOfCurrentWeekUTC%] Date and time at the end of the current week in UTC
[%BeginOfCurrentMonth%] Date and time at the beginning of the current month
[%BeginOfCurrentMonthUTC%] Date and time at the beginning of the current month in UTC
[%EndOfCurrentMonth%] Date and time at the end of the current month
[%EndOfCurrentMonthUTC%] Date and time at the end of the current month in UTC
[%BeginOfCurrentYear%] Date and time at the beginning of the current year
[%BeginOfCurrentYearUTC%] Date and time at the beginning of the current year in UTC
[%EndOfCurrentYear%] Date and time at the end of the current year
[%EndOfCurrentYearUTC%] Date and time at the end of the current year in UTC

The following tokens can be used to add or subtract a period of time from a date and time token value:

Token Description
[%DayLength%] Length of one day (24 hour)
[%HourLength%] Length of one hour
[%MinuteLength%] Length of one minute
[%SecondLength%] Length of one second
[%WeekLength%] Length of one week (seven days)
[%YearLength%] Length of one year

These variables must be used as string values, placed between two quotes. Time related tokens combined with period related tokens must be placed within one string. See example 3.

Copyright © Mendix. All rights reserved. | Mendix.com | Terms of Use | Privacy Policy