# CII-SR-476

Source: https://xmlvalid.com/rules/CII-SR-476

> Only one AdditionalReferencedDocument AttachmentBinaryObject BT-125 is allowed with TypeCode 916.

- Level: warning
- Rule sets: EN 16931 rules (CII) 1.3.17
- Context: `/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:AdditionalReferencedDocument`
- Test: `normalize-space(ram:TypeCode) != '916' or count(ram:AttachmentBinaryObject) <= 1`

> Only one AdditionalReferencedDocument AttachmentBinaryObject BT-125 is allowed with TypeCode 916.

- Level: warning
- Rule sets: EN 16931 rules 1.3.16 (CII), EXTENDED-CTC-FR rules (CII) 1.4.0.04, Factur-X EN 16931 rules 1.09.2, Factur-X EXTENDED rules 1.09.2
- Context: `/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement`
- Test: `count(ram:AdditionalReferencedDocument[normalize-space(ram:TypeCode) = '916']/ram:AttachmentBinaryObject) <= 1`

## Why it fails

- One `ram:AdditionalReferencedDocument` with `ram:TypeCode` `916` carries more than one `ram:AttachmentBinaryObject`.

## How to fix it

- Split the attachments into one `ram:AdditionalReferencedDocument` each.

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