View on GitHub

LibXSLT-raku

LibXSLT - Interface to the GNOME libxslt library

[Raku LibXML Project] / [LibXSLT Module] / Stylesheet

NAME

LibXSLT::Stylesheet

DESCRIPTION

The main API is on the stylesheet, though it is fairly minimal.

One of the main advantages of LibXSLT is that you have a generic stylesheet object which you call the transform() method passing in a document to transform. This allows you to have multiple transformations happen with one stylesheet without requiring a reparse.

Transform Parameters

Unlike the Perl 5 module, this Raku module automatically formats keys and parameters for xpath.

If you wish to emulate the Perl 5 behavour and/or format arguments yourself, pass :raw to the transform() method. You can use xpath-to-string() function to do the formatting:

use LibXSLT::Stylesheet :&xpath-to-string;
my %params = xpath-to-string(param => "string");
$stylesheet.transform($doc, :raw, |%params);

The utility function does the right thing with respect to strings in XPath, including when you have quotes already embedded within your string.