Message

[BR-NG-02-GST-SG]-An Invoice that contains an Invoice line (BG-25) where the Invoiced item GST category code (BT-151-GST) is "NG" shall not contain the Seller GST identifier (BT-31), the Seller tax representative GST identifier (BT-63-GST) or the Buyer GST identifier (BT-48-GST).

Context
/ubl:Invoice | /cn:CreditNote
Test
(exists(//cac:ClassifiedTaxCategory[normalize-space(cbc:ID) = 'NG'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='GST']) and (not(//cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/(normalize-space(upper-case(cbc:ID)) = 'GST')]/cbc:CompanyID) and not(//cac:TaxRepresentativeParty/cac:PartyTaxScheme[cac:TaxScheme/(normalize-space(upper-case(cbc:ID)) = 'GST')]/cbc:CompanyID) and not(//cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/(normalize-space(upper-case(cbc:ID)) = 'GST')]/cbc:CompanyID))) or not(//cac:ClassifiedTaxCategory[normalize-space(cbc:ID) = 'NG'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='GST'])
Usage
/ ubl:Invoice / cac:AccountingSupplierParty / cac:Party / cac:PartyTaxScheme / cbc:CompanyID
/ ubl:Invoice / cac:TaxRepresentativeParty / cac:PartyTaxScheme / cbc:CompanyID
/ ubl:CreditNote / cac:AccountingSupplierParty / cac:Party / cac:PartyTaxScheme / cbc:CompanyID
/ ubl:CreditNote / cac:TaxRepresentativeParty / cac:PartyTaxScheme / cbc:CompanyID