Skip to content

v3.0.0

Compare
Choose a tag to compare
@leonelsanchesdasilva leonelsanchesdasilva released this 07 May 20:03
· 44 commits to main since this release

Breaking Changes

Please note that the xsltProcess method now is asynchronous (returns Promise<string>):

import { Xslt, XmlParser } from 'xslt-processor';

// xmlString: string of xml file contents
// xsltString: string of xslt file contents
// outXmlString: output xml string.
const xsltClass = new Xslt();
const xmlParser = new XmlParser();
// Either
const outXmlString = xsltClass.xsltProcess(
	xmlParser.xmlParse(xmlString),
	xmlParser.xmlParse(xsltString)
);
// Or
xslt.xsltProcess(
	xmlParser.xmlParse(xmlString),
	xmlParser.xmlParse(xsltString)
).then(output => {
  // `output` is equivalent to `outXmlString` (a string with XML).
});

Version 3 received <xsl:include> tag, which relies on Fetch API, which is asynchronous. Version 2 doesn't support <xsl:include>.

If you're planning to update your project with this version, adjust your code as needed.

What's Changed

Full Changelog: v2.3.1...v3.0.0