Skip to content

Processing XML Documents (XRechnung & ZUGFeRD)

Last updated: 04.09.2025 • Reading time: ~5 minutes

Smart Processing supports the processing of standardized XML invoice formats – currently XRechnung and ZUGFeRD. The overall process largely follows the standard procedure (Classifying → Processing → Completion/Archiving). However, there are specific rules for Classification and Data Extraction (Capture) that make up this article.


Prerequisites

  • XML workflows are set up (Workflow File Type XML).
  • In Smart Processing Setup, the XML Classification Mapping is configured.
  • A Process Template exists; Smart Matching in the template is recommended (see below).

How It Works in Brief

  1. Classification via TypeCode

    • XRechnung/ZUGFeRD are not classified via AI models, but deterministically via the TypeCode in the XML.
    • The mapping TypeCode → Classification is maintained centrally in the XML Classification Mapping.
  2. Capture without separate setup

    • For XML, no separate capture setup is provided.
    • Smart Processing reads paths/elements from the XML, generates logical field names from them, and provides these as extracted fields.
    • No complex XPath paths are displayed as field names – instead, meaningful, consolidated identifiers (e.g., InvoiceNumber, BuyerVATId, Line.Amount).
  3. Matching to the Template

    • The logically named fields are assigned to the Process Template in the Matching Process.
    • Recommendation: In the template, activate Smart Field Matching to ensure automatic assignment.

Classification: XML TypeCode → Classification

Classification is done exclusively via the TypeCode in the XML (e.g., 380 = Invoice, 381 = Credit Note).

Procedure:

  1. Open Smart Processing Setup.
  2. Area ClassificationsXML Classification Mapping.
  3. Enter/change the mapping entries (Classification ↔ TypeCodes, comma-separated).

Capture for XML: Logical Field Names Instead of XPath

For XML invoices, Smart Processing performs structured parsing and generates logically named fields:

  • Header fields (e.g., InvoiceNumber, InvoiceDate, BuyerName, SellerVATId).
  • Line fields (e.g., Line.No, Line.ItemId, Line.Quantity, Line.Amount, Line.VATRate).
  • Document context (e.g., DocumentCurrency, PaymentTerms, ReferenceDocument).

Advantages:

  • Better readability and easier assignment in matching.
  • Robust against minor schema/profile variations, as long as semantic correspondences exist.

Note

Since a separate capture setup is not required, the Process Template (including Smart Matching) primarily controls the assignment to target tables and fields.


  • Use Smart Field Matching: Activate

  • Enables the automatic assignment of logically named XML fields to the Template Fields.

  • Lookup Validation (optional):

  • For master data fields (Customer/Supplier/Item), use Yes or Custom Codeunit to ensure clean references.

  • Numeric Options (e.g., decimal places, negative value handling):

  • Useful for amounts/quantities to process format variations stably.


Step-by-Step (Example Process)

  1. Import XML → File appears in the Inbound List (File Type XML).
  2. Classification → occurs automatically via TypeCode according to mapping.
  3. Process Document → with Smart Field Matching, header and line fields are automatically assigned to the template.
  4. Validation & Completion → check remarks, make corrections if necessary; execute Complete Process.
  5. Optional → Archiving in Document Central according to template/process options.

Troubleshooting

Document not classified

  • TypeCode is missing/different → check/supplement XML Classification Mapping.

Fields are missing or seem "inaccurate"

  • Check if the logical field names are present/assigned in the template.
  • Activate Smart Field Matching; alternatively, maintain Alternative Search Names in template fields.

Summary

  • Supported formats: XRechnung and ZUGFeRD.
  • Classification is done via TypeCode (mapping in settings).
  • Capture is not separately set up: Smart Processing generates logical field names from XML, no XPath paths.
  • Recommendation: Activate Smart Field Matching in the Process Template for automatic assignment.
  • The process (Draft → Matching → Validation → Completion/Archiving) follows the standard – only Classification and Capture are XML-specific solutions.

Setup Help