Skip to content

v2.3.0

Choose a tag to compare

@knroy knroy released this 12 Nov 05:48
· 7 commits to main since this release
95ae726

Streaming and hardening. XSLT 3.0 streaming runs on the cursor for templates,
grouping, xsl:try, xsl:merge, xsl:fork, accumulators and
xsl:source-document (2,661 W3C cases on the streamed path), and
TransformReader with Output keeps a transform's memory flat: 15–20 MB of
RSS at 564 MB, against 1.6–2.4 GB on the tree. Every fixed resource limit is
an option now, xmlconf passes 1,965 of 1,965, and the confirmed findings of
the security audits run since v2.2.0 are fixed (what they left open is in
docs/known-gaps.md). New API is additive; refusals that changed are listed
under Changed — behaviour.

Added

Change What it does Commit
Streamed record paths with //, wildcards and outermost() //rec, doc//rec, /*/*/rec, *:rec, p:* stream; nested matches ride inside their outermost record. Small records share one tree: 900-deep count(//rec) 2.0 s CPU. df9677e, fd31bb3, 382983c, 22af5f4
Streamed core for xsl:source-document One streamed path for every trusted container: wrappers, choose, loops, split selects; an error is the tree's: final where the stream raises it as the tree does, otherwise re-run on the tree. W3C streamed cases 450 → 2,661. ff0c463, 44db07f, 096a587, d1a98a8
Stylesheet.TransformReader, TransformOptions.SourceParseOptions Applies a stylesheet to a reader, streaming it when the initial mode is streamable and verified (a 1 GB filter in 620 MB heap, not 7.3 GB); otherwise exactly Parse + Transform. bdf45d8
Streamed xsl:apply-templates Template rules, built-in rules, next-match, apply-imports and tunnels run on the cursor in a streamable container: a 1 GB filter in 624 MB, not 7.4 GB. c8c0a01
Streamed xsl:for-each-group group-adjacent, -starting-with and -ending-with over a child path stream in a streamable container or rule, each group as it closes, current-group() read once off the cursor: a 1 GB log grouped in 158 MB heap, not 6.0 GB. fe1eb18
Streamed xsl:try A try in a streamable container or rule streams its body; a caught error skips the rest of the context on the cursor and the catch runs on the start tag's view. The catch sees the tree's first error. 2447ca0
Stylesheet functions in streamed selects A call whose body is its value exactly (one xsl:sequence, no failing conversion) is split as its body; path ! f(.) of atomic values reads as path/f(.): an absorbing function over 1 GB of records in 3 MB heap, not 11 GB. 6abbb27
Streamable attribute sets xsl:use-attribute-sets on streamed literal result elements, xsl:element and xsl:copy. 26caed6
Streamed accumulators xsl:accumulator values are computed as a streamed document is read, in a streamable xsl:source-document and through TransformReader: a running total over 1 GB in 3 MB heap, not 15 GB. 42902f3
Streamed xsl:fork and xsl:map Several prongs or entries reading one streamed document each run on a parse of their own over one read of its bytes, in turn; outputs in prong order, the first error the tree's. 2a1d6ad
Streamed xsl:merge Each for-each-source document of a streamable merge source is read on its own cursor and merged by key as the tree merges: two 512 MB logs in 3.9 MB of heap. 2089255
TransformOptions.Output Serializes the principal result to a writer as it is built: a 1 GB identity in 4.5 MB heap, not 9.4 GB. Written nodes no longer count toward MaxNodes; buffered results keep the cumulative count. 34e6b36
TransformOptions.SecondaryOutput Each xsl:result-document is serialized to the writer the function returns for its URI, as it is made, and closed at its end; a 1 GB split into 7,018 files in 5.6 MB heap. e94d4e0
TransformOptions.SourceValidation (SourceStrict, SourceLax) Validates the principal input against the stylesheet's schema; TransformReader validates it while streaming, with the tree's typing, defaults and error. 081c9d3
TransformOptions MaxNodes, MaxBytes, MaxNodesBuilt, MaxBytesBuilt Held and total-work bounds for result and temporary trees and strings. Zero keeps the defaults; negative removes the bound. 294b965
xslt.CompileContext Compile with a context: a call waiting for the compile slot returns ctx.Err(); the static phase and nested fn:transform compiles run under it. cfa135c, 4694fa3, 0ecee9c
CompileOptions.MaxSchemaBytes, xslt.DefaultMaxSchemaBytes Total schema source xsl:import-schema may read per compile, closures included; zero means 16 MB. 4ad352d
xdm.FlattenContext, XIncludeOptions.Context A cancellable Flatten that returns its step refusal as an error, and a cancellable XInclude pass. 9399efd
c14n.FromXPathFilterContext, FromXPathContext XML-DSig XPath transforms under a context; a filter's per-node evaluations share one item and byte budget. 2a41550
c14n.FromXPathFilterHere, FromXPathHere XML-DSig filters can call here(): the node bearing the expression, a text node read as its parent; a node outside the document is refused. e0d2c13
xdm.ParseOptions.Warn Receives xml:id errors (duplicate ID, non-NCName value) as XQDY0091 *xdm.Errors, at most 100 then one summary; nil stays silent. 0caab03, c6508c3
xslt.StreamingDocumentResolver, FileResolver.OpenDocument A resolver with OpenDocument streams streamable xsl:source-document and merge sources; one without it still builds the tree. 0d9c103
tests/streambench Measures one transform on the tree against the same transform streamed through TransformReader, per process: 15–20 MB of RSS at 11, 112 and 564 MB streamed, against 46 MB to 2.4 GB on the tree, at 0.9–1.5× the time (docs/benchmark.md, "Streaming against the tree"). 1db051a

Changed — behaviour

Change What it means Commit
XML-DSig XPath filters used XPath 2.0 numbers: number('1e3') was 1000, string(1 div 0) was 'INF', 1 < 2 < 3 was refused New xpath.CompileOptions.XPath10 applies the XPath 1.0 number model and comparison grammar; c14n's FromXPath*/FromXPathFilter* use it, so some filters select different nodes and an exponent literal is refused. 1df119d
An XSD validation refused at MaxDepth, or an assertion declined, has no validity code Its ValidationError.Code is "" (was cvc-elt.1 / cvc-assertion.3) and Err wraps xdm.ErrResourceLimit; the document is still refused. de6e686
A 1.1 restriction rejected after a subsumption budget decline wraps xdm.ErrResourceLimit Still refused, now as undecided with no constraint code; raising the xsd.Options budgets may admit it. 5203922
dtd.Validate reports undeclared attributes A document that validated before may now fail; Options.AllowUndeclared skips them, as it skips undeclared elements. 915eb63
XQuery validate lax with no imported schema returns a copy of its operand The result is a new node, not the input node, as §3.21 requires; the input keeps no annotation. f46ec7b
A tree past the text store's block ceiling is an error, not a panic Entry points that return an error return xdm.ErrResourceLimit; xdm/xdmbuild methods with no error return still panic, with an error value that matches it. 91f30c9
ParseOptions.MaxNodes counts text that is not all white space, comments and PIs A document near the bound may now be refused; whitespace-only text is still not counted. 9e9a6f9, 089c346
One XInclude pass shares a node budget Everything its inclusions copy in counts against Parse.MaxNodes, once per level it is copied through. eb4d0ae
An xsl:use-package cycle is XTSE3005 A package that uses itself, directly or through another, is a static error, not a crash. dce8830
Compile refuses a stylesheet needing over 10,000 module visits Each include/import resolution counts, in the static phase and the compile; real stylesheets need about 120. 77c3c5d
Package reads and compiles count as module visits A package graph compiling over 10,000 package copies is refused with ErrResourceLimit; the W3C package cases need at most 16. 4c5c3ee
A streamed parse refuses over 64 ancestor attributes per record past 16M copies It returns ErrResourceLimit where Parse + Transform succeeds; back off to the tree on errors.Is. f90e97d
A streamed xsl:merge of more than 64 inputs runs on the tree Output is unchanged; memory is the tree's. e621bf7
Serialize refuses an OutputSettings.Standalone other than "", omit, yes or no SEPM0016, where a value such as "true" was written raw. 877b3af
xsl:key entries are bounded per transform They are totalled across every index against MaxItems, so many keyed temporary trees can raise XPDY0130. d06d0f3
c14n XPath transforms use XPath 1.0 rules A relational comparison of two strings converts both to numbers, as XML-DSig requires. 0c70a04
Rooted file resolvers refuse UNC and device paths //host/…, \\host\…, file:////host/… and \\?\… fail with "names a network path" on every OS unless a root is on that \\host\share. 60fed8a
dtd.Validate checks the root element against the DOCTYPE name A document whose root is another declared element is now invalid, as XML 1.0 requires. a543265
XPath refuses a chained-operator path over 10,000 nodes deep XPDY0130 where a deeper expression used to overflow the stack; the longest real chain seen is 190. e965b1f
The backtracking regex refuses subjects needing over 50,000 nested calls XPDY0130 (ErrResourceLimit), about 25,000 characters under .*; only with the backtracker enabled. a97ac65
Anchored regexes with large class payloads are refused Only an onepass-sized anchored one: ^\pL{753}$ or a 990-copy facet fails MaxRegexpProgram; unanchored compiles. d258054, 6ad619f
Flatten refuses over 16.7M items inside arrays Even with MaxItems raised or -1; array:flatten and fn:data also charge the host's MaxItems. 9c19935, 0d82e86
Resource text, JSON, sequence constructors, group-by and windows count against the item, node and byte budgets Large results can now raise XPDY0130; unparsed-text-available raises the budget error instead of answering false. 406c6e1, 3251f40, 5423f40, 11da206
XInclude passes share byte and visit budgets A pass whose inclusions copy over MaxBytes, or whose local searches visit over MaxNodes, is refused. ed500f2
Compile refuses stylesheets whose modules total over 500,000 nodes Counted across imports, includes, packages and static fn:transform; xslTNG needs about 40,000. d0591ae
WithInstanceLocations binds documents to their namespace and the schema directories A mismatched namespace, or a local location outside the schema's directories, is declined (XSD §4.3.2): skipped, and the call succeeds. c767803
\??\ paths are refused as device paths A local \??\C:\… spelling is refused too, as \\?\C:\ already was. 639bcb4
XSD MaxDocuments is charged per new document read Charged after resolve and before parse; the document past the limit is never read, and repeat references cost nothing. 429b9c6
Nilled elements enforce their own identity constraints A nilled element breaking a key on its own declaration is now invalid, tree and stream. ee8aaa2
RELAX NG list derivatives and fetched documents are bounded A list derivative past MaxPatternSize, or fetched documents totalling over xdm's single-document limits, are refused. f6079cf, aff6564
fn:serialize map-form doctype parameters are checked Values the element form refuses (SEPM0016) are refused in the map form too. 2f9d010
Regex and Flatten limits raise XPDY0130 catch err:FORX0002 no longer sees them; a malformed pattern is still FORX0002, and xsl:analyze-string passes them through. e7042aa, f077a70
xsl:import-schema reads at most 16 MB per compile Counted across modules, packages and static fn:transform; raise CompileOptions.MaxSchemaBytes for larger schema sets. 4ad352d
WithInstanceLocations declines rather than fails An outside, unresolvable or mismatched location is skipped and the call succeeds; a reference needing it fails at the reference. 7e92b19
XSD temporal fields over 1000 digits are refused ValidationError.Err wraps xdm.ErrResourceLimit: "cannot decide", not invalid. 97fccf5, eb9ddf8
The CLI's -timeout covers -xinclude A slow XInclude pass now counts against the same deadline as the transform. 9399efd
fn:id, fn:idref, fn:element-with-id ignore undeclared id attributes Declare the attribute ID in a DTD or schema, or use xml:id; a non-NCName token is ignored. b9171e8, 0caab03
An undeclared entity where XML §4.1 makes it a VC is refused Such a document used to parse with the reference dropped; supply ParseOptions.ExternalEntities to read it. 8650527
Malformed DTD declarations are refused under AllowDOCTYPE DTDs accepted before are refused when they break the XML 1.0 declaration grammar. 252b65b
dtd.Validate refuses a 1.0 document using a 1.1 external entity XML 1.1 §4.3.4; a tree with no declared version is 1.0. ee5018c
dtd.Validate checks xmlns and xmlns:p as attributes An undeclared namespace declaration is now a validity error, as in xmllint --valid. c516340
XSD 1.0 refuses XSD 1.1 components A 1.1 schema loaded as 1.0 fails with "requires XSD 1.1" instead of losing its constraints. f9a904d
A key field on an unassessed wildcard attribute is invalid Tree and stream, XSD 1.0 and 1.1; declare the attribute globally to keep a lax match typed. 7362b27
xsl:stream is XTSE0010 Write xsl:source-document; forwards-compatible mode takes the xsl:fallback. b6aef3e
An attribute after content in a successful xsl:try body is XTDE0410 caught by that try §8.3: errors during the try's evaluation, its output included, are caught; it was dropped. Matches Saxon. 2ef0012, 400c28c
cache="yes" on a proactive function returns fresh nodes Only node-free results (atomics, arrays and maps of them) are reused; new-each-time="maybe" memoises nodes. 605d0be, 9298bc6
fn:transform refuses package-* beside stylesheet-* FOXT0002 where the package-* option was ignored. 57a0c9d
Date and time component accessors raise FORG0001 for a bad untyped value catch err:XPTY0004 no longer sees a failed cast there. 1505000
XQuery validate type checks its type at compile XQST0104 from Compile; a built-in type with no schema import validates instead of XQDY0084. ff9032d, 1889367
XQuery 1.0 and 3.0 modules apply their own version's rules Empty ordered{}, an unprefixed pragma and a bare namespace-node() step are refused there; unversioned modules are 3.1. cc13393
The html method defaults to HTML5 for XSLT 2.0 and 3.0 stylesheets <!DOCTYPE HTML> and the HTML5 void list unless version="4.0"; xhtml stays XHTML 1.0. Matches Saxon-HE 12.7 (§26). da68710
A streamed container's error is the stream's when its family is final No second read on the tree; the code and text are the tree's, the first error detected (§2.14). fbcfc71, 86cde00
An XSD 1.0 schema naming any XSD 1.1 built-in type fails src-resolve Load it as Version11; XQuery and XSLT 3.0 imports already are. 5c39a0c, b42e77e
An invalid imported XQuery schema is XQST0012 catch err:XQST0059 no longer sees it. 9148c2d
With every declaration read, an entity declared in neither subset is a validity error The document parses with the reference dropped, and dtd.Validate reports it (§4.1, erratum E13). dbe610d
dtd.Validate reports more validity errors A DTD repeating an element type across subsets, or a document breaking the new VCs, is invalid now. 72903d9, 8c47532, ca0d7be
An internal-only DOCTYPE that references an external PE needs a resolver dtd.Load returns ErrNoResolver, as for an external subset; InternalSubsetOnly leaves it unread. 4bab79c
Ill-formed DTD and entity forms are refused The WFC fixes above make documents that parsed fail; all were ill-formed. cb762f7, af26eb4, 243a7af, 43ca8b3, 9753ec8, 12b68fa, dabed51
XInclude parse="text" counts against Parse.MaxBytes A pass whose text inclusions exceed it is refused, as parse="xml" already was. bd467ae
Duration, xs:time and xs:dateTime casts are bounded by MaxDigits Over-long component text is FOCA0003 wrapping ErrResourceLimit, before parsing. 35cd6bf
xsl:merge entries, implicit snapshots, accumulator tables and inherited namespaces are charged Large merges or copies can now raise XPDY0130 under the item, node or byte budget. aa6ac52, bf6cedd, 53a70a1
Sequence-constructor output is bounded per instruction xsl:try, as-typed templates, xsl:perform-sort and kin inside a loop can raise XPDY0130. f068f13
A type alternative whose test the budget refuses stops XSD validation A resource-limit failure, where the test was taken as false and a later alternative chosen. 7a194ca
xs:redefine checks more A redefined group retyping an element, or an attribute group widening its wildcard, is refused. 470c573
Regex group and class-subtraction nesting over 1000 is refused FORX0002 wrapping ErrResourceLimit, the depth RE2 refuses. 835d67f
fn:parse-xml, map:merge combine, array:join and atomization are charged They count against MaxNodes or MaxItems, so large results can raise XPDY0130. 1594bc4, dbc271b, 83a0b0e
html/xhtml comments opening with > or -> are SERE0003; fn:serialize html PIs with > are SERE0015 Such output used to be written; the xml method is unchanged. df6517f, 25e8d08
A map constructor or xsl:fork of over 64 reading parts runs on the tree Output is unchanged; memory is the tree's. f41fadc
Past 16 open writers a nested xsl:result-document is written once complete The same bytes reach the SecondaryOutput later, not while its body runs. e75f9f1
fn:load-xquery-module calls in one evaluation share the module budget Distinct calls spend MaxModules/MaxModuleBytes cumulatively; a repeat reuses the compile or error. 1dd0db1
Declined XSD instance locations count against MaxDocuments Many unresolvable locations can now refuse the load. ef95910
Expr.Eval and Pattern.Matches return resource refusals as errors No xdmlimit panic escapes; a refused or cancelled pattern match is an error, not false. 83a0b0e, 08560cc
Each XSLT import occurrence is charged to MaxModuleNodes in the static phase A stylesheet importing one module many times is refused before the work, not after. 11393c5
CLI -allow-dir ignores empty and whitespace segments They no longer grant the working directory. e34e85c
xslt.NewFileResolver refuses an empty or whitespace root It returns an error; a blank entry in a hand-set Roots grants nothing. 83902a6
XInclude charges a nested document before recursing A chain of inclusions is refused earlier under Parse.MaxNodes/MaxBytes. ec47776
No xdmbuild call panics on the text-store ceiling or a flatten refusal Error-returning calls return ErrResourceLimit; others latch it (Refused) for the next error-returning call. eea98c7, df2f529
XQuery charges content copies, array flattening and copied namespace bindings Nodes to MaxNodes, values to MaxBytes, items to MaxItems, 32 B per binding; large constructions can raise XPDY0130. 0d75787, df2f529
XQuery's 200-level nesting bound applies to every bracketed body try/catch, ordered, validate, switch, if, computed constructors, interpolation, inline functions: XPDY0130. e413019
fn:load-xquery-module spends one MaxSchemaBytes per evaluation Failed compiles count toward MaxModules, and a load past it is refused before compiling. 2f2152a
Expressions, inline functions and xsl:function bodies 200+ levels tall cost extra recursion depth Deep recursion through them raises XPDY0001 sooner. 289a0e6, 780f7b9, b631123
CastAtomic/CastToDerived refuse over 1,000,000 digits for every caller FOCA0003 wrapping ErrResourceLimit; MaxDigits=-1 lifts it only for cast expressions, constructors and function conversion. ec9408a
Function items run under the caller's node, entity, item and digit limits A closure from another evaluation no longer brings its own allowances. b9ad97f
XSLT MaxItems covers live local variables and parameters, and more producers charge as they grow fn:tail, list-type casts, path steps and ! charge items; a mixed node/atomic step fails early, same code. bafe94f, dfe60f2, 258f49d, af0a0b6
[f] and format-number exponent pictures are limited to 65,536 Wider pictures are refused with ErrResourceLimit. 898f42e, e24a461
UCA contains, starts-with and substring-before/after charge keyed bytes to MaxBytes Large collated searches can raise XPDY0130. b9bafc5
fn:serialize html/xhtml comments starting > or -> are SERE0003 As the XSLT serializer already did. 173bd58
The default backreference path admits only shapes it answers correctly Others go to the opt-in backtracker or fail FORX0002; patterns refused as XPDY0130 by the removed analysis now compile. 32ae444, adb6535
Cyclic XSD unions and base types are refused before any value walk st-props-correct.2 only: such schemas no longer add postFixup or facet diagnostics. 4055730
A 2^n all-group DAG is refused, not a positions error cos-nonambig on the validate path, ErrResourceLimit on the restriction path. 34383fa, be6bebd
A redefine reaching a circular group reports mg-props-correct.2 Where it hung or overflowed the stack. 14d2eb3
XSD content models drop counters that cannot change a decision Same verdicts; fewer simultaneous states. 2634957
XSD instance locations reach the resolver as absolute paths Custom resolvers and error texts see the absolute form. 0817160
Assertion instance of uses the validating schema's type environment Not the process-wide table a later schema could overwrite. 8e85b21
dtd.Validate stops walking at MaxErrors and holds one compiled element-only model at a time MaxContentModel* also bound what one call holds; failures keep document order. 687726d
The DTD loader and xdm pre-pass end a PI at ?> A > inside a PI no longer ends it, so a %ref there is not substituted. 48be9b0, 71bfffc
RELAX NG compact postfix and datatype - pattern chains count toward the 500-deep limit MaxPatternSize is also checked after the last attribute, before children and before the end tag. 1664d17, 678f986
XSLT MaxBytes counts kept xsl:message text, undeclarations and copied values under 8 KiB In snapshot(), copy-of() and xsl:sequence; large outputs can raise XPDY0130. 8b6220d, ce94988, 9d1dd6e
XSLT MaxItems limits number tables, on-empty/on-non-empty, streamed merge groups, recorders and climbSort A refused level="any" table falls back to walking and never refuses. 26039a1, 622522b, 6edc92b, 41e02d2, ff39163
fn:transform stylesheet-text shares MaxTotalEntityBytes A nested stylesheet's entities count against the caller's budget. 4051d75
The html method escapes script/style in a foreign namespace Only HTML-namespace ones are raw text. cdc71e8
xsl:number start-at at MinInt64 is correct and spelling it no longer crashes Where the process died of a stack overflow. a337ed8
Shared attribute sets reached through several branches may order attributes differently Each set runs once, at its last occurrence; values are unchanged. 5cee1ef
A streamability trust chain longer than DefaultMaxDepth runs on the tree Output unchanged; memory is the tree's. cd27e57
The 64-consumer tee bound is transform-wide Across nested forks and streamed source-documents; past it the run goes to the tree, output unchanged. 2969e1b, f42220b
Modes whose @mode × @match fan-out is huge are left unindexed Dispatch is a linear scan there, still correct. 298eb94
The internal abstract-marker namespace is no longer a fixed string It carries a per-process random suffix. 8ca4e94

Also in this release

Changed, Fixed: the full lists are in CHANGELOG.md at v2.3.0. GitHub limits a release body to 125,000 characters, and the whole section is 145,000.