How to use the libxslt.parse function in libxslt

To help you get started, we’ve selected a few libxslt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fireflylearning / pattern-library / src / gulp-plugins / gulp-mdtoXSLT.js View on Github external
return through.obj(function(file, enc, callback) {
        var context = getContext(file);
        var t = this;
        // output(context);
        var templateXMLPath = getXMLPath(file, context);
        var templateXSLPath = getXSLPath(file, context);
        if(debug) gutil.log(templateXMLPath, templateXSLPath);

        var documentString = renderer.renderFile(templateXMLPath, context);
        context.xmlDocumentString = documentString.replace('', '');
        var stylesheetString = renderer.renderFile(templateXSLPath, context);
        output(documentString);
        output(stylesheetString);

        libxslt.parse(stylesheetString, function(err, stylesheet) {

            if (err) {
                alwaysOutput('\n\n' + stylesheetString);
                t.emit('error', new PluginError({
                    plugin: 'MdtoXSLT',
                    message: 'Error parsing xsl stylesheet: ' + file.path + '; failed with error: ' + err
                }));
                return callback();
            }

            stylesheet.apply(documentString, {}, function(err, result) {

                if (err) {
                    gutil.log(file.path);
                    alwaysOutput('\n\n' + documentString);
                    t.emit('error', new PluginError({
github DefinitelyTyped / DefinitelyTyped / libxslt / libxslt-tests.ts View on Github external
const document: libxmljs.XMLDocument = libxslt.libxmljs.parseXmlString('');

let stylesheet: libxslt.Stylesheet;

stylesheet = libxslt.parse('');

stylesheet = libxslt.parse(document);

libxslt.parse('', (err, result) => {
	if (err == null) {
		stylesheet = result;
	}
});

libxslt.parse(document, (err, result) => {
	if (err == null) {
		stylesheet = result;
	}
});

libxslt.parseFile('/path/to/file', (err, result) => {
	if (err == null) {
		stylesheet = result;
	}
});

let applyOptions: libxslt.ApplyOptions = {};

applyOptions = {
	outputFormat: 'string',
	noWrapParams: true
github DefinitelyTyped / DefinitelyTyped / libxslt / libxslt-tests.ts View on Github external
import * as libxslt from 'libxslt';
import * as libxmljs from 'libxmljs';

const document: libxmljs.XMLDocument = libxslt.libxmljs.parseXmlString('');

let stylesheet: libxslt.Stylesheet;

stylesheet = libxslt.parse('');

stylesheet = libxslt.parse(document);

libxslt.parse('', (err, result) => {
	if (err == null) {
		stylesheet = result;
	}
});

libxslt.parse(document, (err, result) => {
	if (err == null) {
		stylesheet = result;
	}
});

libxslt.parseFile('/path/to/file', (err, result) => {
	if (err == null) {
		stylesheet = result;
github DefinitelyTyped / DefinitelyTyped / libxslt / libxslt-tests.ts View on Github external
import * as libxslt from 'libxslt';
import * as libxmljs from 'libxmljs';

const document: libxmljs.XMLDocument = libxslt.libxmljs.parseXmlString('');

let stylesheet: libxslt.Stylesheet;

stylesheet = libxslt.parse('');

stylesheet = libxslt.parse(document);

libxslt.parse('', (err, result) => {
	if (err == null) {
		stylesheet = result;
	}
});

libxslt.parse(document, (err, result) => {
	if (err == null) {
		stylesheet = result;
	}
});

libxslt.parseFile('/path/to/file', (err, result) => {
	if (err == null) {
		stylesheet = result;
	}
});
github DefinitelyTyped / DefinitelyTyped / libxslt / libxslt-tests.ts View on Github external
import * as libxslt from 'libxslt';
import * as libxmljs from 'libxmljs';

const document: libxmljs.XMLDocument = libxslt.libxmljs.parseXmlString('');

let stylesheet: libxslt.Stylesheet;

stylesheet = libxslt.parse('');

stylesheet = libxslt.parse(document);

libxslt.parse('', (err, result) => {
	if (err == null) {
		stylesheet = result;
	}
});

libxslt.parse(document, (err, result) => {
	if (err == null) {
		stylesheet = result;
	}
});

libxslt.parseFile('/path/to/file', (err, result) => {

libxslt

[Fork] Node.js bindings for libxslt compatible with libxmljs

MIT
Latest version published 1 year ago

Package Health Score

55 / 100
Full package analysis