Download the PHP package xterr/php-espd without Composer

On this page you can find all versions of the php package xterr/php-espd. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-espd

PHP ESPD

PHP License: MIT Packagist Version PHPStan Level 8

Typed PHP classes for ESPD (European Single Procurement Document) based on ESPD-EDM v2.1.1–v4.1.0 / UBL 2.3.

Serialize and deserialize QualificationApplicationRequest and QualificationApplicationResponse documents without DOM code, with multi-version support (v2.1.1 through v4.1.0). Validate documents against the official OP-TED Schematron business rules with 1:1 compliance. Codelist values are PHP enums with full type safety, including union-typed properties for elements that span multiple codelists.

Features

Installation

Requirements:

Optional (for validation):

Quick Start

Deserialize an ESPD Request

Serialize to XML

Validate against EU business rules

Requires the ext-saxonc PHP extension (installation guide).

You can also validate raw XML strings directly:

Work with typed enums

Multi-version deserialization

The library supports ESPD documents from all major versions. V2 long-form criterion codes are automatically resolved:

Criterion Part & Section classification

Every criterion code knows its position in the ESPD form hierarchy defined by Commission Implementing Regulation (EU) 2016/7:

ESPD Form Parts (per EU Regulation 2016/7, Annex 2):

Part Title Sections
I Information concerning the procurement procedure
II Information concerning the economic operator A, B, C, D
III Exclusion grounds A (Criminal convictions), B (Taxes/social security), C (Insolvency/misconduct), D (National grounds)
IV Selection criteria α (Global indication), A (Suitability), B (Economic standing), C (Technical ability), D (Quality/environment certs)
V Reduction of the number of qualified candidates
VI Concluding statements

Union enum — ExpectedCode

ExpectedCode can hold values from three different codelists depending on the criterion context. The listID XML attribute acts as the runtime discriminator:

Load the criterion taxonomy

The full ESPD criterion tree ships as a resource:

Validation

The validation subsystem runs the official OP-TED/ESPD-EDM Schematron business rules via SaxonC-HE. This guarantees 1:1 compliance with the EU reference validator — identical rule IDs, severity levels, and error messages.

Multi-version validation

The validator supports 4 ESPD-EDM version families and automatically detects which rule set to apply based on the document's ProfileExecutionID:

Version Family Rule Set ProfileExecutionID values
VersionFamily::V2 v2.1.1 ESPD-EDMv2.0.0-REGULATED, ESPD-EDMv2.0.0-SELFCONTAINED, ESPD-EDMv2.1.0-REGULATED, ESPD-EDMv2.1.0-SELFCONTAINED, ESPD-EDMv2.1.1-BASIC, ESPD-EDMv2.1.1-EXTENDED
VersionFamily::V3 v3.3.0 ESPD-EDMv3.0.0, ESPD-EDMv3.0.1, ESPD-EDMv3.1.0, ESPD-EDMv3.2.0, ESPD-EDMv3.3.0
VersionFamily::V4_0 v4.0.0 ESPD-EDMv4.0.0
VersionFamily::V4_1 v4.1.0 ESPD-EDMv4.1.0

Auto-detection (recommended) — the validator reads ProfileExecutionID from the XML and selects the matching rule set:

Explicit version — useful when the document lacks a ProfileExecutionID or you want to force a specific rule set:

If auto-detection fails (missing or unrecognized ProfileExecutionID), a ValidationException is thrown prompting you to specify the version explicitly.

What gets validated

Category Rule IDs Severity
Cardinality BR-OTH-04-* Fatal
Codelist values auto-generated Fatal
Criterion structure BR-TC-02 through BR-TC-21 Fatal/Error
Exclusion criteria BR-REQ-30 Fatal
Selection criteria BR-REQ-40 Warning
Procurer data BR-REQ-20-* Warning/Error
Economic operator BR-RESP-10-*, BR-RESP-20-* Error
Other BR-SC-10, BR-OTH-* Mixed

Validation result API

Each Violation exposes:

Property Description
ruleId Schematron rule ID (e.g. BR-OTH-04-01)
severity Severity::Fatal, Severity::Error, or Severity::Warning
message Human-readable error message
location XPath to the failing XML node
test XPath test expression from the rule
pattern Pattern group ID

Generated Structure

Codelist Enums

Enum listID Values
CriterionCode criterion crime-org, corruption, fraud, ... (+ getPart(), getSection())
EspdPart I, II, III, IV, V, VI (EU Regulation 2016/7 form Parts)
CriterionElement criterion-element-type QUESTION, REQUIREMENT, CRITERION, ...
ResponseData response-data-type INDICATOR, AMOUNT, DATE, DESCRIPTION, ...
PropertyGroup property-group-type ON*, ONTRUE, ONFALSE
CountryCode country ISO 3166-1 codes
LanguageCode language ISO 639 codes
CurrencyCode currency ISO 4217 codes
OccupationCode occupation ESCO occupation codes
EconomicOperatorSize economic-operator-size SME, micro, large, ...
EoRole eo-role-type Sole tenderer, lead entity, ...
BooleanGUIControl boolean-gui-control-type CHECKBOX_TRUE, RADIO_BUTTON_TRUE, ...
FinancialRatio financial-ratio-type Ratio types
ProfileExecutionID profile-execution-id ESPD-EDMv4.1.0, ...
AccessRight access-right Access right codes
Docrefcontent docrefcontent-type Document reference content types
EOID eoid-type Economic operator ID types

Codelist Bindings

These properties are typed with codelist enums instead of generic Code:

Class Property Enum
TenderingCriterion criterionTypeCode CriterionCode
TenderingCriterionProperty typeCode CriterionElement
TenderingCriterionProperty valueDataTypeCode ResponseData
TenderingCriterionProperty expectedCode BooleanGUIControl\|FinancialRatio\|OccupationCode
TenderingCriterionPropertyGroup propertyGroupTypeCode PropertyGroup
Country identificationCode CountryCode
Language localeCode LanguageCode

Installing SaxonC-HE

The ext-saxonc PHP extension is required only for validation. Serialization and deserialization work without it.

Docker (easiest)

macOS

For Intel Macs, replace arm64 with x86_64 in the download URL.

Linux (Ubuntu/Debian)

Verify

Schema Source

Generated from OP-TED/ESPD-EDM v4.1.0, which uses OASIS UBL 2.3 OS schemas. The XSD schemas and Genericode codelist files are in resources/ (not committed — dev-only). The pre-compiled Schematron XSL validation rules are bundled in resources/validation/ for all 4 version families (v2.1.1, v3.3.0, v4.0.0, v4.1.0). V2.1.1 codelist GC files are in resources/cl/gc/.

Regenerating

The php-espd CLI tool orchestrates the full code generation pipeline:

What it does

  1. Parses criterion taxonomies — reads ESPD-EDM v2.1.1 and v4.1.0 taxonomy XML files
  2. Cross-references UUIDs — matches v2 long-form codes to v4 short-form codes by criterion UUID (+ 6 manual EO_DATA equivalences for codes where v4 uses structured IDs instead of UUIDs)
  3. Generates v2→v4 mapping file — writes resources/criterion/v2-to-v4-mapping.php (v2 → v4 lookup) 3b. Generates code-to-part mapping — parses criterionList.xml for exclusion/selection classification, resolves sub-sections from v2 code prefixes and EU Regulation 2016/7 Annex 2, writes resources/criterion/code-to-part.php
  4. Generates Genericode file — writes resources/codelists/gc/CriteriaTypeCode.gc with all v2 codes
  5. Runs UBL generator — regenerates all PHP classes, codelist enums, and registries from XSD schemas and Genericode files

The generator automatically merges v2 criterion codes into CriterionCode with a V2_ prefix and injects the CriterionCodeMethods trait for v2↔v4 conversion.

Options

Option Description
--force, -f Actually generate files (without this, dry-run only)
--codelists-only Only regenerate codelist enums (skip class generation)
--mapping-only Only regenerate v2→v4 mapping files (skip UBL generator)

Example output

Multi-version support

The generated CriterionCode enum contains both v4 short codes (crime-org, corruption, ...) and v2 long-form codes prefixed with V2_ (CRITERION.EXCLUSION.CONVICTIONS.PARTICIPATION_IN_CRIMINAL_ORGANISATION, ...). This allows deserializing ESPD documents from both v2.x and v4.x without data loss:

Development

EU Legislation References

The ESPD form structure and criterion classification are defined by EU legislation:

Document Reference Relevance
Commission Implementing Regulation (EU) 2016/7 Standard form for the ESPD Defines the 6-part form structure (Parts I–VI) with sections A–D, used by EspdPart enum and getPart()/getSection()
Directive 2014/24/EU Public procurement directive Art. 57: exclusion grounds (Parts III-A/B/C/D), Art. 58: selection criteria (Parts IV-A/B/C), Art. 62: quality/environment certificates (Part IV-D)
ESPD-EDM (OP-TED) Exchange Data Model Source of criterion taxonomy XML, Schematron validation rules, and Genericode codelists used by this library

License

MIT - Copyright (c) 2026 Ceana Razvan


All versions of php-espd with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-dom Version *
ext-libxml Version *
xterr/php-ubl Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package xterr/php-espd contains the following files

Loading the files please wait ...