Skip to main content

Post-Transform

A post-transform converts the validated UBL of a document into another syntax with an XSL stylesheet: Cross Industry Invoice (CII) with the stylesheet shipped with NomaUBL, or a country's own format with a stylesheet of yours. UBL stays the pivot: the database, the statuses, the validation and the routing keep working on the UBL; the converted file is an extra output, written next to the UBL, downloadable from the invoice window and, when the platform expects it, sent in its place.

The post-transform is set per document and runs in both pipelines, whatever the source — a JD Edwards spool, an SAP or NetSuite extract, a custom ERP or a UBL file.


At a glance​

Post-transform: UBL stays the pivotThe validated UBL is converted into another syntax; database, statuses and routing keep the UBL.Sourcespool · UBL · APIUBL 2.1UBL XSLTValidationchecks of the rule setPost-transformubl-to-cii.xslCII file…-cii.xmlDatabasearchive · lifecyclePlatform connector{{content}} · {{derivedContent}}Invoice windowDownload CII — from the archiveFailure = warningUBL firstgeneration and validation unchangedPivotdatabase and statuses keep the UBLNever blocksPOST_TRANSFORM warningNext to the UBLsuffix replaces .xmlOn demandrecomputed from the archived UBL

Settings​

On the UBL tab of the document:

FieldDefaultDescription
Post-transform(blank = none)Stylesheet run on the validated UBL. Path placeholders are accepted (%APP_HOME%, %ENV%); the placeholder button inserts them. Example: %APP_HOME%/%ENV%/xsl/ubl-to-cii.xsl.
Post-transform output-cii.xmlSuffix that replaces the .xml of the UBL file name: F2026-1203.xml gives F2026-1203-cii.xml. The download uses the same name.
Post-transform name(blank)Short name of the converted syntax, shown on the download buttons: CII gives Download CII; blank gives Download converted file.

When it runs​

  1. The source is turned into UBL and validated with the packs of the document's rule set, as without a post-transform.
  2. When the validation leaves no blocking finding, the UBL goes through the stylesheet and the result is written next to the UBL file, with the output suffix.
  3. If the stylesheet fails, the failure is recorded as a warning finding POST_TRANSFORM on the invoice, visible in its validation errors and in Integration errors. The UBL keeps its course: an invoice is never blocked by its post-transform.

An invoice with a blocking finding gets no converted file; it is produced on the next run, once the invoice is fixed and processed again.


Downloading the converted file​

The invoice window (E-Invoicing) and the document window (E-Documents) show a Download CII button (or Download converted file) when the document has a post-transform. The file is computed on demand from the archived UBL, so it is available for every archived invoice, including those processed before the post-transform was set. A conversion error is shown in the window (Conversion failed: …).


Sending the converted file to the platform​

The body of the platform's API connector can carry the converted file in place of the UBL, with two placeholders:

PlaceholderValue
{{derivedContent}}Base64 of the converted file, like {{content}} for the UBL. Empty when the document has no post-transform.
{{derivedFilePath}}Path of the converted file on disk. Empty when the document has no post-transform.

{{content}} and {{filePath}} still designate the UBL. On a resend, the converted file is computed again from the archived UBL. The routing of the invoice — recipient, document type, statuses — keeps reading the UBL.


The shipped stylesheet: UBL to CII​

ubl-to-cii.xsl converts a UBL 2.1 Invoice or CreditNote into a Cross Industry Invoice D16B following the EN 16931 core model: parties and identifiers, notes with their subject codes, references, delivery, payment means with the IBAN or a proprietary account, allowances and charges, VAT breakdown, lines and attachments. It was checked on the demo corpus against the official EN 16931 CII rules. The demo UBL document is configured with it.


Other formats​

A country whose format is not UBL — a national syntax required by a platform or a tax administration — is handled with a stylesheet of the same kind: UBL in, the national syntax out. The UBL-based standards are handled differently, with a rule set of their own. Each national submission flow (connector, statuses) is a configuration of its own.


Tips & best practices​

  • Validate the UBL first. The post-transform only runs on an invoice without blocking finding; a correct UBL is the condition of a correct conversion.
  • Name the syntax. Post-transform name turns the generic button into Download CII, clearer for the users.
  • Watch the POST_TRANSFORM warnings after setting a new stylesheet: they point at the invoices the stylesheet does not handle.
  • Keep your own stylesheets under the environment, next to the other XSL files, and write the path with %APP_HOME% / %ENV%, so the same setting works on every environment.