// SPDX-License-Identifier: EUPL-1.2 // UBL-CR "element or attribute not used by EN 16931" assertions, from the CEN validation // artefacts 1.3.17 (pattern UBL-syntax). 673 of the 678 UBL-CR assertions have the form // `not(PATH)` with severity warning and are stored here; the other five // (UBL-CR-002, -412, -665, -666, -673) carry extra conditions and are coded in rules-syntax.ts. // // Encoding, entries separated by one space: `..` // id rule number; empty means "previous number + 1" // shared how many leading path segments are reused from the previous entry // rest remaining segments, `/`-separated // Path segments: `a:` = cac:, `b:` = cbc:, `e:` = ext:, `L` = cac:InvoiceLine | cac:CreditNoteLine, // a leading `//` matches at any depth, a final `@name` is an attribute. // tests/engine/fingerprints.test.ts pins the SHA-256 of the decoded table. const ENCODED = ".0.e:UBLExtensions 3.0.b:ProfileExecutionID .0.b:CopyIndicator .0.b:UUID .0.b:IssueTime .0.b:PricingCurrencyCode .0.b:PaymentCurrencyCode .0.b:PaymentAlternativeCurrencyCode .0.b:AccountingCostCode .0.b:LineCountNumeric .0.a:InvoicePeriod/b:StartTime .1.b:EndTime .1.b:DurationMeasure .1.b:Description .0.a:OrderReference/b:CopyIndicator .1.b:UUID .1.b:IssueDate .1.b:IssueTime .1.b:CustomerReference .1.b:OrderTypeCode .1.a:DocumentReference .0.a:BillingReference/a:InvoiceDocumentReference/b:CopyIndicator .2.b:UUID .2.b:IssueTime .2.b:DocumentTypeCode .2.b:DocumentType .2.b:XPath .2.b:LanguageID .2.b:LocaleCode .2.b:VersionID .2.b:DocumentStatusCode .2.b:DocumentDescription .2.a:Attachment .2.a:ValidityPeriod .2.a:IssuerParty .2.a:ResultOfVerification .1.a:SelfBilledInvoiceDocumentReference .1.a:CreditNoteDocumentReference .1.a:SelfBilledCreditNoteDocumentReference .1.a:DebitNoteDocumentReference .1.a:ReminderDocumentReference .1.a:AdditionalDocumentReference .1.a:BillingReferenceLine .0.a:DespatchDocumentReference/b:CopyIndicator .1.b:UUID .1.b:IssueDate .1.b:IssueTime .1.b:DocumentTypeCode .1.b:DocumentType .1.b:XPath .1.b:LanguageID .1.b:LocaleCode .1.b:VersionID .1.b:DocumentStatusCode .1.b:DocumentDescription .1.a:Attachment .1.a:ValidityPeriod .1.a:IssuerParty .1.a:ResultOfVerification .0.a:ReceiptDocumentReference/b:CopyIndicator .1.b:UUID .1.b:IssueDate .1.b:IssueTime .1.b:DocumentTypeCode .1.b:DocumentType .1.b:XPath .1.b:LanguageID .1.b:LocaleCode .1.b:VersionID .1.b:DocumentStatusCode .1.b:DocumentDescription .1.a:Attachment .1.a:ValidityPeriod .1.a:IssuerParty .1.a:ResultOfVerification .0.a:StatementDocumentReference .0.a:OriginatorDocumentReference/b:CopyIndicator .1.b:UUID .1.b:IssueDate .1.b:IssueTime .1.b:DocumentTypeCode .1.b:DocumentType .1.b:XPath .1.b:LanguageID .1.b:LocaleCode .1.b:VersionID .1.b:DocumentStatusCode .1.b:DocumentDescription .1.a:Attachment .1.a:ValidityPeriod .1.a:IssuerParty .1.a:ResultOfVerification .0.a:ContractDocumentReference/b:CopyIndicator .1.b:UUID .1.b:IssueDate .1.b:IssueTime .1.b:DocumentTypeCode .1.b:DocumentType .1.b:XPath .1.b:LanguageID .1.b:LocaleCode .1.b:VersionID .1.b:DocumentStatusCode .1.b:DocumentDescription .1.a:Attachment .1.a:ValidityPeriod .1.a:IssuerParty .1.a:ResultOfVerification .0.a:AdditionalDocumentReference/b:CopyIndicator .1.b:UUID .1.b:IssueDate .1.b:IssueTime .1.b:DocumentType .1.b:XPath .1.b:LanguageID .1.b:LocaleCode .1.b:VersionID .1.b:DocumentStatusCode 121.1.a:Attachment/a:ExternalReference/b:DocumentHash .3.b:HashAlgorithmMethod .3.b:ExpiryDate .3.b:ExpiryTime .3.b:MimeCode .3.b:FormatCode .3.b:EncodingCode .3.b:CharacterSetCode .3.b:FileName .3.b:Description .1.a:ValidityPeriod .1.a:IssuerParty .1.a:ResultOfVerification .0.a:ProjectReference/b:UUID .1.b:IssueDate .1.a:WorkPhaseReference .0.a:Signature .0.a:AccountingSupplierParty/b:CustomerAssignedAccountID .1.b:AdditionalAccountID .1.b:DataSendingCapability .1.a:Party/b:MarkCareIndicator .2.b:MarkAttentionIndicator .2.b:WebsiteURI .2.b:LogoReferenceID .2.b:IndustryClassificationCode .2.a:Language .2.a:PostalAddress/b:ID .3.b:AddressTypeCode .3.b:AddressFormatCode .3.b:Postbox .3.b:Floor .3.b:Room .3.b:BlockName .3.b:BuildingName .3.b:BuildingNumber .3.b:InhouseMail .3.b:Department .3.b:MarkAttention .3.b:MarkCare .3.b:PlotIdentification .3.b:CitySubdivisionName .3.b:CountrySubentityCode .3.b:Region .3.b:District .3.b:TimezoneOffset .3.a:Country/b:Name .3.a:LocationCoordinate .2.a:PhysicalLocation .2.a:PartyTaxScheme/b:RegistrationName .3.b:TaxLevelCode .3.b:ExemptionReasonCode .3.b:ExemptionReason .3.a:RegistrationAddress .3.a:TaxScheme/b:Name .4.b:TaxTypeCode .4.b:CurrencyCode .4.a:JurisdictionRegionAddress .2.a:PartyLegalEntity/b:RegistrationDate .3.b:RegistrationExpirationDate .3.b:CompanyLegalFormCode .3.b:SoleProprietorshipIndicator .3.b:CompanyLiquidationStatusCode .3.b:CorporateStockAmount .3.b:FullyPaidSharesIndicator .3.a:RegistrationAddress .3.a:CorporateRegistrationScheme .3.a:HeadOfficeParty .3.a:ShareholderParty .2.a:Contact/b:ID .3.b:Telefax .3.b:Note .3.a:OtherCommunication .2.a:Person .2.a:AgentParty .2.a:ServiceProviderParty .2.a:PowerOfAttorney .2.a:FinancialAccount .1.a:DespatchContact .1.a:AccountingContact .1.a:SellerContact .0.a:AccountingCustomerParty/b:CustomerAssignedAccountID .1.b:SupplierAssignedAccountID .1.b:AdditionalAccountID .1.a:Party/b:MarkCareIndicator .2.b:MarkAttentionIndicator .2.b:WebsiteURI .2.b:LogoReferenceID .2.b:IndustryClassificationCode .2.a:Language .2.a:PostalAddress/b:ID .3.b:AddressTypeCode .3.b:AddressFormatCode .3.b:Postbox .3.b:Floor .3.b:Room .3.b:BlockName .3.b:BuildingName .3.b:BuildingNumber .3.b:InhouseMail .3.b:Department .3.b:MarkAttention .3.b:MarkCare .3.b:PlotIdentification .3.b:CitySubdivisionName .3.b:CountrySubentityCode .3.b:Region .3.b:District .3.b:TimezoneOffset .3.a:Country/b:Name .3.a:LocationCoordinate .2.a:PhysicalLocation .2.a:PartyTaxScheme/b:RegistrationName .3.b:TaxLevelCode .3.b:ExemptionReasonCode .3.b:ExemptionReason .3.a:RegistrationAddress .3.a:TaxScheme/b:Name .4.b:TaxTypeCode .4.b:CurrencyCode .4.a:JurisdictionRegionAddress .2.a:PartyLegalEntity/b:RegistrationDate .3.b:RegistrationExpirationDate .3.b:CompanyLegalFormCode .3.b:CompanyLegalForm .3.b:SoleProprietorshipIndicator .3.b:CompanyLiquidationStatusCode .3.b:CorporateStockAmount .3.b:FullyPaidSharesIndicator .3.a:RegistrationAddress .3.a:CorporateRegistrationScheme .3.a:HeadOfficeParty .3.a:ShareholderParty .2.a:Contact/b:ID .3.b:Telefax .3.b:Note .3.a:OtherCommunication .2.a:Person .2.a:AgentParty .2.a:ServiceProviderParty .2.a:PowerOfAttorney .2.a:FinancialAccount .1.a:DeliveryContact .1.a:AccountingContact .1.a:BuyerContact .0.a:PayeeParty/b:MarkCareIndicator .1.b:MarkAttentionIndicator .1.b:WebsiteURI .1.b:LogoReferenceID .1.b:EndpointID .1.b:IndustryClassificationCode .1.a:Language .1.a:PostalAddress .1.a:PhysicalLocation .1.a:PartyTaxScheme .1.a:PartyLegalEntity/b:RegistrationName .2.b:RegistrationDate .2.b:RegistrationExpirationDate .2.b:CompanyLegalFormCode .2.b:CompanyLegalForm .2.b:SoleProprietorshipIndicator .2.b:CompanyLiquidationStatusCode .2.b:CorporateStockAmount .2.b:FullyPaidSharesIndicator .2.a:RegistrationAddress .2.a:CorporateRegistrationScheme .2.a:HeadOfficeParty .2.a:ShareholderParty .1.a:Contact .1.a:Person .1.a:AgentParty .1.a:ServiceProviderParty .1.a:PowerOfAttorney .1.a:FinancialAccount .0.a:BuyerCustomerParty .0.a:SellerSupplierParty .0.a:TaxRepresentativeParty/b:MarkCareIndicator .1.b:MarkAttentionIndicator .1.b:WebsiteURI .1.b:LogoReferenceID .1.b:EndpointID .1.b:IndustryClassificationCode .1.a:PartyIdentification .1.a:Language .1.a:PostalAddress/b:ID .2.b:AddressTypeCode .2.b:AddressFormatCode .2.b:Postbox .2.b:Floor .2.b:Room .2.b:BlockName .2.b:BuildingName .2.b:BuildingNumber .2.b:InhouseMail .2.b:Department .2.b:MarkAttention .2.b:MarkCare .2.b:PlotIdentification .2.b:CitySubdivisionName .2.b:CountrySubentityCode .2.b:Region .2.b:District .2.b:TimezoneOffset .2.a:Country/b:Name .2.a:LocationCoordinate .1.a:PhysicalLocation .1.a:PartyTaxScheme/b:RegistrationName .2.b:TaxLevelCode .2.b:ExemptionReasonCode .2.b:ExemptionReason .2.a:RegistrationAddress .2.a:TaxScheme/b:Name .3.b:TaxTypeCode .3.b:CurrencyCode .3.a:JurisdictionRegionAddress .1.a:PartyLegalEntity .1.a:Contact .1.a:Person .1.a:AgentParty .1.a:ServiceProviderParty .1.a:PowerOfAttorney .1.a:FinancialAccount .0.a:Delivery/b:ID .1.b:Quantity .1.b:MinimumQuantity .1.b:MaximumQuantity .1.b:ActualDeliveryTime .1.b:LatestDeliveryDate .1.b:LatestDeliveryTime .1.b:ReleaseID .1.b:TrackingID .1.a:DeliveryLocation/b:Description .2.b:Conditions .2.b:CountrySubentity .2.b:CountrySubentityCode .2.b:LocationTypeCode .2.b:InformationURI .2.b:Name .2.a:ValidityPeriod .2.a:Address/b:ID .3.b:AddressTypeCode .3.b:AddressFormatCode .3.b:Postbox .3.b:Floor .3.b:Room .3.b:BlockName .3.b:BuildingName .3.b:BuildingNumber .3.b:InhouseMail .3.b:Department .3.b:MarkAttention .3.b:MarkCare .3.b:PlotIdentification .3.b:CitySubdivisionName .3.b:CountrySubentityCode .3.b:Region .3.b:District .3.b:TimezoneOffset .3.a:Country/b:Name .3.a:LocationCoordinate .2.a:SubsidiaryLocation .2.a:LocationCoordinate .1.a:AlternativeDeliveryLocation .1.a:RequestedDeliveryPeriod .1.a:EstimatedDeliveryPeriod .1.a:CarrierParty .1.a:DeliveryParty/b:MarkCareIndicator .2.b:MarkAttentionIndicator .2.b:WebsiteURI .2.b:LogoReferenceID .2.b:EndpointID .2.b:IndustryClassificationCode .2.a:PartyIdentification .2.a:Language .2.a:PostalAddress .2.a:PhysicalLocation .2.a:PartyTaxScheme .2.a:PartyLegalEntity .2.a:Contact .2.a:Person .2.a:AgentParty .2.a:ServiceProviderParty .2.a:PowerOfAttorney .2.a:FinancialAccount .1.a:NotifyParty .1.a:Despatch .1.a:DeliveryTerms .1.a:MinimumDeliveryUnit .1.a:MaximumDeliveryUnit .1.a:Shipment .0.a:DeliveryTerms .0.a:PaymentMeans/b:ID 413.1.b:PaymentChannelCode .1.b:InstructionID .1.a:CardAccount/b:CardTypeCode .2.b:ValidityStartDate .2.b:ExpiryDate .2.b:IssuerID .2.b:IssueNumberID .2.b:CV2ID .2.b:CardChipCode .2.b:ChipApplicationID 424.1.a:PayeeFinancialAccount/b:AliasName .2.b:AccountTypeCode .2.b:AccountFormatCode .2.b:CurrencyCode .2.b:PaymentNote .2.a:FinancialInstitutionBranch/b:Name .3.a:FinancialInstitution/b:Name .4.a:Address .3.a:Address .2.a:Country .1.a:CreditAccount .1.a:PaymentMandate/b:MandateTypeCode .2.b:MaximumPaymentInstructionsNumeric .2.b:MaximumPaidAmount .2.b:SignatureID .2.a:PayerParty .2.a:PayerFinancialAccount/b:Name .3.b:AliasName .3.b:AccountTypeCode .3.b:AccountFormatCode .3.b:CurrencyCode .3.b:PaymentNote .3.a:FinancialInstitutionBranch .3.a:Country .2.a:ValidityPeriod .2.a:PaymentReversalPeriod .2.a:Clause .1.a:TradeFinancing .0.a:PaymentTerms/b:ID .1.b:PaymentMeansID .1.b:PrepaidPaymentReferenceID .1.b:ReferenceEventCode .1.b:SettlementDiscountPercent .1.b:PenaltySurchargePercent .1.b:PaymentPercent .1.b:Amount .1.b:SettlementDiscountAmount .1.b:PenaltyAmount .1.b:PaymentTermsDetailsURI .1.b:PaymentDueDate .1.b:InstallmentDueDate .1.b:InvoicingPartyReference .1.a:SettlementPeriod .1.a:PenaltyPeriod .1.a:ExchangeRate .1.a:ValidityPeriod .0.a:PrepaidPayment .0.a:AllowanceCharge/b:ID .1.b:PrepaidIndicator .1.b:SequenceNumeric .1.b:AccountingCostCode .1.b:AccountingCost .1.b:PerUnitAmount .1.a:TaxCategory/b:Name .2.b:BaseUnitMeasure .2.b:PerUnitAmount .2.b:TaxExemptionReasonCode .2.b:TaxExemptionReason .2.b:TierRange .2.b:TierRatePercent .2.a:TaxScheme/b:Name .3.b:TaxTypeCode .3.b:CurrencyCode .3.a:JurisdictionRegionAddress .1.a:TaxTotal .1.a:PaymentMeans .0.a:TaxExchangeRate .0.a:PricingExchangeRate .0.a:PaymentExchangeRate .0.a:PaymentAlternativeExchangeRate .0.a:TaxTotal/b:RoundingAmount .1.b:TaxEvidenceIndicator .1.b:TaxIncludedIndicator .1.a:TaxSubtotal/b:CalculationSequenceNumeric .2.b:TransactionCurrencyTaxAmount .2.b:Percent .2.b:BaseUnitMeasure .2.b:PerUnitAmount .2.b:TierRange .2.b:TierRatePercent .2.a:TaxCategory/b:Name .3.b:BaseUnitMeasure .3.b:PerUnitAmount .3.b:TierRange .3.b:TierRatePercent .3.a:TaxScheme/b:Name .4.b:TaxTypeCode .4.b:CurrencyCode .4.a:JurisdictionRegionAddress .0.a:WithholdingTaxTotal .0.a:LegalMonetaryTotal/b:PayableAlternativeAmount .0.L/b:UUID .1.b:TaxPointDate .1.b:AccountingCostCode .1.b:PaymentPurposeCode .1.b:FreeOfChargeIndicator .1.a:InvoicePeriod/b:StartTime .2.b:EndTime .2.b:DurationMeasure .2.b:DescriptionCode .2.b:Description .1.a:OrderLineReference/b:SalesOrderLineID .2.b:UUID .2.b:LineStatusCode .2.a:OrderReference .1.a:DespatchLineReference .1.a:ReceiptLineReference .1.a:BillingReference .1.a:DocumentReference/b:CopyIndicator .2.b:UUID .2.b:IssueDate .2.b:IssueTime 537.2.b:DocumentType .2.b:XPath .2.b:LanguageID .2.b:LocaleCode .2.b:VersionID .2.b:DocumentStatusCode .2.b:DocumentDescription .2.a:Attachment .2.a:ValidityPeriod .2.a:IssuerParty .2.a:ResultOfVerification .1.a:PricingReference .1.a:OriginatorParty .1.a:Delivery .1.a:PaymentTerms .1.a:AllowanceCharge/b:ID .2.b:PrepaidIndicator .2.b:SequenceNumeric .2.b:AccountingCostCode .2.b:AccountingCost .2.b:PerUnitAmount .2.a:TaxCategory .2.a:TaxTotal .2.a:PaymentMeans .1.a:TaxTotal .1.a:WithholdingTaxTotal .1.a:Item/b:PackQuantity .2.b:PackSizeNumeric .2.b:CatalogueIndicator .2.b:HazardousRiskIndicator .2.b:AdditionalInformation .2.b:Keyword .2.b:BrandName .2.b:ModelName .2.a:BuyersItemIdentification/b:ExtendedID .3.b:BarcodeSymbologyID .3.a:PhysicalAttribute .3.a:MeasurementDimension .3.a:IssuerParty .2.a:SellersItemIdentification/b:ExtendedID .3.b:BarcodeSymbologyID .3.a:PhysicalAttribute .3.a:MeasurementDimension .3.a:IssuerParty .2.a:ManufacturersItemIdentification .2.a:StandardItemIdentification/b:ExtendedID .3.b:BarcodeSymbologyID .3.a:PhysicalAttribute .3.a:MeasurementDimension .3.a:IssuerParty .2.a:CatalogueItemIdentification .2.a:AdditionalItemIdentification .2.a:CatalogueDocumentReference .2.a:ItemSpecificationDocumentReference .2.a:OriginCountry/b:Name .2.a:CommodityClassification/b:NatureCode .3.b:CargoTypeCode .3.b:CommodityCode .2.a:TransactionConditions .2.a:HazardousItem .2.a:ClassifiedTaxCategory/b:Name .3.b:BaseUnitMeasure .3.b:PerUnitAmount .3.b:TaxExemptionReasonCode .3.b:TaxExemptionReason .3.b:TierRange .3.b:TierRatePercent .3.a:TaxScheme/b:Name .4.b:TaxTypeCode .4.b:CurrencyCode .4.a:JurisdictionRegionAddress .2.a:AdditionalItemProperty/b:ID .3.b:NameCode .3.b:TestMethod .3.b:ValueQuantity .3.b:ValueQualifier .3.b:ImportanceCode .3.b:ListValue .3.a:UsabilityPeriod .3.a:ItemPropertyGroup .3.a:RangeDimension .3.a:ItemPropertyRange .2.a:ManufacturerParty .2.a:InformationContentProviderParty .2.a:OriginAddress .2.a:ItemInstance .2.a:Certificate .2.a:Dimension .1.a:Price/b:PriceChangeReason .2.b:PriceTypeCode .2.b:PriceType .2.b:OrderableUnitFactorRate .2.b:ValidityPeriod .2.b:PriceList 632.2.a:AllowanceCharge/b:ID .3.b:AllowanceChargeReasonCode .3.b:AllowanceChargeReason .3.b:MultiplierFactorNumeric .3.b:PrepaidIndicator .3.b:SequenceNumeric .3.b:AccountingCostCode .3.b:AccountingCost .3.b:PerUnitAmount .3.a:TaxCategory .3.a:TaxTotal .3.a:PaymentMeans .2.a:PricingExchangeRate .1.a:DeliveryTerms .1.a:SubInvoiceLine .1.a:ItemPriceExtension .0.b:CustomizationID/@schemeID .0.b:ProfileID/@schemeID .0.b:ID/@schemeID .0.b:SalesOrderID/@schemeID .0.//a:PartyTaxScheme/b:CompanyID/@schemeID .0.a:PaymentMeans/b:PaymentID/@schemeID .1.a:PayeeFinancialAccount/b:ID/@schemeID .2.a:FinancialInstitutionBranch/b:ID/@schemeID .0.b:InvoiceTypeCode/@listID .0.b:DocumentCurrencyCode/@listID .0.b:TaxCurrencyCode/@listID .0.a:AdditionalDocumentReference/b:DocumentTypeCode/@listID .0.//a:Country/b:IdentificationCode/@listID .0.a:PaymentMeans/b:PaymentMeansCode/@listID .0.//b:AllowanceChargeReasonCode/@listID .2.@unitCodeListID .2.a:FinancialInstitution 667.2.a:BuyersItemIdentification/b:ID/@schemeID .2.a:SellersItemIdentification/b:ID/@schemeID .2.a:Price/a:AllowanceCharge/b:AllowanceChargeReasonCode .4.b:AllowanceChargeReason .4.b:MultiplierFactorNumeric .0.b:CreditNoteTypeCode/@listID 674.0.//b:PrimaryAccountNumberID/@schemeID .2.a:CardAccount/b:NetworkID/@schemeID .2.a:PaymentMandate/b:ID/@schemeID .3.a:PayerFinancialAccount/b:ID/@schemeID .2.a:TaxCategory/b:ID/@schemeID .2.a:ClassifiedTaxCategory/b:ID/@schemeID .2.a:PaymentMeans/a:PayerFinancialAccount .0.a:PaymentMeans/b:InstructionNote .0.a:Delivery/a:DeliveryAddress"; export interface UblCrEntry { /** Three-digit rule number, e.g. "001" for UBL-CR-001. */ readonly id: string; /** Abbreviated path as described in the file header. */ readonly path: string; } /** SHA-256 of the decoded table rendered as `id=path` joined by single spaces. */ export const UBL_CR_TABLE_SHA256 = "6288fb91bd55dbcac0f4a273164edffd1d5377189deb04412e0c5dfc5e846a51"; export const UBL_CR_TABLE_SIZE = 673; function decode(encoded: string): UblCrEntry[] { const entries: UblCrEntry[] = []; let previousSegments: string[] = []; let previousNumber = 0; for (const item of encoded.split(" ")) { const firstDot = item.indexOf("."); const secondDot = item.indexOf(".", firstDot + 1); const idText = item.slice(0, firstDot); const shared = Number(item.slice(firstDot + 1, secondDot)); const rest = item.slice(secondDot + 1); const ruleNumber = idText === "" ? previousNumber + 1 : Number(idText); const segments = [...previousSegments.slice(0, shared), ...rest.split("/")]; entries.push({ id: String(ruleNumber).padStart(3, "0"), path: segments.join("/") }); previousSegments = segments; previousNumber = ruleNumber; } return entries; } export const UBL_CR_TABLE: readonly UblCrEntry[] = decode(ENCODED);