Skip to main content

XSLT Transformation

XSLT Transformations for Converting XML Formats

Written by Petr Pech

So that ABRA Flexi can also import and export XML formats other than its native one, you can use XSLT transformations. This is typically used to convert data from another accounting system or to produce output in a format expected by a downstream application.


How it works

Direction

When the transformation is applied

Import

The XSLT transformation is first applied to the XML from the request body, and only the resulting XML is then imported into ABRA Flexi.

Export

First, the filter, pagination, and level of detail are applied; the XSLT transformation is then applied to the resulting XML.

🚨 XSLT can only be used in combination with XML. With the .json extension, the call will fail with error 400 and the message Content is not allowed in prolog.


Usage in the REST API

The transformation is selected using the format parameter, in which the transformation is specified by its identifier — either a code with the code: prefix, or a numeric ID:

GET https://demo.flexibee.eu/c/demo/faktura-vydana.xml?format=code:FAKTURY
GET https://demo.flexibee.eu/c/demo/faktura-vydana.xml?format=3

⚠️ The code: prefix is mandatory — using the code alone without it will result in error 400 and the message Neznámý formát '…' pro XSL transformaci. You will get the same error for a transformation that doesn't exist in the company.


Where transformations live

User-defined transformations are stored in the xslt record, so you can also work with them via the API. You can list the available transformations as follows:

GET https://demo.flexibee.eu/c/demo/xslt.json?detail=custom:id,kod,nazev

Property

Required

Meaning

kod

yes

The code you then specify in the format parameter.

nazev

yes

The name of the transformation.

transformace

yes

The XSLT stylesheet itself.

popis, poznam

no

Description and note.

nazevA, nazevB, nazevC

no

Name in other languages (SK, EN, RO).

For details on how to create and manage transformations in the application, see the article User-Defined Transformations.

💡 Before deploying a transformation to an integration, test it on a single record — ?limit=1 together with format= returns a small output, making it much easier to spot errors in the stylesheet.


Related

Did this answer your question?