Skip to content

Documentation / @facturometro/einvoice / XmlValidationResult

Type Alias: XmlValidationResult ​

XmlValidationResult = ValidationResult & object

Defined in: packages/einvoice/src/validate-xml.ts:47

What validateXml returns: a validation result that includes the parser's diagnostics, plus those diagnostics as the parser reported them. Narrow on ok to reach the validated document.

issues holds, in this order: the parser diagnostics that remain once the composition's structural configuration applied and the empty-element reports a validation issue repeats were dropped, in the order the parser reported them; then the issues of validate(), in its order (the EINV-XSD-LEXICAL ones, then the rules' in composition order). fatal and warnings keep that order; counts.fatal, counts.warning and ok are computed from them.

Type Declaration ​

diagnostics ​

readonly diagnostics: readonly Issue[]

Every diagnostic of the parse, in the order the parser reported them and exactly as it did: before the composition disables or overrides structural ids, and before the empty-element reports that a validation issue repeats are dropped.

Example ​

ts
import type { XmlValidationResult } from '@facturometro/einvoice';

const report = (result: XmlValidationResult) =>
  result.issues.map((issue) => `${issue.severity} ${issue.id} at ${issue.xpath}`);

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