Repository navigation
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
functions follow the caller's mode. - XSLT: backwards compatible processing. A stylesheet or element with a
version below 2.0 (an XSLT 1.0 stylesheet) is no longer rejected: its
expressions run in XPath 1.0 compatibility mode,xsl:value-of,
attribute value templates,xsl:numberand sort keys take the first
item,key()compares strings, an undeclared parameter is ignored and
function arguments are converted as in XPath 1.0, as Saxon does.
system-property('xsl:supports-backwards-compatibility')isyes. tools/xslt-crosscheck.py --config bis|zugferd|allalso checks the
report stylesheets of the Peppol BIS and ZUGFeRD configurations of the
KoSIT validator (each with its owndefault-report.xsl), and every
configuration with a schema error, a document that is not well-formed
and one no scenario matches.- Schematron:
SaveSvrlToWriterwrites the SVRL element into an open
writer (SaveSvrlToStreamcalls it, its output is unchanged);
RawMessageon the results is the message with the white space of the
rule file, andSvrlPreserveWhitespacewrites it intosvrl:textas
SchXslt and the KoSIT validator do. - XPath and XSLT:
MaxStackBytesonTLandrixXmlXPathEvaluatorand
TLandrixXmlXsltTransformer, a budget for the stack nested user
functions and templates may use; beyond it the run stops with
FOER0000(xecLimit) instead of overflowing the stack. The default,
LandrixXmlDefaultMaxStackBytes, is 3/4 of the program's stack size on
Windows and 0 (no budget) elsewhere.
Changed
- Schematron: text in an assert or report that is only white space
(between twosch:value-of, for example) is left out by the compiler
andtools/sch-compile.py, as the XSLT processor strips it from the
stylesheet SchXslt generates. - XPath: a call of a user function no longer goes through the frame of
the built-in functions; a level of the stylesheet recursion of the W3C
case function-0701 takes 2.4 KB of stack instead of 8.4 KB with Delphi
Win64, where it overflowed the 1 MB stack. - XSLT: the XML output writes U+007F to U+009F and U+2028 as character
references, as Saxon does. - XSLT: an XPath comment inside the braces of an attribute value
template may contain braces. - XSLT: white space in the stylesheet is stripped after comments and
processing instructions are removed (text around a comment is one text
node), and white space beforexsl:paramandxsl:sortis stripped
even underxml:space="preserve". - XPath:
distinct-values()finds repeated strings through a hash table:
120,000 values with 60,000 distinct strings took more than ten
minutes, now about two seconds.
Fixed
- XSLT:
exclude-result-prefixeson XSLT elements other than
xsl:stylesheet(for examplexsl:template) was ignored.