Validate with XPaths

Colectica Designer allows you to perform custom validation using XPaths.

Follow these steps to validate against a list of XPaths.

  1. Navigate to an item.

  2. Click the Validate with XPaths button on the ribbon.

  3. Choose the file that lists the XPaths to check.

  4. Colectica will check for content that matches any XPaths in the file you specified.

  5. If any matches are found, a report will be opened in your web browser.

XPath File Format

The file that lists the XPaths must be a plain text file with one XPath per line.

The XPaths must select elements that are considered invalid.

Example XPaths

Here are some sample XPaths to perform various validations.

Ensure all studies have a citation with a title

The first XPath selects any StudyUnit elements that do not have a Citation. The second XPath selects any Citation elements that do not have a Title.

//g:StudyUnit[not(r:Citation)]
//r:Citation[not(r:Title)]

Ensure all citations have a subtitle in English

//r:Citation[not(r:Title/r:String[@xml:lang="en-US"])]

Find any variables without any label

//l:Variable[not(r:Label)]

Find any variables that do not have labels in both English and Norwegian

//l:Variable/r:Label[not(child::r:Content[@xml:lang="en-US"] and child::r:Content[@xml:lang="no"])]