Something went wrong. Try again.
An XSLT 1.0 processor for Zig 0.16, built on zxml.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105# SPDX-FileCopyrightText: © 2026 Jeffrey C. Ollie <jeff@ocjtech.us># SPDX-License-Identifier: MIT
{ description = "zxsl";
inputs = { nixpkgs = { url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"; }; };
outputs = { nixpkgs, ... }:
let inherit (nixpkgs) lib; makePackages = system: import nixpkgs { inherit system; }; forAllSystems = lib.genAttrs lib.systems.flakeExposed; in { devShells = forAllSystems ( system: let pkgs = makePackages system; in { default = pkgs.mkShell { name = "zxsl"; nativeBuildInputs = [ pkgs.zig_0_17 pkgs.git-pages-cli pkgs.reuse
# The oracle. `xsltproc` is the reference this library is # differentially tested against: every case in `tests/cases` # carries the output libxslt produced for it, and # `zig build oracle` regenerates those from this exact binary. # Its version is recorded in the manifest beside them, because # "what libxslt said" is only a fact if you know which libxslt. pkgs.libxslt
# The XSLT 2.0 oracles, and there are two of them on purpose. # # libxslt is 1.0 only, so nothing it can run says anything about # 2.0. Saxon is the reference for that, and `zig build oracle20` # records what it produces for every case in `tests/cases-20`. # Both bring a JVM with them, which is why they are here and not # in a manifest: a jar is not a Zig dependency and nothing that # merely builds this library should fetch one. # # Saxon-B 8.8 is what records. It is the last Saxon that # implements XSLT 2.0 and *nothing else*, which is the only # property that matters in an oracle: it must be unable to # answer a question you did not ask. saxon-he 12.10 is an XSLT # 3.0 processor, and `version="2.0"` does not make it a 2.0 one # -- it turns off 1.0 backwards compatibility and restricts # neither the grammar, the function library, nor the # serialization defaults. Measured, at `version="2.0"`: # # xsl:iterate, string-join#1, the `!` operator # 8.8 XPST0017 # 12.10 runs all three # <xsl:output method="html"/> # 8.8 <html> # 12.10 <!DOCTYPE HTML> # # That last one is the reason this is not a matter of taste. It # is XSLT 3.0's `html-version` defaulting to 5; nothing in the # stylesheet asked for it, and an `expected` recorded from 12.10 # would assert 3.0's serialization as though it were 2.0. pkgs.saxonb
# And 12.10 as a second witness rather than a recording. 8.8 # was released in November 2006 and the Recommendation is dated # 23 January 2007, so what 8.8 implements is the Proposed # Recommendation -- and Saxon 8.9, the first release after it, # is not packaged. So where 8.8 is wrong for being of its time, # 12.10 is usually right; where 12.10 is wrong for being a 3.0 # processor, 8.8 is right. A case the two agree on is worth more # than either alone, and one they disagree on carries an # `expected.saxon-he` and a `why.md` like any other divergence. # # Note that both packages put a binary called `transform` on # PATH. Whichever comes first wins, silently, so everything here # uses `saxonb-xslt` and `saxon-he-xslt` instead. pkgs.saxon-he ] ++ lib.optionals pkgs.stdenv.hostPlatform.isLinux [ pkgs.kcov pkgs.perf ]; }; } ); };}