# Document validation

# Introduction

The following section discuss principles and tools used when validating the correctness of business documents.


# Validation tools

# Pagero document validator

We offer a free online validation tool, powered by the well known validation engine "Validex".

The only requirement is a a user account, which is free for anyone to create!

It supports a wide variety of formats, including some unique ones not easily found online e.g. cXML, TEAPPS XML, Finvoice XML.

Pagero Document Validator
https://pagero.validex.net/

# VEFA validator

This is an open validation tool offered by the Norwegian Peppol authority DFØ.

It supports all Peppol formats in addition to a lot of Norway-specific (EHF) formats.

VEFA Validator
https://anskaffelser.dev/service/validator/


# General validation principles

# XML schema

XML validation is the process of checking a document written in XML to confirm that it is both well-formed and also "valid" in that it follows a defined structure.

When validating the syntax of files against XML schemas (DTD or XSD), the following is checked:

  • All element names and attributes must be correctly written and follow the XML schema.
  • All mandatory elements/element names must be present.
  • All element’s contents must be according to the element’s type definition.

Pagero validate all inbound and outbount files against XML schemas (in almost all cases). Invalid files run the risk of being stopped in processing in our platform.

# Schematron

Schematron is a rule-based validation language for making assertions about the presence or absence of patterns in XML trees. It is a structural schema language expressed in XML using a small number of elements and XPath.

# Examples

  • Calculate and validate that all invoice lines sum to the invoice total net amount.
  • Each tax category summary in an order includes a tax rate.
  • The delivered quantity on all lines in a despatch advice is not negative.

# Non XML based formats

While not directly comparable to the rather deep level of granularity of XML schema and schematron validation; we perform structural and syntactical validation on the following format types as well:

  • UN/EDIFACT
  • ASC/ANSI X12
  • Fixed position
  • CSV

The validation of these format types mainly check the structure and order of segments, segment groups and elements and that they conform with the official message definition/s.