Skip to content

PureXML 0.4.7

Latest

Choose a tag to compare

@mihaelamj mihaelamj released this 26 Jun 01:11
· 47 commits to main since this release
fab8008

XSD identity-constraint validation made linear. Backward compatible, validation results identical.

Fixed

  • xs:unique/xs:key/xs:keyref validation was quadratic over a wide list of targets: the duplicate check compared each value tuple against every tuple already seen (and a keyref against every referenced key), and the error-location helper rescanned the parent's whole child list to position each target. Duplicate detection now keys tuples in a Set by their raw string when field equality provably reduces to a raw string == string comparison (whitespace-preserving lexical types, which is most ids); value-space types (numeric, boolean, date), whitespace-collapsing types, and QName-bearing values keep the exact pairwise comparison, so which documents pass is unchanged. Each target is positioned through a per-parent, per-name index built once. A 16000-item xs:unique document drops from ~4.0s to ~0.12s (~34x), now linear (#312).

Found by scale-testing the identity-constraint feature at 2x/4x/8x sizes, a feature the default benchmark corpus does not exercise. Equivalence verified by an adversarial closed-form proof and the W3C XSTS datatype/identity conformance corpus (unchanged).