ValidateInvoiceBusinessRulesWithTools

Invoices, Compliance

Description

Run XML schema and Schematron validation for an embedded invoice

Syntax

Delphi

Function TPDFlib.ValidateInvoiceBusinessRulesWithTools(Const EmbeddedFileName, Standard, RulesVersion, RulesProfile, SchemaFile, SchematronStylesheetFile, XMLLintExecutable, JavaExecutable, SaxonClassPath: WideString;
  TimeoutMS: Integer): WideString;

DLL

Function DLValidateInvoiceBusinessRulesWithTools(InstanceID: Integer;
  EmbeddedFileName, Standard, RulesVersion, RulesProfile, SchemaFile, SchematronStylesheetFile, XMLLintExecutable, JavaExecutable, SaxonClassPath: PWideChar; TimeoutMS: Integer): PWideChar; Stdcall;
Function DLValidateInvoiceBusinessRulesWithToolsA(InstanceID: Integer;
  EmbeddedFileName, Standard, RulesVersion, RulesProfile, SchemaFile, SchematronStylesheetFile, XMLLintExecutable, JavaExecutable, SaxonClassPath: PAnsiChar; TimeoutMS: Integer): PAnsiChar; Stdcall;

ActiveX

Function PDFlib::ValidateInvoiceBusinessRulesWithTools(EmbeddedFileName As String, Standard As String, RulesVersion As String, RulesProfile As String, SchemaFile As String, SchematronStylesheetFile As String, XMLLintExecutable As String, JavaExecutable As String, SaxonClassPath As String, TimeoutMS As Long) As String

Remarks

Returns JSON for the selected embedded XML using both a versioned XSD package and a compiled Schematron XSLT stylesheet; this convenience method always requires both stages

Pass executable file paths for xmllint and Java, and a semicolon-separated SaxonClassPath containing SaxonJ and its dependencies; use compiled .xsl or .xslt, rather than an uncompiled .sch file

RulesVersion identifies the rule-package release and RulesProfile identifies the intended invoice profile; select matching rules explicitly because schema and generic EN16931 rules do not automatically include every national or industry profile

Both tools run without a shell or a visible window, with DTD processing disabled, a bounded output size and the requested timeout; TimeoutMS<=0 selects 30000 ms

JSON contains standard, version, profile, complete, valid, and separate schema and schematron stages; stages include status, completion, engine, execution counts, diagnostics, and issues with rule ID, field path, severity, line, and message

Stage status is passed, failed, error, unavailable, or not_checked; a failed rule may have complete=true, while missing dependencies, timeouts, output limits, invalid SVRL, and unexecuted rules cannot produce a valid result

The built-in tool adapter requires Windows; portable applications can supply their own IPDFInvoiceValidationProvider through the typed API

PDF container checks and invoice business validation are separate operations; call ValidateFacturXInvoice as well when the PDF/A-3 and hybrid attachment conventions must be checked

DLL results are instance-owned and must be copied before another string-result call; the A result contains UTF-8 JSON and A input strings use the instance ANSI setting

See also

ValidateFacturXInvoice, ValidateInvoiceBusinessRules, ValidateInvoiceBusinessRulesWithTools, ExtractFacturXXMLToString