Skip to content

Documentation / @facturometro/einvoice / XSD_LEXICAL_ID

Variable: XSD_LEXICAL_ID ​

const XSD_LEXICAL_ID: "EINV-XSD-LEXICAL" = 'EINV-XSD-LEXICAL'

Defined in: packages/validator/src/engine/issue.ts:54

Id of the issue the engine reports for a leaf whose text is not in the lexical space of its XSD datatype: an amount, quantity, percentage or numeric that is not an xs:decimal, a cbc:ChargeIndicator that is not an xs:boolean, or a date that is not an xs:date. It stands for the XSD validation step that runs before the Schematron in the official pipeline, and the rules that cast the value are skipped, as the Schematron would never have run.

Overlap with the parser, for a caller that merges parse() diagnostics with validate() issues (the umbrella validateXml()):

  • An empty, whitespace-only or self-closing leaf is EINV-XML-EMPTY from the parser, at the same XPath, and validate() fires PEPPOL-EN16931-R008 on it as well (R008 is the union of the model's empty elements and those parser diagnostics). Dropping EINV-XML-EMPTY wherever EINV-XSD-LEXICAL or PEPPOL-EN16931-R008 exists at the same XPath leaves one finding per leaf.
  • The parser emits nothing for text that is merely outside the lexical space (-1E2, 2017-02-30, TRUE), so nothing else can coincide.
  • Rules that read the text without casting it still fire on the same leaf and are separate findings, not duplicates: PEPPOL-EN16931-F001 (date format), PEPPOL-EN16931-R043 and R044 (the literal true/false of a charge indicator), BR-03 and PEPPOL-EN16931-R008 (presence and emptiness).

Example ​

ts
import { XSD_LEXICAL_ID } from '@facturometro/validator';

const rejectedByXsd = result.issues.filter((issue) => issue.id === XSD_LEXICAL_ID);

MIT licensed. Specification artefacts belong to OpenPEPPOL, CEN and OASIS.