ping_pong document_type=en16931_correct status=failed attempts=3 exhausted=true
Wrote corrected XML (2438 chars) -> /Users/harshbansal/Documents/projects/f8_library/fintom8-backend/examples/test_files/corrected_ubl.xml
{
  "correct": false,
  "name": "en16931",
  "format": "ubl",
  "errors": [
    {
      "path": "Line 46, Column 41",
      "message": "expected '>', line 46, column 42 (<string>, line 46)",
      "code": "XML_SYNTAX_ERROR"
    }
  ],
  "warnings": [],
  "units": null,
  "_debug": {
    "attempts": 4,
    "exhausted": true,
    "raw": "<?xml version='1.0' encoding='UTF-8'?>\n<Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\" xmlns:cac=\"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2\" xmlns:cbc=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:specification:ubl:schema:xsd/UBL-Invoice-2 file:///Users/dev/ubl/xsd/maindoc/UBL-Invoice-2.1.xsd\">\n  <cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0</cbc:CustomizationID>\n  <cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID>\n  <cbc:ID>INV-2026-115</cbc:ID>\n  <cbc:IssueDate>2026-02-11</cbc:IssueDate>\n  <cbc:DueDate>2026-03-13</cbc:DueDate>\n  <cbc:InvoiceTypeCode>380 </cbc:InvoiceTypeCode>\n  <cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>\n  <cbc:BuyerReference>MISSING_DATA</cbc:BuyerReference>\n  <cac:AdditionalDocumentReference>\n    <cbc:ID>ET-ATT-1</cbc:ID>\n    <cbc:DocumentDescription>Delivery note</cbc:DocumentDescription>\n    <cac:Attachment>\n      <cbc:EmbeddedDocumentBinaryObject filename=\"delivery-note.pdf\">data:application/pdf;base64,JVBERi0xLjEKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZz4+ZW5kb2JqCnRyYWlsZXI8PC9Sb290IDEgMCBSPj4KJSVFT0YK</cbc:EmbeddedDocumentBinaryObject>\n    </cac:Attachment>\n  </cac:AdditionalDocumentReference>\n  <cac:AccountingSupplierParty>\n    <cac:Party>\n      <cac:PartyName>EcoTools GmbH</cac:PartyName>\n      <cac:PostalAddress>\n        <cbc:StreetName>Musterstr. 11</cbc:StreetName>\n        <cbc:AdditionalStreetName></cbc:AdditionalStreetName>\n        <cbc:CityName>Cologne</cbc:CityName>\n        <cbc:PostalZone>50711</cbc:PostalZone>\n        <cac:Country>\n          <cbc:IdentificationCode>de</cbc:IdentificationCode>\n        </cac:Country>\n      </cac:PostalAddress>\n      <cac:PartyTaxScheme>\n        <cbc:CompanyID>DE123456789</cbc:CompanyID>\n        <cac:TaxScheme>\n          <cbc:ID>VAT</cbc:ID>\n        </cac:TaxScheme>\n      </cac:PartyTaxScheme>\n      <cac:PartyLegalEntity>\n        <cbc:RegistrationName>EcoTools GmbH</cbc:RegistrationName>\n      </cac:PartyLegalEntity>\n    </cac:Party>\n  </cac:AccountingSupplierParty>\n  <cac:AccountingCustomerParty>\n    <cac:Party>\n      <cac:PartyName>Digitale Handel BV</cac:PartyName>\n      <cac:PostalAddress>\n        <cbc:StreetName>Gaandeweg 5</cbc:StreetName>\n        <cbc:CityName>Amsterdam</cbc:City",
    "history": [
      {
        "attempt": 1,
        "correct": false,
        "errors": [
          {
            "path": "/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:AdditionalDocumentReference[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:Attachment[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:EmbeddedDocumentBinaryObject[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]",
            "message": "[UBL-DT-06]-Binary object elements shall contain the mime code attribute",
            "code": "UBL-DT-06"
          },
          {
            "path": "/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:AccountingSupplierParty[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:Party[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:PostalAddress[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:Country[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:IdentificationCode[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]",
            "message": "[BR-CL-14]-Country codes in an invoice MUST be coded using ISO code list 3166-1",
            "code": "BR-CL-14"
          },
          {
            "path": "/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:InvoiceLine[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:Item[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:OriginCountry[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:IdentificationCode[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]",
            "message": "[BR-CL-15]-Country codes in an invoice MUST be coded using ISO code list 3166-1",
            "code": "BR-CL-15"
          },
          {
            "path": "/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:InvoiceLine[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:Price[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:PriceAmount[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]",
            "message": "[BR-CL-03]-currencyID MUST be coded using ISO code list 4217 alpha-3",
            "code": "BR-CL-03"
          },
          {
            "path": "/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:InvoiceLine[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][2]/*:Price[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:PriceAmount[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]",
            "message": "[BR-CL-03]-currencyID MUST be coded using ISO code list 4217 alpha-3",
            "code": "BR-CL-03"
          },
          {
            "path": "Line 15, Column 0",
            "message": "Element '{urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2}EmbeddedDocumentBinaryObject': The attribute 'mimeCode' is required but missing.",
            "code": "XSD"
          },
          {
            "path": "Line 15, Column 0",
            "message": "Element '{urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2}EmbeddedDocumentBinaryObject': 'data:application/pdf;base64,JVBERi0xLjEKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZz4+ZW5kb2JqCnRyYWlsZXI8PC9Sb290IDEgMCBSPj4KJSVFT0YK' is not a valid value of the local atomic type.",
            "code": "XSD"
          },
          {
            "path": "Line 118, Column 0",
            "message": "Element '{urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2}PriceAmount': The attribute 'currencyID' is required but missing.",
            "code": "XSD"
          },
          {
            "path": "Line 136, Column 0",
            "message": "Element '{urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2}PriceAmount': The attribute 'currencyID' is required but missing.",
            "code": "XSD"
          }
        ],
        "warnings": []
      },
      {
        "attempt": 2,
        "correct": false,
        "errors": [
          {
            "path": "Line 1, Column 0",
            "message": "Start tag expected, '<' not found, line 1, column 1 (<string>, line 1)",
            "code": "XML_SYNTAX_ERROR"
          }
        ],
        "warnings": []
      },
      {
        "attempt": 3,
        "correct": false,
        "errors": [
          {
            "path": "Line 31, Column 50",
            "message": "Opening and ending tag mismatch: CompanyID line 31 and CompanyID, line 31, column 51 (<string>, line 31)",
            "code": "XML_SYNTAX_ERROR"
          }
        ],
        "warnings": []
      },
      {
        "attempt": 4,
        "correct": false,
        "errors": [
          {
            "path": "Line 46, Column 41",
            "message": "expected '>', line 46, column 42 (<string>, line 46)",
            "code": "XML_SYNTAX_ERROR"
          }
        ],
        "warnings": []
      }
    ],
    "max_correction_attempts": 3,
    "correction_attempts": 3,
    "initial_validate": {
      "attempt": 1,
      "correct": false,
      "errors": [
        {
          "path": "/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:AdditionalDocumentReference[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:Attachment[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:EmbeddedDocumentBinaryObject[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]",
          "message": "[UBL-DT-06]-Binary object elements shall contain the mime code attribute",
          "code": "UBL-DT-06"
        },
        {
          "path": "/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:AccountingSupplierParty[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:Party[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:PostalAddress[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:Country[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:IdentificationCode[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]",
          "message": "[BR-CL-14]-Country codes in an invoice MUST be coded using ISO code list 3166-1",
          "code": "BR-CL-14"
        },
        {
          "path": "/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:InvoiceLine[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:Item[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:OriginCountry[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:IdentificationCode[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]",
          "message": "[BR-CL-15]-Country codes in an invoice MUST be coded using ISO code list 3166-1",
          "code": "BR-CL-15"
        },
        {
          "path": "/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:InvoiceLine[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:Price[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:PriceAmount[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]",
          "message": "[BR-CL-03]-currencyID MUST be coded using ISO code list 4217 alpha-3",
          "code": "BR-CL-03"
        },
        {
          "path": "/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:InvoiceLine[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][2]/*:Price[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:PriceAmount[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]",
          "message": "[BR-CL-03]-currencyID MUST be coded using ISO code list 4217 alpha-3",
          "code": "BR-CL-03"
        },
        {
          "path": "Line 15, Column 0",
          "message": "Element '{urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2}EmbeddedDocumentBinaryObject': The attribute 'mimeCode' is required but missing.",
          "code": "XSD"
        },
        {
          "path": "Line 15, Column 0",
          "message": "Element '{urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2}EmbeddedDocumentBinaryObject': 'data:application/pdf;base64,JVBERi0xLjEKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZz4+ZW5kb2JqCnRyYWlsZXI8PC9Sb290IDEgMCBSPj4KJSVFT0YK' is not a valid value of the local atomic type.",
          "code": "XSD"
        },
        {
          "path": "Line 118, Column 0",
          "message": "Element '{urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2}PriceAmount': The attribute 'currencyID' is required but missing.",
          "code": "XSD"
        },
        {
          "path": "Line 136, Column 0",
          "message": "Element '{urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2}PriceAmount': The attribute 'currencyID' is required but missing.",
          "code": "XSD"
        }
      ],
      "warnings": []
    }
  }
}
correct=False errors=1 artifact_len=2438
