Native XFA Picture Validation
Version 2.1206.0 adds a native formatTest stage to the interactive runtime, independently of validate/script execution
Actual validation behaviour
The stage formats the non-empty canonical field value using validate.picture; UI and display-format pictures do not replace this independent validation picture
A disabled formatTest skips the stage, error refuses an incompatible edit, and warning records a diagnostic and accepts under the current headless warning policy; scriptTest remains an independent following stage
The matching formatTest message inherits through sparse Form overrides, policy changes survive save/reload, and a refused edit restores the serialised form state
Empty and explicitly null scalar values skip both formatTest and scriptTest; ordinary clearing does not trigger nullTest, and the lower-level script-evaluation functions remain script APIs
Missing or explicitly empty validation pictures add no format constraint; the host model's validation switch disables both stages
Supported native picture matching
Typed text, numeric, date, time and datetime clauses support complete compound matching and alternatives, with quote-aware clause boundaries and doubled apostrophes; a failed clause cannot turn into success merely because a literal prefix was produced
Bare field pictures infer their content kind from the value or numeric UI; text masks distinguish Unicode letters, alphanumeric characters, decimal digits and complete Unicode scalar values
Numeric formatting preserves quoted literals, required leading and fractional zeros, canonical optional fractional precision, standalone and mixed precision-preserving 8 slots, three-digit, four-digit myriad, South Asian 2-2-3 and custom integer grouping, full-width numeric picture symbols and digits, currency, percentages, signs and accounting suffixes; implied radix v omits the display decimal separator
Canonical decimal spelling is retained for bounded decimal construction and rounding rather than silently truncating every fraction to 18 places; the existing numeric conversion still requires a finite Double-compatible magnitude
Calendar matching checks complete canonical components, leap dates, ordinal day of year (J/JJJ), numeric and ISO weekdays (E/EEE/EEEE/e), ISO and month weeks (WW/w), 12/24-hour and 0-based/1-based clocks (H/h/k/K), era G, single- and multi-digit seconds and fractional milliseconds (S/SS/F/FF/FFF), global wildcard/whitespace symbols (?/*/+), and time-zone offsets (z/zz/Z), supports dates before 1900, and parses or formats compound date/time clauses as one complete canonical timestamp
The nearest field or ancestor locale selects document localeSet metadata before system lookup; explicit clause locales remain independent, and an ambient chain selects the system locale
Explicit formatting result
HPDFXFANativeOwnedFormCalc exposes this static method for callers that need to distinguish a failed match from successful empty output
class function TXFANativeOwnedFormCalc.TryFormatPicture(
const Picture, Value, DefaultKind: UnicodeString;
Host: TXFANativeOwnedCalcHost;
const Limits: TXFAFormScriptLimits;
out Formatted: IXFANativeOwnedValue): Boolean;
True retains an owned formatted value, including a legal empty result such as zero under num{zzz}; False leaves Formatted nil
The host supplies locale lookup and Tick; the method also enforces its operation, elapsed-time, nesting and value-byte limits, and supported output builders admit retained storage through the host budget before growth
Override LoadDefaultLocale for ambient metadata without changing explicit LoadLocale lookups; keep an owned result alive until all borrowed text aliases have been cleared
Extended native grammar and Parse alignment
Version 2.1206.3 adds shared scientific E numeric picture formatting across both owned and ordinary native FormCalc evaluators and formatTest consumers, preserving canonical decimal precision, rounding carry and fractional-only mantissas
Version 2.1207.14 extends both native evaluators with full-width numeric and text picture symbols, mixed precision-preserving 8 fractional masks (retaining trailing precision when 8 ends the fractional mask, and rounding when fixed slots follow), wider and multi-width integer grouping (including four-digit myriad and 2-2-3 lakh/crore patterns), and shared native Parse support for scientific E, implied radix V/v, credit/debit CR/DB, ordinal and week dates, clock/time-zone variants, text masks O/0/A/X/9, global ?/*/+ symbols, alternatives and compound clauses
FormCalc Format and Parse share this native picture engine when EnableJavaScript is disabled, whilst explicit validation, nullTest triggers and interactive warning callbacks are covered by the runtime validation pipeline
See Owned Native FormCalc Execution and FormCalc Locale and Picture Functions