xslt-parser-tool
v1.1.2
Published
A tool to parse XSLT files and extract variables, templates, and logic.
Maintainers
Readme
XSLT Parser Tool
Extracts variables, templates, and logic from XML, XSL and XSLT files.
Installation
npm install xslt-parser-toolUsage
Node.js
import fs from 'fs';
import { XSLTParser } from './xslt-parser.js';
const xmlString = fs.readFileSync('./sample.xslt', 'utf-8'); // Path to your .xslt or .xsl file
const parser = new XSLTParser(xmlString);
const result = parser.parse();
console.log(result.variables);or you can use fetch() in Browser
import { XSLTParser } from './xslt-parser.js';
fetch('./sample.xslt')
.then(res => res.text())
.then(xmlString => {
const parser = new XSLTParser(xmlString);
const result = parser.parse();
console.log(result.variables);
});