@informatix8/gulp-saxon-xslt
v2.0.0
Published
Gulp plugin for XML Transformation via Saxon
Downloads
136
Readme
Gulp Saxon XSLT
Bring your own Saxon library to transform XML with XSL 2 or 3
Features
- Easily use
<xsl:import />
to take advantage of other external libraries - Supply parameters (variables) to the XSL file
- Splitting output via
<xsl:result-document>
adds documents to the gulp stream - Supports DTDs referenced from XML
- Handle your own error events
Usage
Install
npm install @informatix8/gulp-saxon-xslt --save-dev
Example
const gulp = require('gulp');
const xslt = require('@informatix8/gulp-saxon-xslt');
gulp.task('xslt', function () {
return gulp.src([
'*.xml'
])
.pipe(xslt({
jar: 'saxon9he.jar',
xsl: 'stylesheet.xsl',
params: {
param1: 'foo',
param2: 'bar',
},
debugMode: false,
abortOnError: true
}, { buffer: false }))
.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
git tag -a vX.Y.Z
git push origin master
git push origin --tags
npm publish --access=public .