XV-MY-34
A tax exemption (tax type E) needs its details: cac:TaxCategory/cbc:TaxExemptionReason, up to 300 characters, such as the exemption under the Sales Tax (Persons Exempted from Payment of Tax) Order.
error: the document is invalid
What the rule checks
As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.
Context
cac:TaxSubtotal
Test
$category ne 'E' or not($stated) or (normalize-space(cac:TaxCategory/cbc:TaxExemptionReason) ne '' and string-length(normalize-space(cac:TaxCategory/cbc:TaxExemptionReason)) le 300)
Checked with MyInvois e-Invoice