Skip to content

Fix: UBL Writer/Reader TaxRepresentativeParty and SubInvoiceLine XPath#888

Merged
stephanstapel merged 1 commit intostephanstapel:masterfrom
MGGM-Software-GmbH:ublfix
Mar 9, 2026
Merged

Fix: UBL Writer/Reader TaxRepresentativeParty and SubInvoiceLine XPath#888
stephanstapel merged 1 commit intostephanstapel:masterfrom
MGGM-Software-GmbH:ublfix

Conversation

@PeterSawatzki-MGGM
Copy link
Contributor

Summary

Fix: UBL Writer/Reader TaxRepresentativeParty and SubInvoiceLine XPath

Checklist

  • Code follows repo Coding Instructions
  • Public APIs documented (XML)
  • Unit tests added/updated
  • No blocking async (.Result / GetAwaiter().GetResult())
  • CancellationToken respected
  • Analyzers clean (dotnet build no warnings as errors)
  • dotnet format --verify-no-changes passes

Breaking changes?

  • No
  • Yes (explain impact & migration)

UBL Writer: cac:TaxRepresentativeParty is directly of type PartyType in
UBL schema, so it must not contain a nested cac:Party element. The extra
wrapper caused data loss when reading with spec-compliant parsers.

UBL Reader: Changed XPath for TaxRepresentativeParty from
//cac:TaxRepresentativeParty/cac:Party to //cac:TaxRepresentativeParty
to match the corrected Writer output and UBL schema.

UBL Reader: Changed SubInvoiceLine XPath from .//cac:SubInvoiceLine
(descendant) to cac:SubInvoiceLine (direct children only). The descendant
selector caused wrong ParentLineIDs at 3+ nesting levels. Also added
missing cac:SubCreditNoteLine support for credit notes.

Added TestTaxRepresentativePartyNoNestedPartyElement to verify XML
structure and roundtrip. Existing TestParentLineId covers the SubInvoiceLine
fix with its 3-level nesting hierarchy.
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 3, 2026

@stephanstapel stephanstapel merged commit 454990f into stephanstapel:master Mar 9, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants