Repository navigation
Releases
LandrixXml 0.5.0
An XSLT 2.0 processor (LandrixXmlXslt, optional) that runs the KoSIT
report stylesheets and the XRechnung visualization with the output
Saxon HE writes, byte for byte; XPath 1.0 compatibility mode, SVRL into
an open writer with the message text as the rule file has it, and a
stack budget for deep recursion. The documented API only gains
additions.
Added
- XSLT (
LandrixXmlXslt, optional): a subset of XSLT 2.0 run as Saxon
HE runs it, withTLandrixXmlXsltStylesheet(compiled once,
immutable),TLandrixXmlXsltTransformer(parameters as strings, trees
or XPath values, initial mode and template, output properties,
messages),TLandrixXmlXsltResolver(imports and documents from files
or a catalog, no network) andELandrixXmlXsltError(an
ELandrixXmlXPathErrorwith the W3C code, the module and the line).
See the README for the supported instructions; the KoSIT report
stylesheet and the XRechnung visualization (XR XML and HTML) give the
output Saxon gives, byte for byte.
TLandrixXmlErrorCodegainsxecXslt. - XSLT:
system-property(),function-available()and
element-available(); a name given with a prefix is resolved with the
namespaces of the calling expression. - XSLT: output in US-ASCII and ISO-8859-1. A character the encoding does
not have is a hexadecimal character reference in text and attribute
values andSERE0008elsewhere (comments, names, method text), as in
Saxon. - XSLT:
xsl:strip-spaceandxsl:preserve-space. - XSLT:
use-whenandxsl:use-when(conditional inclusion). - XSLT:
xsl:sort(inxsl:for-each,xsl:apply-templatesand
xsl:for-each-group),xsl:perform-sort,xsl:analyze-stringand
regex-group(). - XSLT:
xsl:next-matchandxsl:apply-imports(withxsl:with-param). - XSLT:
xsl:attribute-setanduse-attribute-sets(on literal result
elements,xsl:elementandxsl:copy). - XSLT:
xsl:character-mapanduse-character-maps(onxsl:output
andxsl:result-document), applied by the xml, html, xhtml and text
output methods as in Saxon. - XSLT:
xsl:namespace. An excluded namespace that a literal result
element or its attribute uses is no longer a namespace node of its own:
the namespace fixup declares it, as in Saxon. The fixup keeps an
attribute's own prefix where nothing on the element binds it otherwise
and names new prefixes as Saxon does.exclude-result-prefixesnow
excludes the namespace URIs bound where it is, not every later binding
of the same prefix. - XSLT:
xsl:namespace-alias(literal result elements, their attributes
and namespace nodes; an aliased or alias result namespace is copied
even when excluded). - XSLT: simplified stylesheets (a literal result element with
xsl:versionas a stylesheet module). - XSLT:
xpath-default-namespaceandxsl:xpath-default-namespace. - XSLT:
xml:basein a stylesheet: the static base URI of the
instructions below it (static-base-uri(),resolve-uri(),doc(),
document(),unparsed-text()), thehrefofxsl:includeand
xsl:import, and the base URI of the temporary trees an instruction
makes and of nodes made or copied at the top of a sequence, as Saxon
gives them. - XSLT:
xsl:keywith a sequence constructor instead ofuse, and key
names with a prefix (key()resolves it with the namespaces of the
calling expression). - XSLT: English words and ordinals as Saxon HE writes them, in
xsl:number(format="w","W","Ww",ordinal) and in the
pictures offormat-date()and its relatives ([Dwo],[D1o], also
letters[Da]).xsl:numberacceptslang(an invalid language code
isXTDE0030; the numbers stay English, as in Saxon HE) and
letter-value. A year cut to a maximum width is its last digits as a
number, as in Saxon ([Y1,*-3]of 2013 is13, no longer013). - XSLT:
[xsl:]expand-text(XSLT 3.0 text value templates, as Saxon
also runs them in a stylesheet withversion="2.0"): text in a sequence
constructor and inxsl:textwith expressions in braces ({{and}}
for braces, empty braces for the empty sequence);XTSE0350,
XTSE0370andXTSE0020as for attribute value templates. - XSLT:
copy-namespaces="no"onxsl:copyandxsl:copy-of: a copy
has the namespaces its names need; below the top of a deep copy an
element has those and the ones of the place the copy goes to, as
Saxon writes them (alsoxmlns=""or a declaration repeated).
true/1/false/0are accepted as in Saxon; another value is
XTSE0020. - XSLT: the output property
byte-order-markfor every output method:
as in Saxon the byte order mark is written for UTF-8 only (none for
US-ASCII or ISO-8859-1);TransformToUtf8andSerializeToUtf8begin
with it when the encoding asked for is UTF-8. - XSLT:
disable-output-escapingonxsl:textandxsl:value-of, as
in Saxon: text written to the final result tree (also by
xsl:result-document) is serialized without escaping; the character
map, normalization and character references for characters the
encoding lacks still apply, and a CDATA section ends before it. A text
node a function or a template withasreturns stays raw when it is
added to the result (not when it is copied withxsl:copy-of). It is
ignored in temporary trees, attributes and comments, and when the
result is returned as a tree; where Saxon keeps it in a node built in
a sequence or in a temporary tree it isxecUnsupportedat run time.
Besides yes and no,true,1,falseand0are accepted as in
Saxon; another value isXTSE0020. - XSLT: a collation URI that is not known as a collation is the error
of the specification:XTDE1035(xsl:sort),XTDE1110
(xsl:for-each-group;FOCH0002for a computed one, as in Saxon),
XTSE1210(xsl:key),XTSE0125(default-collationwithout a known
collation).default-collationtakes the first known collation of its
list, and the collation ofxsl:for-each-groupmay be an attribute
value template. UCA, Saxon andhtml-ascii-case-insensitive
collations remain unsupported. - XSLT: the output property
normalization-form(NFC, NFD, NFKC, NFKD,
none) for every output method: text, attribute values and CDATA
sections are normalized, names and comments are not; as in Saxon the
character map comes first and its strings are not normalized. Another
value (alsofully-normalized) isSESU0011when the result is
serialized. - XSLT: forwards compatible processing for a version above 3.0, as in
Saxon: unknown declarations are ignored with their content, an unknown
instruction runs itsxsl:fallback(XTSE0010without one), unknown
attributes of XSLT elements are ignored. A version that is no decimal
isXTSE0110(one below 2.0: backwards compatible processing, below). - XSLT:
extension-element-prefixes(also onxsl:templateand other
XSLT elements, and asxsl:extension-element-prefixeson literal
result elements). No extension instruction is known: an element in an
extension namespace runs itsxsl:fallbackchildren, or raises
XTDE1450when it is evaluated without one; the extension namespaces
are not copied to literal result elements. As in Saxon,#default
means no namespace. - XSLT:
doctype-systemanddoctype-public(xml and xhtml: with a
system identifier; html: either, the namehtml), written as Saxon
writes them before the first element; withdoctype-systemor
standalonea second element or text at the top isSEPM0004; a
public identifier with a character other than the XML PubidChar (or a
tab), or a system identifier with both quote characters, is
XTSE0020. - XSLT:
cdata-section-elementsonxsl:output(the union of every
definition) andxsl:result-document(added to the format's), for the
xml and xhtml methods. The text of those elements is written in CDATA
sections as Saxon writes them:]]>split, a character the encoding
does not have as a character reference between sections, no character
map. The output property holds the Clark names. - XSLT:
document()with a second argument (the base URI of that node for
every relative URI;XPTY0004for no single node,XTDE1162without a
base URI). - XPath:
TLandrixXmlXPathStaticContext.DefaultElementNamespace(the
default element/type namespace, '' unless set), also readable on the
compiled expression. - XSLT: the output method xhtml, as Saxon writes it (also the default
method for anhtmlroot element in the XHTML namespace). - XSLT: tunnel parameters (
tunnel="yes"onxsl:with-paramand
template parameters). An initial template with a required parameter is
XTDE0060, as in XSLT 2.0. - XSLT:
xsl:result-documentand namedxsl:outputdefinitions.
Secondary results are collected by the transformer
(ResultDocumentCount,ResultDocuments,FindResultDocument,
TLandrixXmlXsltResultDocument),hrefresolves against the new
BaseOutputUri; nothing is written to disk. tools/run-xslt-tests.pyruns the XSLT 1.0 and 2.0 cases of the W3C
XSLT test suite against a baseline (tests/data/xslt-baseline.txt).- XPath: the string concatenation operator
||(XPath 3.0) in the
xppSaxonprofile, as Saxon accepts it in stylesheets that declare
XSLT 2.0;a || b || cisconcat(a, b, c). ThexppXPath20profile
rejects it with XPST0003. - XPath: XPath 1.0 compatibility mode
(TLandrixXmlXPathStaticContext.XPath10Compatible, defaultFalse,
kept by each expression): function arguments take the first item and
are converted withfn:stringorfn:number, arithmetic works on the
first items asxs:double(NaN for an empty operand), and general
comparisons follow XPath 1.0, all as in Saxon. Arguments of user
functio...
LandrixXml 0.4.0
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:LandrixXmlIsNormalizedUtf8and
LandrixXmlIsNormalizedCodePointstell 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 withxecInvalidUnicode. The constant
LandrixXmlNormalizeUnicodeVersionnames 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@idand the integer this way,
is about five times faster.LandrixXmlXPathEval: a child stepname[@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 recordTLandrixXmlXsdFrame, documented as
internal, hasPathIndexinstead ofPathStep.
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 withxecLimit
"Content model too ambiguous to check" after a minute; the three XSTS
testsparticlesZ036_b1,_b2and_cpass, and the whole XSTS run
takes 45 seconds instead of 4.5 minutes. LandrixXmlNormalize: an input or a result of more thanMaxIntcode
points raisesxecLimitinstead of overflowing the Integer
arithmetic (64-bit only).LandrixXmlDom: copies names withoutMove. 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}.
LandrixXml 0.3.0
Native XML Schema and Schematron validation for Delphi 6 to 13 and Free Pascal 3.2+, as optional units. The reader, writer, DOM and conversion units of 0.2.0 do not depend on them and keep their API.
Highlights
- XML Schema 1.0 validation (
LandrixXmlXsdTypes,LandrixXmlXsdContent,LandrixXmlXsdSchema,LandrixXmlXsdSchemaLoader,LandrixXmlXsdValidator) for the reader and the DOM. It follows Xerces in the Java runtime, the validator behind KoSIT and Mustang: the same verdicts, error codes, messages and order. The deliberate differences from the specification are listed in the README. W3C XML Schema Test Suite: 39,225 of 39,336 applicable tests pass. - XPath 2.0 and Schematron (
LandrixXmlXPathTree,LandrixXmlXPath,LandrixXmlXPathEval,LandrixXmlSchematron,LandrixXmlSchematronCompiler). XPath runs in two profiles: as the specification says, or as Saxon HE runs it. Schematron rules load directly from.schand write SVRL. EN16931, XRechnung, Peppol BIS and Factur-X give the same results as the KoSIT validator with Saxon (KoSIT test suite: 86 of 86 equal). - Building blocks:
- exact decimal arithmetic (
LandrixXmlDecimal); xs:doubleandxs:floatin software (LandrixXmlDouble);- XSD and XPath regular expressions (
LandrixXmlRegex); - Unicode categories and normalization (
LandrixXmlUnicode,LandrixXmlNormalize); - SHA-256 (
LandrixXmlSha256).
- exact decimal arithmetic (
Still only SysUtils, Classes and Contnrs; no IDE packages, add source/ to the search path.
See CHANGELOG.md for the full list of additions, changes and fixes.