Commit Graph

241 Commits

Author SHA1 Message Date
3fec78da51 feat(xslt): implement xsl:output cdata-section-elements
The text content of the named result elements is emitted in CDATA
sections rather than escaped: the result tree's text children of those
elements are converted to CDATA nodes before serialization, leaving
nested and other elements unaffected. Part of #82.
2026-06-09 02:58:34 +02:00
9b07a5901d docs: refresh test count to 645 2026-06-09 02:53:51 +02:00
f1113c7787 Merge: XSLT output doctype (#82) 2026-06-09 02:53:51 +02:00
2a40300479 feat(xslt): emit xsl:output doctype-public/doctype-system
When doctype-system (optionally with doctype-public) is set on xsl:output,
a <!DOCTYPE> for the result's root element is emitted before the
serialized output: PUBLIC when both identifiers are given, SYSTEM
otherwise. Works for the XML and HTML output methods. Part of #82.
2026-06-09 02:53:50 +02:00
9545802be6 docs: refresh test count to 642 2026-06-09 02:50:24 +02:00
f00c9086cf Merge: XSLT key() node-set argument (#82) 2026-06-09 02:50:24 +02:00
47b88f19b2 feat(xslt): key() over a node-set second argument
key(name, node-set), including key('k', .), now unions the indexed nodes
for every value node's string value and de-duplicates, instead of using
only the first node's string value. A string value still works directly.
Part of #82.
2026-06-09 02:50:24 +02:00
73f8fb74af docs: refresh test count to 639 2026-06-09 02:48:01 +02:00
f9b82bb749 Merge: XSLT method=html output (#82) 2026-06-09 02:48:00 +02:00
41a48d3130 feat(xslt): serialize method=html output by the HTML rules
An xsl:output method=html result is serialized through PureXML.HTML
(void elements emitted without a self-closing slash, raw-text elements
like script/style left unescaped) instead of as XML. Part of #82.
2026-06-09 02:48:00 +02:00
20d7b0e748 docs: refresh test count to 635 2026-06-09 02:37:43 +02:00
999db770e6 Merge: XSLT xsl:sort case-order (#82) 2026-06-09 02:37:43 +02:00
e30672d72b feat(xslt): implement xsl:sort case-order
case-order=upper-first/lower-first makes the string comparison
case-insensitive, with case used only to break ties among otherwise-equal
strings; without it the default codepoint order is unchanged. Part of #82.
2026-06-09 02:37:43 +02:00
46393b3aa2 docs: document the pull/push/SAX/tree consumption modes
Make explicit that input is consumed step by step with bounded memory via
the pull cursor (EventReader/TextReader), push/feed, and SAX, and that only
the tree mode materializes the whole document.
2026-06-09 02:24:02 +02:00
943c9e9b09 docs: refresh test count to 632 2026-06-09 02:20:36 +02:00
33b1883efe Merge: XSLT functions bundle (#82) 2026-06-09 02:20:36 +02:00
322fd013e9 feat(xslt): add generate-id, system-property, *-available functions
generate-id returns a stable per-node identifier (the context node when
no argument is given, the empty string for an empty node-set);
system-property reports the XSLT version and vendor; element-available and
function-available answer against the implemented instruction and function
sets; unparsed-entity-uri is a stub. Part of #82.
2026-06-09 02:20:36 +02:00
f34120a70e docs: move closed XSLT elements #81 to done in roadmap 2026-06-09 02:11:13 +02:00
ae847c32d6 docs: refresh test count to 627 2026-06-09 02:10:17 +02:00
525e047d66 Merge: XSLT xsl:namespace-alias (#81) 2026-06-09 02:10:17 +02:00
610b7d0ca0 feat(xslt): implement xsl:namespace-alias, completing #81
A literal result element and its attributes in a stylesheet namespace
bound by stylesheet-prefix are rewritten on output to the namespace and
prefix bound by result-prefix (#default supported), so a stylesheet can
emit literal xsl: elements. Prefixes resolve through the in-scope xmlns
declarations; aliases fold across include/import. Splits AVT parsing into
XSLTAVT.swift and trims the transformer to stay within length budgets.
2026-06-09 02:10:16 +02:00
26ebeed155 docs: refresh test count to 624 2026-06-09 01:59:40 +02:00
19baa0cd75 Merge: XSLT xsl:decimal-format (#81) 2026-06-09 01:59:40 +02:00
2d2572e265 feat(xslt): implement xsl:decimal-format for format-number
format-number now honors named and default decimal formats: the decimal
separator, grouping separator, percent, minus sign, zero-digit (for
non-Latin digit sets), NaN, and infinity symbols come from the chosen
xsl:decimal-format, in both the picture and the output. FormatNumber is
parameterized over the symbol set and the formats thread through the
function table; folded across include/import.
2026-06-09 01:59:37 +02:00
2f79be18e1 docs: refresh test count to 619 2026-06-09 01:52:22 +02:00
618bf170c8 Merge: XSLT xsl:fallback (#81) 2026-06-09 01:52:22 +02:00
61ab8ce8f9 feat(xslt): implement xsl:fallback for forwards-compatible processing
An unrecognized XSLT element instantiates its xsl:fallback children in its
place, or is dropped when it has none; a fallback under a supported
instruction is ignored. The fallback content is handled in the instantiate
loop alongside variables, so the evaluate dispatch stays within budget.
2026-06-09 01:52:21 +02:00
0dae8e5670 docs: refresh test count to 615 2026-06-09 01:49:34 +02:00
b9e2cd9fa5 Merge: XSLT xsl:apply-imports (#81) 2026-06-09 01:49:34 +02:00
4f11bafa28 feat(xslt): implement xsl:apply-imports
Re-applies templates to the current node in the current mode, considering
only templates of lower import precedence than the one being instantiated,
falling back to the built-in rule when none match. Threads the current
mode and import precedence through the evaluation context, and moves the
transformer runtime types into XSLTRuntime.swift (namespaced, via private
aliases) to stay within the file-length and namespacing gates.
2026-06-09 01:49:33 +02:00
21ed15b1ec refactor(xslt): keep ResultItem/XSLTContext file-private for namespacing
Only the static deduplicated helper moves to XSLTElements.swift (it needs
no private types); attributeSetAttributes stays in the transformer so the
evaluation context and result-item types remain file-private, satisfying
the one-file-scope-type namespacing gate.
2026-06-09 01:41:48 +02:00
75ed549c33 docs: refresh test count to 613 2026-06-09 01:39:46 +02:00
fe30781f79 Merge: XSLT xsl:attribute-set (#81) 2026-06-09 01:39:46 +02:00
22cd88f8ba feat(xslt): implement xsl:attribute-set and use-attribute-sets
Named attribute sets apply to a literal result element or xsl:element via
use-attribute-sets; sets may include other sets recursively with a cycle
guard, set attributes are lowest precedence so the element's own
attributes override them, and same-named attributes collapse to the last.
Folded across xsl:include/xsl:import. Splits the element-building helpers
into XSLTElements.swift to stay within the file-length budget.
2026-06-09 01:39:45 +02:00
0a78822845 docs: refresh test count to 609 2026-06-09 01:29:38 +02:00
b28f865495 Merge: XSLT xsl:message (#81) 2026-06-09 01:29:37 +02:00
367b5b9425 feat(xslt): implement xsl:message with terminate
xsl:message instantiates its body as diagnostic text and produces no
result-tree output; terminate=yes records the text and aborts the
transform with an XSLTError.terminated, halting further instantiation.
Splits the transform entry points into XSLTTransform.swift and moves the
message case to keep within the complexity and file-length budgets.
2026-06-09 01:29:37 +02:00
ff1cdfd244 docs: refresh test count to 606 2026-06-09 01:23:01 +02:00
83fdeb9bfa Merge: XSLT strip-space/preserve-space (#81) 2026-06-09 01:23:00 +02:00
10d9525e3e feat(xslt): implement xsl:strip-space and xsl:preserve-space
Whitespace-only text nodes are removed from the source tree for elements
named by strip-space before transformation, with preserve-space and a
more specific name test winning over *, and xml:space=preserve on a
source element or ancestor overriding the stripping. The name sets fold
across xsl:include/xsl:import. Refactors the stylesheet compile loop
through a Parts accumulator to absorb the new top-level elements within
the complexity budget.
2026-06-09 01:22:59 +02:00
0a78aa76a1 docs: refresh test count to 602 2026-06-09 01:11:54 +02:00
2551fd16fd Merge: RELAX NG attribute-error detail 2026-06-09 01:11:54 +02:00
d80718c530 feat(relaxng): distinguish undeclared attribute from invalid value
A RELAX NG attribute failure now reports an undeclared attribute
("attribute @b is not allowed on <n>") separately from a declared
attribute carrying a bad value ("attribute @count on <n>: 'abc' is not a
valid integer"), quoting the value and naming its datatype by reusing the
text detail. The declared value pattern is found by matching the
attribute name through the residual.
2026-06-09 01:11:54 +02:00
2dc066b573 docs: refresh test count to 601 2026-06-09 01:09:30 +02:00
2cc434abfd Merge: RELAX NG datatype-mismatch detail 2026-06-09 01:09:30 +02:00
3be6832c23 feat(relaxng): quote the offending value and name the datatype in text errors
A RELAX NG text/datatype mismatch now reports the rich datatype reason
(quoting the value and naming the type, e.g. 'abc' is not a valid
integer) and a value mismatch quotes both the actual text and the
required literal, instead of a generic "text content is not valid". The
detail is peeled from the content pattern at the failure point through
choice, group, list, and ref.
2026-06-09 01:09:29 +02:00
3021615b66 docs: refresh test count to 600 2026-06-09 00:59:26 +02:00
cc4a40314c Merge: DTD located content-model errors 2026-06-09 00:59:26 +02:00
fb31033ce8 feat(dtd): located content-model errors with recovery hints
An element whose children break its content model now names each stray
child outside the model's alphabet individually, and reports a pure
order/count violation once with the allowed elements as a hint, instead
of a single opaque "do not match its content model". Adds an alphabet
extractor to the content-model matcher. This brings DTD to the same
located standard as the XSD, RELAX NG, and Schematron validators, so all
four schema languages give editor-grade diagnostics.
2026-06-09 00:59:25 +02:00
3e3ca0f971 docs: refresh test count to 596 2026-06-09 00:55:43 +02:00