/** * A module for XSLT (Extensible Stylesheet Language Transformations), * a language for transforming XML documents into other XML documents, * or other formats. * * Used in Encoda to make use of existing XSLT stylesheets for converting * between formats. * * Three strategies for implementing XSLT support were considered / tried. * * 1. Use the `xslt-ts` package. At time of writing, did not have support for * several XSLT node types https://github.com/backslash47/xslt/blob/8f8ddf0282d1db720912a5835687642fd21745ac/src/xslt.ts#L184-L224 * and not recently maintained. * * 2. Shell out to `xsltproc` (as we do for Pandoc). Seems more difficult to * automatically install (shared lib dependencies?) on verious platforms. * * 3. Use the `XSLTProcessor` within Puppeteer. We're already using Puppeteer, * the implementation is complete (?), and it's available across platforms * * @see https://en.wikipedia.org/wiki/XSLT * @module util/xslt */ import * as puppeteer from './puppeteer'; /** * An XSLT processor which acts as a proxy to an instance of the * in-browser [`XSLTProcessor`](https://developer.mozilla.org/en-US/docs/Web/API/XSLTProcessor). */ export declare class Processor { /** * The Puppeteer page used to persist a `XSLTProcessor` */ page?: puppeteer.Page; /** * The default XML namespaces to use for XML content * begin transformed by this processor. */ xmlns: Record; constructor(xmlns?: Record); /** * Create a `Processor` instance * * @param stylesheet The XSLT stylesheet to use * @param xmlns The default XML Namespace to use */ static create(stylesheet: string, xmlns?: Record): Promise; /** * Transform some XML using the processor * * @param xml The XMl to transform */ transform(xml: string): Promise; } /** * Transform a XML document using a XSLT stylesheet. * * @param xml The XML document to transform * @param stylesheet The XSLT stylesheet to transform it with */ export declare function transform(xml: string, stylesheet: string): Promise;