# UBL-SR-57

Source: https://xmlvalid.com/rules/UBL-SR-57

> PartyLegalEntity shall occur maximum once within a Party.

- Level: error
- Rule sets: EN 16931 rules (UBL) 1.3.17
- Context: `/ubl:Invoice | /cn:CreditNote`
- Test: `count(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity) <= 1 and count(cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity) <= 1 and count(cac:PayeeParty/cac:PartyLegalEntity) <= 1 and count(cac:TaxRepresentativeParty/cac:PartyLegalEntity) <= 1`

Validate a document against these rules: https://xmlvalid.com/validate
