xslt-processor - v4.8.0
    Preparing search index...

    Class Xslt

    The main class for XSL-T processing.

    References:

    [XSLT 1.0] XSL Transformations (XSLT) Version 1.0 https://www.w3.org/TR/1999/REC-xslt-19991116.

    [XSLT 2.0] XSL Transformations (XSLT) Version 2.0 https://www.w3.org/TR/xslt20/.

    [XSLT 3.0] XSL Transformations (XSLT) Version 3.0 https://www.w3.org/TR/xslt-30/.

    [ECMA] ECMAScript Language Specification http://www.ecma-international.org/publications/standards/Ecma-262.htm.

    The XSL processor API has one entry point: the async function xsltProcess(). It receives as arguments the input XML document and the XSL-T stylesheet document (both as XDocument instances), and returns the transformed output as a string (XML, HTML, JSON, or plain text depending on the output method).

    NOTE: Strictly speaking, XSL-T processing according to the specification is defined as operation on text documents, not as operation on DOM trees. This implementation operates on an internal DOM representation, complemented by an XML parser and serializer to be complete. Those two are found in the dom folder.

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    xPath: XPath
    xmlParser: XmlParser
    matchResolver: MatchResolver
    options: XsltOptions
    decimalFormatSettings: XsltDecimalFormatSettings
    warningsCallback: (...args: any[]) => void
    outputDocument: XDocument
    outputMethod: "xml" | "html" | "text" | "name" | "xhtml" | "json" | "adaptive"
    outputOmitXmlDeclaration: string
    outputVersion: string
    itemSeparator: string
    version: string
    firstTemplateRan: boolean
    forwardsCompatible: boolean

    Forwards-compatible processing mode (XSLT 1.0 Section 2.5). When true, the processor is running a stylesheet with version > 1.0. In this mode:

    • Unknown top-level elements are silently ignored
    • Unknown XSLT instructions use xsl:fallback if available, otherwise are ignored
    • Unknown attributes on XSLT elements are ignored
    stripSpacePatterns: string[]

    List of element name patterns from xsl:strip-space declarations. Whitespace-only text nodes inside matching elements will be stripped.

    preserveSpacePatterns: string[]

    List of element name patterns from xsl:preserve-space declarations. Whitespace-only text nodes inside matching elements will be preserved. preserve-space takes precedence over strip-space for conflicting patterns.

    namespaceAliases: Map<string, string>

    Namespace aliases from xsl:namespace-alias declarations. Maps stylesheet namespace prefixes to result namespace prefixes.

    supportedExtensions: Set<string>

    Set of supported extension element namespaces. Processors can register custom extension namespaces here. Currently only XSLT namespace is auto-registered.

    attributeSets: Map<string, XNode[]>

    Map of attribute sets defined in the stylesheet. Keys are attribute set names, values are arrays of xsl:attribute nodes.

    userDefinedFunctions: Map<string, XNode>

    Map of user-defined functions from xsl:function declarations. Keys are QNames (namespace:localname), values are the function definition nodes.

    resultDocuments: Map<string, string>

    Result documents created by xsl:result-document. Keys are the href URIs, values are the serialized output strings.

    Methods

    • The exported entry point of the XSL-T processor.

      Parameters

      • xmlDoc: XDocument

        The input document root, as DOM node.

      • stylesheet: XDocument

        The stylesheet document root, as DOM node.

      Returns Promise<string>

      the processed document, as XML text in a string, JSON string if outputMethod is 'json', or text if outputMethod is 'text' or 'adaptive' (with text content).

    • The main entry point of the XSL-T processor, as explained on the top of the file.

      Parameters

      • context: ExprContext

        The input document root, as XPath ExprContext.

      • template: XNode

        The stylesheet document root, as DOM node.

      • Optionaloutput: XNode

        If set, the output where the transformation should occur.

      Returns Promise<void>

    • Handle unknown XSLT instructions per XSLT 1.0 Section 2.5 (Forwards-Compatible Processing).

      In forwards-compatible mode (version > 1.0):

      • If the instruction has an xsl:fallback child, execute the fallback
      • Otherwise, the instruction is silently ignored

      In strict mode (version = 1.0):

      • Unknown instructions are an error

      Parameters

      • context: ExprContext

        The Expression Context

      • template: XNode

        The unknown XSLT instruction element

      • Optionaloutput: XNode

        The output node

      Returns Promise<void>

    • Protected

      Implements xsl:apply-templates.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The template.

      • Optionaloutput: XNode

        The output. Only used if there's no corresponding output node already defined.

      Returns Promise<void>

    • Implements xsl:apply-imports. Applies templates from imported stylesheets with the same match pattern and mode. This enables template overriding where a template in an importing stylesheet can call the overridden template from the imported stylesheet.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The apply-imports template node.

      • Optionaloutput: XNode

        The output node.

      Returns Promise<void>

    • Protected

      Implements xsl:attribute.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The template.

      • Optionaloutput: XNode

        The output. Only used if there's no corresponding output node already defined.

      Returns Promise<void>

    • Implements xsl:call-template.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The template.

      • Optionaloutput: XNode

        The output, used when a fragment is passed by a previous step.

      Returns Promise<void>

    • Implements xsl:choose, its child nodes xsl:when, and xsl:otherwise.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The template.

      • Optionaloutput: XNode

        The output. Only used if there's no corresponding output node already defined.

      Returns Promise<void>

    • Implements xsl:copy for all node types.

      Parameters

      • destination: XNode

        the node being copied to, part of output document.

      • source: XNode

        the node being copied, part in input document.

      Returns XNode

      If an element node was created, the element node. Otherwise, null.

    • Implements xsl:comment.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The template.

      • Optionaloutput: XNode

        The output. Only used if there's no corresponding output node already defined.

      Returns Promise<void>

    • Implements xsl:processing-instruction.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The template.

      • Optionaloutput: XNode

        The output. Only used if there's no corresponding output node already defined.

      Returns Promise<void>

    • Implements xsl:copy-of for node-set values of the select expression. Recurses down the source node tree, which is part of the input document.

      Parameters

      • destination: XNode

        the node being copied to, part of output document.

      • source: XNode

        the node being copied, part in input document.

      Returns void

    • Implements xsl:decimal-format, registering the settings in this instance and the current context.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The template.

      Returns void

    • Implements xsl:element.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The template.

      • Optionaloutput: XNode

      Returns Promise<void>

    • Implements xsl:accumulator (XSLT 3.0).

      Accumulators are a declarative way to compute values during template processing. They consist of rules that are applied as elements are processed.

      Parameters

      • context: ExprContext

        The expression context

      • template: XNode

        The xsl:accumulator element

      Returns void

    • Evaluates all matching accumulator rules for a given node and updates the accumulator state

      Parameters

      • context: ExprContext

        The expression context with current node

      • node: XNode

        The current node being processed

      Returns void

    • Retrieves the current value of an accumulator Used when accessing accumulators in templates via accumulator-after() or accumulator-before()

      Parameters

      • accumulatorName: string

        The name of the accumulator

      Returns any

      The current value of the accumulator, or null if not found

    • Implements xsl:for-each.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The template.

      • Optionaloutput: XNode

        The output.

      Returns Promise<void>

    • Implements xsl:for-each-group (XSLT 2.0).

      Groups items from the select expression and processes each group. Supports group-by and group-adjacent grouping methods.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The template.

      • Optionaloutput: XNode

        The output.

      Returns Promise<void>

    • Implements xsl:iterate (XSLT 3.0).

      Iterates over a sequence, maintaining accumulators that are updated across iterations. Each iteration can output content and update accumulator values. After all iterations complete, optional xsl:on-completion is executed.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The template.

      • Optionaloutput: XNode

        The output.

      Returns Promise<void>

    • Implements xsl:try.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The template.

      • Optionaloutput: XNode

        The output.

      Returns Promise<void>

    • Implements xsl:evaluate (XSLT 3.0). Dynamically evaluates an XPath expression constructed as a string.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The template.

      • Optionaloutput: XNode

        The output.

      Returns Promise<void>

    • Implements xsl:if.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The template.

      • Optionaloutput: XNode

        The output.

      Returns Promise<void>

    • Common implementation for <xsl:import> and <xsl:include>.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The template.

      • output: XNode

        The output.

      • isImport: boolean

        Whether this is an import (true) or include (false).

      Returns Promise<void>

    • Implements <xsl:import>. For now the code is nearly identical to <xsl:include>, but there's no precedence evaluation implemented yet.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The template.

      • Optionaloutput: XNode

        The output.

      Returns Promise<void>

    • Implements xsl:include.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The template.

      • Optionaloutput: XNode

        The output.

      Returns Promise<void>

    • Implements <xsl:package> (XSLT 3.0 Section 3.6). Defines a package of XSLT components with controlled visibility.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The xsl:package element.

      • Optionaloutput: XNode

        The output node.

      Returns Promise<void>

    • Loads and registers an external package. Creates a temporary context and processes the package document.

      Parameters

      • name: string

        The package name/URI.

      • packageDoc: XNode

        The parsed package document.

      • Optionalversion: string

        Optional semantic version string.

      Returns Promise<void>

    • Implements <xsl:use-package> (XSLT 3.0 Section 3.7). Imports another package and makes its public components available.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The xsl:use-package element.

      • Optionaloutput: XNode

        The output node.

      Returns Promise<void>

    • Implements <xsl:expose> (XSLT 3.0 Section 3.8). Marks a component as visible outside the package.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The xsl:expose element.

      Returns void

    • Implements <xsl:accept> (XSLT 3.0 Section 3.9). Accepts and optionally overrides a component from a used package.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The xsl:accept element.

      Returns void

    • Implements xsl:override (XSLT 3.0 Section 3.7.2). Overrides components from a used package.

      Parameters

      • context: ExprContext
      • template: XNode
      • Optionaloutput: XNode

      Returns Promise<void>

    • Implements xsl:original (XSLT 3.0 Section 3.7.2). Calls the original component from within an override.

      Parameters

      • context: ExprContext
      • template: XNode
      • Optionaloutput: XNode

      Returns Promise<void>

    • Implements <xsl:mode> (XSLT 3.0 Section 3.5). Declares a mode with visibility and other properties. Only valid within an xsl:package.

      Parameters

      Returns void

    • Implements <xsl:stream> (XSLT 3.0 Section 16). Enables streaming processing of large documents.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The xsl:stream element.

      • Optionaloutput: XNode

        The output node.

      Returns Promise<void>

    • Implements <xsl:fork> (XSLT 3.0 Section 17). Creates multiple independent output branches from the input stream.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The xsl:fork element.

      • Optionaloutput: XNode

        The output node.

      Returns Promise<void>

    • Implements <xsl:merge> (XSLT 3.0 Section 15). Merges multiple sorted input sequences.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The xsl:merge element.

      • Optionaloutput: XNode

        The output node.

      Returns Promise<void>

    • Implements xsl:key.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The template.

      Returns void

    • Implements xsl:message. Outputs a message to the console. If terminate="yes", throws an error to stop processing.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The <xsl:message> node.

      Returns Promise<void>

    • Implements xsl:namespace-alias. Declares that a namespace URI in the stylesheet should be replaced by a different namespace URI in the output.

      Parameters

      • template: XNode

        The <xsl:namespace-alias> node.

      Returns void

    • Implements xsl:number. Inserts a formatted number into the result tree.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The <xsl:number> node.

      • Optionaloutput: XNode

        The output node.

      Returns void

    • Counts nodes for xsl:number based on level, count, and from attributes.

      Parameters

      • context: ExprContext

        The Expression Context.

      • level: string

        The counting level: 'single', 'multiple', or 'any'.

      • count: string

        Pattern to match nodes to count.

      • from: string

        Pattern to define counting boundary.

      Returns number[]

      Array of count values (single element for 'single'/'any', multiple for 'multiple').

    • Checks if a node matches a pattern (supports simple names and union patterns).

      Parameters

      • node: XNode

        The node to check.

      • pattern: string

        The pattern (node name, wildcard, or union like "a|b|c").

      Returns boolean

      True if the node matches.

    • Checks if a node matches a single (non-union) pattern.

      Parameters

      • node: XNode

        The node to check.

      • pattern: string

        The pattern (node name or wildcard).

      Returns boolean

      True if the node matches.

    • Gets all nodes preceding the given node in document order.

      Parameters

      • node: XNode

        The reference node.

      • fromPattern: string = null

        Optional pattern to define counting boundary.

      Returns XNode[]

      Array of preceding nodes.

    • Collects all descendant nodes of a given node.

      Parameters

      • node: XNode

        The parent node.

      • result: XNode[]

        The array to collect into.

      Returns void

    • Formats an array of numbers according to the format string. For level="multiple", numbers like [1, 2, 3] with format "1.1.1" produce "1.2.3".

      Parameters

      • numbers: number[]

        The numbers to format.

      • format: string

        The format string (e.g., "1", "1.1", "1.a.i").

      • groupingSeparator: string

        Optional grouping separator.

      • groupingSize: string

        Optional grouping size.

      Returns string

      The formatted number string.

    • Parses a format string into tokens and separators. E.g., "1.a.i" -> tokens: ["1", "a", "i"], separators: [".", "."]

      Parameters

      • format: string

        The format string.

      Returns { tokens: string[]; separators: string[] }

      Object with tokens and separators arrays.

    • Formats a number according to the format string.

      Parameters

      • number: number

        The number to format.

      • format: string

        The format string (e.g., "1", "01", "a", "A", "i", "I").

      • groupingSeparator: string

        Optional grouping separator.

      • groupingSize: string

        Optional grouping size.

      Returns string

      The formatted number string.

    • Converts a number to alphabetic representation.

      Parameters

      • number: number

        The number to convert.

      • uppercase: boolean

        Whether to use uppercase letters.

      Returns string

      The alphabetic representation.

    • Converts a number to Roman numeral representation.

      Parameters

      • number: number

        The number to convert.

      Returns string

      The Roman numeral string.

    • Applies grouping separators to a numeric string.

      Parameters

      • numStr: string

        The numeric string.

      • separator: string

        The grouping separator.

      • size: number

        The grouping size.

      Returns string

      The grouped string.

    • Orders the current node list in the input context according to the sort order specified by xsl:sort child nodes of the current template node. This happens before the operation specified by the current template node is executed.

      Parameters

      • context: ExprContext

        The expression context.

      • template: XNode

        The template node.

      Returns void

      case-order is not implemented.

    • Implements xsl:strip-space. Collects element name patterns for which whitespace-only text nodes should be stripped.

      Parameters

      • template: XNode

        The <xsl:strip-space> node.

      Returns void

    • Implements xsl:preserve-space. Collects element name patterns for which whitespace-only text nodes should be preserved. preserve-space takes precedence over strip-space for matching elements.

      Parameters

      • template: XNode

        The <xsl:preserve-space> node.

      Returns void

    • Determines if a text node from the input document should be stripped. This applies xsl:strip-space and xsl:preserve-space rules to whitespace-only text nodes.

      Parameters

      • textNode: XNode

        The text node to check.

      Returns boolean

      True if the text node should be stripped (not included in output).

    • Matches an element name against a strip-space/preserve-space pattern. Supports:

      • "*" matches any element
      • "prefix:*" matches any element in a namespace
      • "name" matches elements with that local name
      • "prefix:name" matches elements with that QName

      Parameters

      • elementName: string

        The local name of the element.

      • pattern: string

        The pattern to match against.

      • element: XNode

        The element node (for namespace checking).

      Returns boolean

      True if the element matches the pattern.

    • Implements xsl:template.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The <xsl:template> node.

      • Optionaloutput: XNode

        The output. In general, a fragment that will be used by the caller.

      Returns Promise<void>

    • Validates XSLT stylesheet/transform attributes. According to XSLT specification, validates:

      • Required version attribute
      • Valid version values (1.0, 2.0, 3.0)
      • Valid namespace declarations
      • Valid values for optional attributes (extension-element-prefixes, exclude-result-prefixes)

      Parameters

      • stylesheetElement: XNode

        The <xsl:stylesheet> or <xsl:transform> element to validate.

      • context: ExprContext

        The Expression Context for namespace access.

      Returns void

    • Implements <xsl:stylesheet> and <xsl:transform>, and its corresponding validations.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The <xsl:stylesheet> or <xsl:transform> node.

      • Optionaloutput: XNode

        The output. In general, a fragment that will be used by the caller.

      Returns Promise<void>

    • Implements xsl:sequence (XSLT 2.0).

      Constructs a sequence by evaluating the select expression or processing child content. Unlike xsl:copy-of, xsl:sequence returns nodes by reference and can return atomic values.

      Parameters

      • context: ExprContext

        The expression context.

      • template: XNode

        The xsl:sequence element.

      • Optionaloutput: XNode

        The output node.

      Returns Promise<void>

    • Implements xsl:analyze-string (XSLT 2.0).

      Processes a string using a regular expression, with separate handling for matching and non-matching substrings.

      Parameters

      • context: ExprContext

        The expression context.

      • template: XNode

        The xsl:analyze-string element.

      • Optionaloutput: XNode

        The output node.

      Returns Promise<void>

    • Implements xsl:function (XSLT 2.0).

      Declares a stylesheet function that can be called from XPath expressions. Functions are collected during stylesheet initialization and made available to the XPath evaluator.

      Parameters

      • context: ExprContext

        The expression context.

      • template: XNode

        The xsl:function element.

      Returns void

    • Coerce a NodeValue to a specific type based on the 'as' attribute.

      Parameters

      • value: NodeValue

        The value to coerce.

      • type: string

        The target type (e.g., "xs:integer", "xs:string", "xs:boolean").

      Returns NodeValue

      The coerced value.

    • Execute a user-defined xsl:function. Called when a function from userDefinedFunctions is invoked from XPath.

      Parameters

      • context: ExprContext

        The expression context.

      • functionDef: XNode

        The xsl:function node.

      • args: any[]

        The evaluated arguments passed to the function.

      Returns Promise<any>

      The result of the function execution.

    • Synchronously execute a user-defined xsl:function. This is used when functions are called from XPath expressions. Limited to functions that don't require async operations in their body.

      Parameters

      • context: ExprContext

        The expression context.

      • functionDef: XNode

        The xsl:function node.

      • args: any[]

        The evaluated arguments passed to the function.

      Returns any

      The result of the function execution.

    • Implements xsl:result-document (XSLT 2.0).

      Creates a secondary output document. The output is stored in the resultDocuments map, accessible via getResultDocuments().

      Parameters

      • context: ExprContext

        The expression context.

      • template: XNode

        The xsl:result-document element.

      Returns Promise<void>

    • Get all result documents created by xsl:result-document.

      Returns Map<string, string>

      A map of href URIs to serialized output strings.

    • Sets the package loader callback. The callback is called when a package is referenced via xsl:use-package but is not found in the registry.

      Parameters

      • loader: (uri: string, version?: string) => Promise<XNode>

        A function that loads package documents by URI and optional version. Returns the parsed package document, or null if not found.

      Returns void

    • Pre-registers a package for use in transformations. The package is parsed and stored in the internal registry.

      Parameters

      • name: string

        The package name/URI.

      • packageDoc: XNode

        The parsed package document.

      • Optionalversion: string

        Optional semantic version string.

      Returns Promise<void>

    • Implements xsl:perform-sort (XSLT 2.0).

      Sorts a sequence of items without iteration. The sorted sequence is available via xsl:sequence or other sequence-consuming instructions.

      Parameters

      • context: ExprContext

        The expression context.

      • template: XNode

        The xsl:perform-sort element.

      • Optionaloutput: XNode

        The output node.

      Returns Promise<void>

    • Implements xsl:namespace (XSLT 2.0).

      Creates a namespace node in the result tree.

      Parameters

      • context: ExprContext

        The expression context.

      • template: XNode

        The xsl:namespace element.

      • Optionaloutput: XNode

        The output node.

      Returns Promise<void>

    • Evaluates a variable or parameter and set it in the current input context. Implements xsl:variable, xsl:param, and xsl:with-param.

      Parameters

      • context: ExprContext

        The expression context.

      • template: XNode

        The template node.

      • override: boolean

        flag that defines if the value computed here overrides the one already in the input context if that is the case. I.e. decides if this is a default value or a local value. xsl:variable and xsl:with-param override; xsl:param doesn't.

      Returns Promise<void>

    • Traverses the template node tree. Calls the main processing function with the current input context for every child node of the current template node.

      Parameters

      • context: ExprContext

        Normally the Expression Context.

      • template: XNode

        The XSL-T definition.

      • Optionaloutput: XNode

        If set, the output where the transformation should occur.

      Returns Promise<void>

    • Processes child nodes while skipping xsl:on-empty and xsl:on-non-empty. Used by instructions that handle these conditionals explicitly.

      Parameters

      • context: ExprContext
      • template: XNode
      • Optionaloutput: XNode

      Returns Promise<void>

    • Passes template text to the output. The current template node does not specify an XSL-T operation and therefore is appended to the output with all its attributes. Then continues traversing the template node tree.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The XSLT stylesheet or transformation.

      • output: XNode

        The output.

      Returns Promise<void>

    • Determines if a text node in the XSLT template document is to be stripped according to XSLT whitespace stripping rules.

      Parameters

      • template: XNode

        The XSLT template.

      Returns boolean

      TODO

      [XSLT], section 3.4.

      Whitespace stripping on the input document is currently not implemented.

    • Evaluates an XSL-T attribute value template. Attribute value templates are attributes on XSL-T elements that contain XPath expressions in braces {}. The XSL-T expressions are evaluated in the current input context.

      Parameters

      Returns any

      TODO

    • Evaluates text value templates in XSLT 3.0. Text value templates allow XPath expressions in braces {} within text nodes. The expressions are evaluated in the current input context. To include a literal brace, use {{ or }}.

      Parameters

      • value: string

        The text node value to process

      • context: ExprContext

        The expression context

      Returns string

      The processed text with expressions evaluated

    • Evaluates an XPath expression in the current input context as a match.

      Parameters

      • match: string

        TODO

      • context: ExprContext

        The Expression Context.

      • Optionalaxis: string

        The XPath axis. Used when the match does not start with the parent.

      Returns XNode[]

      A list of the found nodes.

      [XSLT] section 5.2, paragraph 1

    • Sets parameters defined by xsl:with-param child nodes of the current template node, in the current input context. This happens before the operation specified by the current template node is executed.

      Parameters

      • context: ExprContext

        The Expression Context.

      • template: XNode

        The template node.

      Returns Promise<void>

    • Apply one or more attribute sets to an element. Parses space-separated attribute set names and applies them.

      Parameters

      • context: ExprContext

        The Expression Context.

      • element: XNode

        The element to apply attributes to.

      • setNames: string

        Space-separated attribute set names.

      Returns Promise<void>

    • Test if an element is a supported extension. Returns false for unrecognized elements in non-XSLT namespaces.

      Parameters

      • node: XNode

        The element to test.

      Returns boolean

      True if the element is supported, false if it's an unrecognized extension.

    • Get the fallback element from an extension element if it exists. Searches for the first direct xsl:fallback child.

      Parameters

      • node: XNode

        The extension element.

      Returns XNode

      The fallback element, or null if not found.

    • Process an extension element with fallback support. If a fallback is defined, executes it; otherwise treats element as literal.

      Parameters

      • context: ExprContext

        The Expression Context.

      • element: XNode

        The extension element.

      • Optionaloutput: XNode

        The output node.

      Returns Promise<void>

    • Test if the given element is an XSLT element, optionally the one with the given name.

      Parameters

      • element: XNode

        The element.

      • Optionalopt_wantedName: string

        The name for comparison.

      Returns boolean

      True, if element is an XSL node. False otherwise.