|
4 | 4 |
|
5 | 5 | ### Added |
6 | 6 |
|
7 | | -* New `io` module exposing a safe Rust wrapper around libxml2's |
8 | | - `xmlRegisterInputCallbacks`: `io::register_input_callback(match_url, |
9 | | - open)` accepts two closures (`&str -> bool` and `&str -> Option<Vec<u8>>`) |
10 | | - and registers them as a custom URL-scheme handler. Useful for |
11 | | - single-binary distributions that bundle XSLT stylesheets / RelaxNG |
12 | | - schemas via `include_bytes!` and serve them through a synthetic |
13 | | - URL scheme (e.g. `embed:///foo.xsl`), so `libxslt`'s `xsl:import` |
14 | | - resolution can reach into the embedded byte tables without ever |
15 | | - touching the disk. Closures run on whatever thread libxml2 invokes |
16 | | - the callbacks from; the `Send + Sync + 'static` bound reflects that. |
17 | | - A single unit test bundles three scenarios (happy path, opt-out |
18 | | - via `None`, defer-to-default for unmatched URLs); the scenarios |
19 | | - share one `#[test]` so they execute sequentially, sidestepping a |
20 | | - thread-safety bug in libxml2's input-callback path on versions |
21 | | - prior to 2.13. |
| 7 | +* New `io` module: `io::register_input_callback(match_url, open)` is |
| 8 | + a safe wrapper around `xmlRegisterInputCallbacks`. Accepts two |
| 9 | + closures (`&str -> bool`, `&str -> Option<Vec<u8>>`) and installs |
| 10 | + them as a custom URL-scheme handler. The intended use is bundling |
| 11 | + XSLT stylesheets / RNG schemas via `include_bytes!` and serving |
| 12 | + them through a synthetic scheme (e.g. `embed:///foo.xsl`), so |
| 13 | + libxslt's `xsl:import` resolution can reach the embedded bytes |
| 14 | + without touching the disk. Closures may run on any thread libxml2 |
| 15 | + calls them from (`Send + Sync + 'static`). |
22 | 16 |
|
23 | 17 | ## [0.3.11] (2026-05-18) |
24 | 18 |
|
|
0 commit comments