Documentation / @facturometro/einvoice / XSD_LEXICAL_ID
Variable: XSD_LEXICAL_ID ​
constXSD_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-EMPTYfrom the parser, at the same XPath, andvalidate()firesPEPPOL-EN16931-R008on it as well (R008 is the union of the model's empty elements and those parser diagnostics). DroppingEINV-XML-EMPTYwhereverEINV-XSD-LEXICALorPEPPOL-EN16931-R008exists 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-R043andR044(the literaltrue/falseof a charge indicator),BR-03andPEPPOL-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);