Function xrust::xslt::from_document

source ·
pub fn from_document<N: Node, F, G>(
    styledoc: N,
    base: Option<Url>,
    f: F,
    g: G
) -> Result<Context<N>, Error>
where F: Fn(&str) -> Result<N, Error>, G: Fn(&Url) -> Result<String, Error>,
Expand description

Compiles a Node into a transformation Context. NB. Due to whitespace stripping, this is destructive of the stylesheet. The argument f is a closure that parses a string to a Node. The argument g is a closure that resolves a URL to a string. These are used for include and import modules. They are not included in this module since some environments, in particular Wasm, do not have I/O facilities.