ValidateInvoiceBusinessRulesWithTools

發票、合規性

描述

對內嵌發票執行 XML schema 與 Schematron 驗證

語法

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

備註

用版本化的 XSD 封裝與編譯過的 Schematron XSLT 樣式表,為所選內嵌 XML 傳回 JSON;這個便利方法一律要求兩個階段

請傳入 xmllint 與 Java 的執行檔路徑,以及包含 SaxonJ 及其相依項的分號分隔 SaxonClassPath;請使用編譯過的 .xsl 或 .xslt,而不是未編譯的 .sch 檔

RulesVersion 識別規則封裝版本,RulesProfile 識別目標發票設定檔;請明確挑選相符的規則,因為 schema 與通用 EN16931 規則不會自動涵蓋每個國家或產業設定檔

兩個工具都在沒有 shell、沒有可見視窗的情況下執行,停用 DTD 處理,輸出大小有界,並遵守要求的逾時;TimeoutMS<=0 表示 30000 ms

JSON 包含 standard、version、profile、complete、valid,以及分開的 schema 與 schematron 階段;階段內容包括狀態、完成度、引擎、執行計數、診斷,以及帶有規則 ID、欄位路徑、嚴重性、行號與訊息的問題

階段狀態為 passed、failed、error、unavailable 或 not_checked;規則失敗時仍可能 complete=true,但相依項遺漏、逾時、輸出超限、SVRL 無效與未執行的規則都不可能產生有效結果

內建工具配接器只在 Windows 上提供;可攜式應用程式可以透過具型別 API 自行提供 IPDFInvoiceValidationProvider

PDF 容器檢查與發票業務驗證是兩回事;需要檢查 PDF/A-3 與混合附件慣例時,請一併呼叫 ValidateFacturXInvoice

DLL 結果由實例持有,必須在下一次字串結果呼叫前複製;A 結果為 UTF-8 JSON,A 輸入字串使用實例的 ANSI 設定

另請參閱

ValidateFacturXInvoice, ValidateInvoiceBusinessRules, ValidateInvoiceBusinessRulesWithTools, ExtractFacturXXMLToString