Notice Validation

Before an eForms notice can be accepted for publication, the TED Central Validation Service (TED CVS) always validates it against a set of business rules.

TED CVS checks the information submitted in the notice for correctness, consistency and completeness, to improve the quality of the data collected and shared through public procurement notices.

Your application submits notices for publication, and only valid notices are accepted. This page describes the ways in which your application can validate a notice before it submits it.

Using the Central Validation Service

One option, available to everyone, is to validate your notices with the TED Validation API. Its page describes the endpoint and how to send a request. The API returns a validation report in SVRL (Schematron Validation Report Language), which you can use to show validation messages to your users.

The report lists all the validation rules that ran. Each assertion that failed has an element svrl:failed-assert. Its attribute @role gives the severity of the failure, @location gives the place of the problem as an XPath, and @test gives the XPath of the test.

The validation message to show to the user is in the element svrl:text, in the language that your request asked for. If the message is not yet available in this language, the report gives the identifier of its label instead.

For some rules, @location does not give the exact element that caused the problem. For example, for a rule that checks that a mandatory element is present, @location gives the element that should contain the missing one. The element svrl:diagnostic-reference then gives the XPath of the missing element, relative to @location.

Reusing the Schematron rules

You can also validate notices with a validation service of your own, inside your information system. In this way, you save a request to the TED Validation API for each notice, and you can add Schematron rules of your own to those of the SDK.

Schematron is a language for writing rules about XML documents, and a Schematron validator checks a notice against them. The SDK provides its validation rules as Schematron files, which you can run with such a validator (see Schematron files).

Notice validation inside your application

The Schematron rules in the folder schematrons validate complete XML notices. They are not suitable for validating a form while the user is still filling it in.

For this validation while the user fills in the form, also called client-side validation, the SDK provides suitable rules, as constraints attached to each field in fields/fields.json.

These constraints are written as EFX expressions. To use them, you translate them into a language that your application can run, such as JavaScript.

To learn how to translate EFX, see EFX grammar and the EFX Toolkit.
To learn what the constraints in fields/fields.json mean, see Field metadata.