Download the PHP package xmlvalid/xmlvalid-php without Composer

On this page you can find all versions of the php package xmlvalid/xmlvalid-php. 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 xmlvalid-php

xmlvalid for PHP

PHP client for the xmlvalid API: validate XML documents and e-invoices against XSD, DTD, RelaxNG and Schematron business rules. Peppol BIS, XRechnung, Factur-X / ZUGFeRD, EN 16931, UBL, CII and national rules (France, Italy, Croatia, Romania and more) are in the schema catalog; your own schemas work too.

Install

If your project has no PSR-18 client yet, Composer adds one for you (php-http/discovery). Create an API key under Dashboard → API keys.

Validate

The document can be:

The schema:

Argument Validates against
schema: 'peppol-bis-3-invoice' A catalog entry, with its business rules
schema: 'auto' The catalog profile an e-invoice names (BT-24), for mixed invoices
schema: '@orders-v3' One of your saved schemas
schemaFile: 'order.xsd' An XSD, DTD or RelaxNG file sent with the document
doctype: true The DOCTYPE the document declares
none Well-formedness only

Your own Schematron runs after the schema check: rules: 'rules.sch', or for rules with includes, relative path => file: rules: ['main.sch' => '/path/main.sch', 'parts/totals.sch' => '/path/parts/totals.sch'].

A catalog schema's business rules move to new releases (Peppol BIS, XRechnung). To fail instead of getting findings from rules that changed, pin the releases a check was written against: rulesVersion: '[email protected]' (or a list). If one runs another release, RulesVersionMismatchException is thrown before anything runs or counts. schemas() lists each schema's ruleSets with their current releases.

The result

For a .zip, $validation->result->items has one result per document; for a PDF, $validation->result->pdf names the invoice found in it.

Write e-invoices from JSON

createInvoice() writes an invoice as XRechnung (UBL or CII), Peppol BIS, ZUGFeRD / Factur-X or a French CTC invoice, with the e-invoice generator's code, and checks it against the profile's schema and business rules. format: 'pdf' makes a ZUGFeRD PDF with the XML inside.

The fields are listed in the API reference.

Long validations, reports and the account

validate() waits up to 15 minutes (timeout:); a TimeoutException carries the validation, which goes on on the server. To queue and come back later:

Errors

Every exception extends Xmlvalid\Exception\XmlvalidException. API refusals are ApiExceptions with $statusCode, $errorCode and, for invalid_request, $fields:

Exception When
AuthenticationException 401: no key, a revoked key
PlanLimitException 403: not in your plan
NotFoundException 404: no such validation, or it expired (24 hours)
NotFinishedException 409: the report of a validation still running
RulesVersionMismatchException 409: a rule set pinned with rulesVersion runs another release; $ruleSet, $pinned, $current
DocumentTooLargeException 413: over your plan's size limit
InvalidRequestException 422: unknown schema, a bad URL, …
QuotaExceededException 429: this month's validations are used up
RateLimitedException 429: still limited after the retries; $retryAfter seconds
ServerException 5xx
TransportException The request could not be sent or its answer read
TimeoutException Still running after timeout:

Webhooks

On Pro, xmlvalid can call your endpoint when a validation finishes or a URL monitor changes state. Check the signature with the endpoint's secret and the raw body:

Options

Development

License

MIT


All versions of xmlvalid-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
php-http/discovery Version ^1.19
psr/http-client Version ^1.0
psr/http-client-implementation Version *
psr/http-factory Version ^1.0
psr/http-factory-implementation Version *
psr/http-message Version ^1.1 || ^2.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 xmlvalid/xmlvalid-php contains the following files

Loading the files please wait ...