Skip to content

Valid xmls are incorrectly marked as invalid due to warnings being treated as errors #981

@melatal

Description

@melatal

Valid Invoices are being incorrectly flagged as invalid because the validator is treating warnings as errors.
This causes false negatives where properly formatted files that contain minor issues (warnings) are rejected.

Specific Example
Validation Rule: [CII-SR-351]
Message: "InvoiceeTradeParty should not be present"
Rule Type: Schematron Warning (SHOULD NOT, not MUST NOT)
Current Behavior: Treated as ERROR → File marked as INVALID
Expected Behavior: Treated as WARNING → File marked as VALID (with warning)

Actual Result
schema validation fails:org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 51400; cvc-complex-type.2.4.a: Invalid content was found starting with element '{"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100":InvoiceeTradeParty}'. One of '{"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100":PayeeTradeParty, "urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100":SpecifiedTradeSettlementPaymentMeans, "urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100":ApplicableTradeTax}' is expected.
Severity: Error

[CII-SR-351] - InvoiceeTradeParty should not be present [ID CII-SR-351] from /xslt/en16931schematron/EN16931-CII-validation.xslt)
Location: /:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/:SupplyChainTradeTransaction[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:ApplicableHeaderTradeSettlement[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]
Severity: Warning

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions