xslt3-loader

0.0.9 • Public • Published

xslt3-loader for Webpack

This Web loader can load XSLT stylesheets using Saxon-JS 2. The compiler is called to convert the stylesheet into the SEF format. The result will be a module exporting a single constant, stylesheet, which can then be imported into the frontend application and used by Saxon-JS 2. At this point, only the free (XX) compiler is supported.

Usage

In your module.rules section of webpack.config.js, add a rule like so:

{
    test: /\.xsl$/,
    use: [ 'xslt3-loader' ]
}

In your application source, you can then import a stylesheet like this:

import { stylesheet as example } from '../example.xsl';

The stylesheet can then be used in invocations to Saxon-JS 2:

console.log(SaxonJS.transform({ stylesheetInternal: example,
                                sourceText: '<foo>bar</foo>',
                                destination: 'serialized' }).principalResult);

Package Sidebar

Install

npm i xslt3-loader

Weekly Downloads

2

Version

0.0.9

License

MIT

Unpacked Size

8.19 kB

Total Files

14

Last publish

Collaborators

  • hans