An open API service indexing awesome lists of open source software.

https://github.com/informatix8/gulp-saxon-xslt

Gulp plugin to transform XML via Saxon
https://github.com/informatix8/gulp-saxon-xslt

gulp saxon xml xsl xslt

Last synced: about 1 year ago
JSON representation

Gulp plugin to transform XML via Saxon

Awesome Lists containing this project

README

          

# Gulp Saxon XSLT

Bring your own Saxon library to transform XML with XSL 2 or 3.

> ! Important
> This module only supports ESM.

## Features

- Easily use `` to take advantage of other external libraries
- Supply parameters (variables) to the XSL file
- Splitting output via `` adds documents to the gulp stream
- Supports DTDs referenced from XML
- Handle your own error events

## Usage

### Install

```shell
npm install @informatix8/gulp-saxon-xslt --save-dev
```

## Example

```javascript
import gulp from 'gulp';
import xslt from '@informatix8/gulp-saxon-xslt';

export function xslt() {
return gulp
.src('*.xml', { buffer: false })
.pipe(
xslt({
jar: 'saxon9he.jar',
xsl: 'stylesheet.xsl',
params: {
param1: 'foo',
param2: 'bar'
},
debugMode: false,
abortOnError: true
})
)
.on('end', function handleEnd() {
console.log('XSLT Ended');
})
.on('error', function handleError(err) {
console.log('Caught Error');
console.error(err);
})
.pipe(gulp.dest('dist/'));
}
```

## Release

```shell
git tag -a vX.Y.Z
git push origin master
git push origin --tags
npm publish --access=public .
```