Skip to content

LandrixXml 0.4.0

Choose a tag to compare

@landrix landrix released this 12 Nov 17:59
· 51 commits to main since this release

Exact normalization check, faster XPath and XML Schema validation, a fix
for nested repetitions in content models and two portability fixes. The
documented API only gains additions.

Added

  • LandrixXmlNormalize: LandrixXmlIsNormalizedUtf8 and
    LandrixXmlIsNormalizedCodePoints tell exactly whether a text is in a
    normalization form (the Unicode quick check, and a normalization only
    when it answers "maybe"). The code point variant rejects values that
    are not Unicode scalar values with xecInvalidUnicode. The constant
    LandrixXmlNormalizeUnicodeVersion names the Unicode version of the
    normalization data (15.0.0); characters assigned later pass through
    unchanged. Every line of the Unicode file NormalizationTest.txt also
    checks the new functions.

Changed

  • LandrixXmlDouble: integers below 10^15 (below 10^7 for xs:float) are
    converted to a double directly instead of through a big-integer
    division; the result is the same. An XPath comparison such as
    cl[@id = 15], which converts every @id and the integer this way,
    is about five times faster.
  • LandrixXmlXPathEval: a child step name[@attribute = value] whose
    value does not depend on the focus (a literal, a variable, a path from
    document()) finds its matches through an index of the children by
    that attribute, built on first use per parent with at least 16 such
    children, if the values are strings or untypedAtomic. The Factur-X
    code list checks (.../cl[@id=N]/enumeration[@value=$v]) no longer
    scan the list. Together with the faster integer conversion the
    Factur-X 1.09.2 EXTENDED rules take about 40 % of the time before.
  • XML Schema validation is faster on large documents, with the same
    results: the content model finds the particles that can take a child
    through a name table and bit sets instead of comparing names; values,
    identity constraint keys, error paths and type names are built only
    where they are used; white space normalization returns the value
    itself when nothing changes; text the validator does not look at is
    no longer copied. A 50 MB GAEB DA XML 3.3 file (X83) takes about two
    thirds of the time before.
  • LandrixXmlXsdValidator: the record TLandrixXmlXsdFrame, documented as
    internal, has PathIndex instead of PathStep.

Fixed

  • XML Schema content models: of the configurations a child leaves, those
    another one covers (same position, counts no higher and already at
    their lower bounds) are dropped. Nested repetitions such as
    (a+){1,100000000} in a repeated choice no longer stop with xecLimit
    "Content model too ambiguous to check" after a minute; the three XSTS
    tests particlesZ036_b1, _b2 and _c pass, and the whole XSTS run
    takes 45 seconds instead of 4.5 minutes.
  • LandrixXmlNormalize: an input or a result of more than MaxInt code
    points raises xecLimit instead of overflowing the Integer
    arithmetic (64-bit only).
  • LandrixXmlDom: copies names without Move. FPC 3.2.4 on aarch64-darwin
    reported note 6058 ("Move ... marked as inline is not inlined") there in
    the builds of some consuming projects, despite {$WARN 6058 OFF}.